Skip to content

Commit 6a3a141

Browse files
committed
add story: og images
1 parent d3d2992 commit 6a3a141

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { Meta, StoryObj } from '@nuxtjs/storybook'
2+
import Component from './Default.vue'
3+
4+
const meta = {
5+
component: Component,
6+
tags: ['autodocs'],
7+
decorators: [
8+
() => ({
9+
template: '<div style="width:1200px;height:630px; outline:1px solid red"><story/></div>',
10+
}),
11+
],
12+
argTypes: {
13+
primaryColor: {
14+
control: { type: 'color' },
15+
description: 'Primary color used throughout the OG image',
16+
},
17+
title: {
18+
control: { type: 'text' },
19+
description: 'Main title displayed in the OG image',
20+
},
21+
description: {
22+
control: { type: 'text' },
23+
description: 'Description text (supports **bold** markdown)',
24+
},
25+
},
26+
} satisfies Meta<typeof Component>
27+
28+
export default meta
29+
type Story = StoryObj<typeof meta>
30+
31+
export const Default: Story = {}
32+
33+
export const CustomContent: Story = {
34+
args: {
35+
title: 'Custom Package',
36+
description: 'an awesome **customizable** OG image generator',
37+
primaryColor: '#f59e0b',
38+
},
39+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { Meta, StoryObj } from '@nuxtjs/storybook'
2+
import Component from './Package.vue'
3+
4+
const meta = {
5+
component: Component,
6+
decorators: [
7+
() => ({
8+
template: '<div style="width:1200px;height:630px; outline:1px solid red"><story/></div>',
9+
}),
10+
],
11+
} satisfies Meta<typeof Component>
12+
13+
export default meta
14+
type Story = StoryObj<typeof meta>
15+
16+
export const Package: Story = {
17+
args: { name: 'vue', version: 'latest' },
18+
}

0 commit comments

Comments
 (0)