mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 06:51:19 +08:00
8.1 KiB
8.1 KiB
import type { Meta, StoryObj } from '@storybook/angular';
import { YourComponent } from './YourComponent.component';
const meta: Meta<YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<YourComponent>;
export const ArrayInclude: Story = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude: Story = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude: Story = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude: Story = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import YourComponent from './YourComponent.svelte';
const { Story } = defineMeta({
component: YourComponent,
});
</script>
<Story
name="ArrayInclude"
parameters={{
controls: { include: ['foo', 'bar'] },
}}
/>
<Story
name="RegexInclude"
parameters={{
controls: { include: /^hello*/ },
}}
/>
<Story
name="ArrayExclude"
parameters={{
controls: { exclude: ['foo', 'bar'] },
}}
/>
<Story
name="RegexExclude"
parameters={{
controls: { exclude: /^hello*/ },
}}
/>
import YourComponent from './YourComponent.svelte';
export default {
component: YourComponent,
};
export const ArrayInclude = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
import { YourComponent } from './YourComponent';
export default {
component: YourComponent,
};
export const ArrayInclude = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import YourComponent from './YourComponent.svelte';
const { Story } = defineMeta({
component: YourComponent,
});
</script>
<Story
name="ArrayInclude"
parameters={{
controls: { include: ['foo', 'bar'] },
}}
/>
<Story
name="RegexInclude"
parameters={{
controls: { include: /^hello*/ },
}}
/>
<Story
name="ArrayExclude"
parameters={{
controls: { exclude: ['foo', 'bar'] },
}}
/>
<Story
name="RegexExclude"
parameters={{
controls: { exclude: /^hello*/ },
}}
/>
import type { Meta, StoryObj } from '@storybook/svelte';
import YourComponent from './YourComponent.svelte';
const meta = {
component: YourComponent,
} satisfies Meta<typeof YourComponent>;
export default meta;
type Story = StoryObj<typeof meta>;
export const ArrayInclude: Story = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude: Story = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude: Story = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude: Story = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
// Replace your-framework with the name of your framework
import type { Meta, StoryObj } from '@storybook/your-framework';
import { YourComponent } from './YourComponent';
const meta = {
component: YourComponent,
} satisfies Meta<typeof YourComponent>;
export default meta;
type Story = StoryObj<typeof meta>;
export const ArrayInclude: Story = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude: Story = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude: Story = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude: Story = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import YourComponent from './YourComponent.svelte';
const { Story } = defineMeta({
component: YourComponent,
});
</script>
<Story
name="ArrayInclude"
parameters={{
controls: { include: ['foo', 'bar'] },
}}
/>
<Story
name="RegexInclude"
parameters={{
controls: { include: /^hello*/ },
}}
/>
<Story
name="ArrayExclude"
parameters={{
controls: { exclude: ['foo', 'bar'] },
}}
/>
<Story
name="RegexExclude"
parameters={{
controls: { exclude: /^hello*/ },
}}
/>
import type { Meta, StoryObj } from '@storybook/svelte';
import YourComponent from './YourComponent.svelte';
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<typeof YourComponent>;
export const ArrayInclude: Story = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude: Story = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude: Story = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude: Story = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
// Replace your-framework with the name of your framework
import type { Meta, StoryObj } from '@storybook/your-framework';
import { YourComponent } from './YourComponent';
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<typeof YourComponent>;
export const ArrayInclude: Story = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude: Story = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude: Story = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude: Story = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
export default {
component: 'your-component',
};
export const ArrayInclude = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude = {
parameters: {
controls: { exclude: /^hello*/ },
},
};
import type { Meta, StoryObj } from '@storybook/web-components';
const meta: Meta = {
component: 'your-component',
};
export default meta;
type Story = StoryObj;
export const ArrayInclude: Story = {
parameters: {
controls: { include: ['foo', 'bar'] },
},
};
export const RegexInclude: Story = {
parameters: {
controls: { include: /^hello*/ },
},
};
export const ArrayExclude: Story = {
parameters: {
controls: { exclude: ['foo', 'bar'] },
},
};
export const RegexExclude: Story = {
parameters: {
controls: { exclude: /^hello*/ },
},
};