@storybook/react#ComponentMeta TypeScript Examples
The following examples show how to use
@storybook/react#ComponentMeta.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.stories.tsx From frontend with BSD 3-Clause "New" or "Revised" License | 6 votes |
componentMeta: ComponentMeta<IComponent> = {
title: 'Icons',
subcomponents: Icons,
decorators: [
story => (
<div
style={{
display: 'flex',
alignItems: 'center',
flex: 'auto',
flexWrap: 'wrap',
margin: '0 10rem'
}}
>{story()}
</div>
)
],
args: {
height: 40,
width: 40
},
argTypes: {
style: {
control: {
type: 'object',
defaultValue: {}
}
}
}
}
Example #2
Source File: Avatar.stories.tsx From frontend with BSD 3-Clause "New" or "Revised" License | 5 votes |
componentMeta: ComponentMeta<typeof Avatar> = {
title: 'modern/Avatar',
component: Avatar,
args: {
src: 'https://lain.bgm.tv/pic/user/l/000/00/00/1.jpg',
size: 'small'
}
}
Example #3
Source File: button.stories.tsx From frontend with BSD 3-Clause "New" or "Revised" License | 5 votes |
storyMeta: ComponentMeta<typeof Button> = {
title: 'modern/Button',
component: Button
}
Example #4
Source File: Divider.stories.tsx From frontend with BSD 3-Clause "New" or "Revised" License | 5 votes |
componentMeta: ComponentMeta<typeof Divider> = { title: 'Grid/Divider', component: Divider, decorators: [ story => <div style={{ width: '15vw', height: '15vh' }}>{story()}</div> ] }
Example #5
Source File: Image.stories.tsx From frontend with BSD 3-Clause "New" or "Revised" License | 5 votes |
componentMeta: ComponentMeta<typeof Image> = {
title: 'modern/Image',
component: Image
}
Example #6
Source File: Input.stories.tsx From frontend with BSD 3-Clause "New" or "Revised" License | 5 votes |
componentMeta: ComponentMeta<typeof Input> = {
title: 'modern/Input',
component: Input
}
Example #7
Source File: base.tsx From persian-mobile-datepicker with MIT License | 5 votes |
export function createBaseStory(title: string): ComponentMeta<typeof Picker> {
return {
title,
component: Picker,
argTypes: baseArgs,
decorators: [(Story): JSX.Element => <Story />],
};
}