docs/_snippets/list-story-unchecked.md
import { type Meta, type StoryObj, moduleMetadata } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import { List } from './list.component';
import { ListItem } from './list-item.component';
//๐ Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
const meta: Meta<List> = {
component: List,
decorators: [
moduleMetadata({
declarations: [List, ListItem],
imports: [CommonModule],
}),
],
};
export default meta;
type Story = StoryObj<List>;
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const OneItem: Story = {
render: (args) => ({
props: args,
template: `
<app-list>
<app-list-item [item]="item"></app-list-item>
</app-list>
`,
}),
args: {
...Unchecked.args,
},
};
import { CommonModule } from '@angular/common';
import { moduleMetadata } from '@storybook/angular';
import preview from '../.storybook/preview';
import { List } from './list.component';
import { ListItem } from './list-item.component';
//๐ Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
const meta = preview.meta({
component: List,
decorators: [
moduleMetadata({
declarations: [List, ListItem],
imports: [CommonModule],
}),
],
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const OneItem = meta.story({
render: (args) => ({
props: args,
template: `
<app-list>
<app-list-item [item]="item"></app-list-item>
</app-list>
`,
}),
args: {
...Unchecked.input.args,
},
});
import { List } from './List';
//๐ Instead of importing ListItem, we import the stories
import { Unchecked } from './ListItem.stories';
export default {
component: List,
};
export const OneItem = {
render: (args) => (
<List {...args}>
<Unchecked {...Unchecked.args} />
</List>
),
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
import type { Meta, StoryObj } from '@storybook/your-framework';
import { List } from './List';
//๐ Instead of importing ListItem, we import the stories
import { Unchecked } from './ListItem.stories';
export const meta = {
component: List,
} satisfies Meta<typeof List>;
export default meta;
type Story = StoryObj<typeof meta>;
export const OneItem: Story = {
render: (args) => (
<List {...args}>
<Unchecked {...Unchecked.args} />
</List>
),
};
import { List } from './List';
//๐ Instead of importing ListItem, we import the stories
import { Unchecked } from './ListItem.stories';
export default {
component: List,
};
export const OneItem = {
render: (args) => (
<List {...args}>
<Unchecked {...Unchecked.args} />
</List>
),
};
import type { Meta, StoryObj } from 'storybook-solidjs-vite';
import { List } from './List';
//๐ Instead of importing ListItem, we import the stories
import { Unchecked } from './ListItem.stories';
export const meta = {
component: List,
} satisfies Meta<typeof List>;
export default meta;
type Story = StoryObj<typeof meta>;
export const OneItem: Story = {
render: (args) => (
<List {...args}>
<Unchecked {...Unchecked.args} />
</List>
),
};
import List from './List.vue';
import ListItem from './ListItem.vue';
//๐ Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
export default {
component: List,
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const OneItem = {
args: {
...Unchecked.args,
},
render: (args) => ({
components: { List, ListItem },
setup() {
//๐ The args will now be passed down to the template
return { args };
},
template: '<List v-bind="args"><ListItem v-bind="args"/></List>',
}),
};
import type { Meta, StoryObj } from '@storybook/vue3-vite';
import List from './List.vue';
import ListItem from './ListItem.vue';
//๐ Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
const meta = {
component: List,
} satisfies Meta<typeof List>;
export default meta;
type Story = StoryObj<typeof meta>;
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const OneItem: Story = {
render: (args) => ({
components: { List, ListItem },
setup() {
//๐ The args will now be passed down to the template
return { args };
},
template: '<List v-bind="args"><ListItem v-bind="args"/></List>',
}),
args: {
...Unchecked.args,
},
};
import preview from '../.storybook/preview';
import List from './List.vue';
import ListItem from './ListItem.vue';
//๐ Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
const meta = preview.meta({
component: List,
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const OneItem = meta.story({
render: (args) => ({
components: { List, ListItem },
setup() {
//๐ The args will now be passed down to the template
return { args };
},
template: '<List v-bind="args"><ListItem v-bind="args"/></List>',
}),
args: {
...Unchecked.input.args,
},
});
import preview from '../.storybook/preview';
import List from './List.vue';
import ListItem from './ListItem.vue';
//๐ Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
const meta = preview.meta({
component: List,
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const OneItem = meta.story({
render: (args) => ({
components: { List, ListItem },
setup() {
//๐ The args will now be passed down to the template
return { args };
},
template: '<List v-bind="args"><ListItem v-bind="args"/></List>',
}),
args: {
...Unchecked.input.args,
},
});
import preview from '../.storybook/preview';
import { List } from './List';
//๐ Instead of importing ListItem, we import the stories
import { Unchecked } from './ListItem.stories';
const meta = preview.meta({
component: List,
});
export const OneItem = meta.story({
render: (args) => (
<List {...args}>
<Unchecked {...Unchecked.input.args} />
</List>
),
});
import preview from '../.storybook/preview';
import { List } from './List';
//๐ Instead of importing ListItem, we import the stories
import { Unchecked } from './ListItem.stories';
const meta = preview.meta({
component: List,
});
export const OneItem = meta.story({
render: (args) => (
<List {...args}>
<Unchecked {...Unchecked.input.args} />
</List>
),
});