mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
Official-storybook: Add prop table example for multiple named exports
This commit is contained in:
parent
94adb10df4
commit
2d22ca81f5
@ -12,6 +12,25 @@ ButtonGroup.defaultProps = {
|
||||
};
|
||||
|
||||
ButtonGroup.propTypes = {
|
||||
/**
|
||||
* Background color for the group
|
||||
*/
|
||||
background: PropTypes.string,
|
||||
children: PropTypes.arrayOf(PropTypes.element),
|
||||
};
|
||||
|
||||
/** SubGroup component description from docgen */
|
||||
export const SubGroup = ({ background, children }) => <div style={{ background }}>{children}</div>;
|
||||
|
||||
SubGroup.defaultProps = {
|
||||
background: '#0f0',
|
||||
children: null,
|
||||
};
|
||||
|
||||
SubGroup.propTypes = {
|
||||
/**
|
||||
* Background color for the sub-group
|
||||
*/
|
||||
background: PropTypes.string,
|
||||
children: PropTypes.arrayOf(PropTypes.element),
|
||||
};
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
} from '@storybook/addon-docs/blocks';
|
||||
import { DocgenButton } from '../../components/DocgenButton';
|
||||
import BaseButton from '../../components/BaseButton';
|
||||
import { ButtonGroup } from '../../components/ButtonGroup';
|
||||
import { ButtonGroup, SubGroup } from '../../components/ButtonGroup';
|
||||
|
||||
export default {
|
||||
title: 'Addons/Docs/stories docs blocks',
|
||||
@ -131,6 +131,7 @@ multipleComponents.story = {
|
||||
parameters: {
|
||||
component: ButtonGroup,
|
||||
subcomponents: {
|
||||
SubGroup,
|
||||
'Docgen Button': DocgenButton,
|
||||
'Base Button': BaseButton,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user