docs/_snippets/button-story-component-args-primary.md
import type { Meta } from '@storybook/angular';
import { Button } from './button.component';
const meta: Meta<Button> = {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
};
export default meta;
import preview from '../.storybook/preview';
import { Button } from './button.component';
const meta = preview.meta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});
import { Button } from './Button';
export default {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
import type { Meta } from '@storybook/your-framework';
import { Button } from './Button';
const meta = {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
} satisfies Meta<typeof Button>;
export default meta;
import { Button } from './Button';
export default {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
};
import type { Meta } from 'storybook-solidjs-vite';
import { Button } from './Button';
const meta = {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
} satisfies Meta<typeof Button>;
export default meta;
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import Button from './Button.svelte';
const { Story } = defineMeta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});
</script>
import Button from './Button.svelte';
export default {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import Button from './Button.svelte';
const { Story } = defineMeta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});
</script>
// Replace your-framework with svelte-vite or sveltekit
import type { Meta } from '@storybook/your-framework';
import Button from './Button.svelte';
const meta = {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
} satisfies Meta<typeof Button>;
export default meta;
import Button from './Button.vue';
export default {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
};
import type { Meta } from '@storybook/vue3-vite';
import Button from './Button.vue';
const meta = {
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
} satisfies Meta<typeof Button>;
export default meta;
import preview from '../.storybook/preview';
import Button from './Button.vue';
const meta = preview.meta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});
import preview from '../.storybook/preview';
import Button from './Button.vue';
const meta = preview.meta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});
export default {
component: 'demo-button',
// ๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
// ๐ Now all Button stories will be primary.
primary: true,
},
};
import type { Meta, StoryObj } from '@storybook/web-components-vite';
const meta: Meta = {
component: 'demo-button',
// ๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
// ๐ Now all Button stories will be primary.
primary: true,
},
};
export default meta;
import preview from '../.storybook/preview';
const meta = preview.meta({
component: 'demo-button',
// ๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
// ๐ Now all Button stories will be primary.
primary: true,
},
});
import preview from '../.storybook/preview';
const meta = preview.meta({
component: 'demo-button',
// ๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
// ๐ Now all Button stories will be primary.
primary: true,
},
});
import preview from '../.storybook/preview';
import { Button } from './Button';
const meta = preview.meta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});
import preview from '../.storybook/preview';
import { Button } from './Button';
const meta = preview.meta({
component: Button,
//๐ Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//๐ Now all Button stories will be primary.
primary: true,
},
});