Skip to content

Commit

Permalink
Official-storybook: Prop table example for multiple named expor… (#9364)
Browse files Browse the repository at this point in the history
Official-storybook: Prop table example for multiple named exports
  • Loading branch information
shilman authored Jan 9, 2020
2 parents 94adb10 + 2d22ca8 commit 12bc1ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions examples/official-storybook/components/ButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -131,6 +131,7 @@ multipleComponents.story = {
parameters: {
component: ButtonGroup,
subcomponents: {
SubGroup,
'Docgen Button': DocgenButton,
'Base Button': BaseButton,
},
Expand Down

1 comment on commit 12bc1ba

@vercel
Copy link

@vercel vercel bot commented on 12bc1ba Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.