mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:11:29 +08:00
3.1 KiB
3.1 KiB
import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';
const meta: Meta<Button> = {
component: Button,
parameters: {
// 👇 Set default viewport for all component stories
viewport: { defaultViewport: 'tablet' },
},
};
export default meta;
type Story = StoryObj<Button>;
export const OnPhone: Story = {
parameters: {
// 👇 Override default viewport for this story
viewport: { defaultViewport: 'mobile1' },
},
};
import { Button } from './Button';
export default {
component: Button,
parameters: {
// 👇 Set default viewport for all component stories
viewport: { defaultViewport: 'tablet' },
},
};
export const OnPhone = {
parameters: {
// 👇 Override default viewport for this story
viewport: { defaultViewport: 'mobile1' },
},
};
// Replace your-framework with the name of your framework
import type { Meta, StoryObj } from '@storybook/your-framework';
import { Button } from './Button';
const meta = {
component: Button,
parameters: {
// 👇 Set default viewport for all component stories
viewport: { defaultViewport: 'tablet' },
},
} satisfies Meta<typeof Button>;
export default meta;
type Story = StoryObj<typeof meta>;
export const OnPhone: Story = {
parameters: {
// 👇 Override default viewport for this story
viewport: { defaultViewport: 'mobile1' },
},
};
// Replace your-framework with the name of your framework
import type { Meta, StoryObj } from '@storybook/your-framework';
import { Button } from './Button';
const meta: Meta<typeof Button> = {
component: Button,
parameters: {
// 👇 Set default viewport for all component stories
viewport: { defaultViewport: 'tablet' },
},
};
export default meta;
type Story = StoryObj<typeof Button>;
export const OnPhone: Story = {
parameters: {
// 👇 Override default viewport for this story
viewport: { defaultViewport: 'mobile1' },
},
};
export default {
component: 'demo-button',
parameters: {
// 👇 Set default viewport for all component stories
viewport: { defaultViewport: 'tablet' },
},
};
export const OnPhone = {
parameters: {
// 👇 Override default viewport for this story
viewport: { defaultViewport: 'mobile1' },
},
};
import type { Meta, StoryObj } from '@storybook/web-components';
const meta: Meta = {
component: 'demo-button',
parameters: {
// 👇 Set default viewport for all component stories
viewport: { defaultViewport: 'tablet' },
},
};
export default meta;
type Story = StoryObj;
export const OnPhone: Story = {
parameters: {
// 👇 Override default viewport for this story
viewport: { defaultViewport: 'mobile1' },
},
};