diff --git a/packages/carbon-react/src/components/Skeleton/Skeleton.stories.js b/packages/carbon-react/src/components/Skeleton/Skeleton.stories.js new file mode 100644 index 000000000000..be7685aa9bec --- /dev/null +++ b/packages/carbon-react/src/components/Skeleton/Skeleton.stories.js @@ -0,0 +1,70 @@ +import React from 'react'; +import { SkeletonPlaceholder, SkeletonText } from 'carbon-components-react'; +import { withKnobs, select, boolean, number } from '@storybook/addon-knobs'; + +const classNames = { + 'my--skeleton__placeholder--small': 'my--skeleton__placeholder--small', + 'my--skeleton__placeholder--medium': 'my--skeleton__placeholder--medium', + 'my--skeleton__placeholder--large': 'my--skeleton__placeholder--large', +}; + +const placeholderProps = () => ({ + className: select('Classes with different sizes', classNames), +}); + +const widths = { + '100%': '100%', + '250px': '250px', +}; + +const textProps = () => ({ + heading: boolean('Skeleton text at a larger size (heading)'), + paragraph: boolean('Use multiple lines of text (paragraph)'), + lineCount: number('The number of lines in a paragraph (lineCount)', 3), + width: select( + 'Width (in px or %) of single line of text or max-width of paragraph lines (width)', + widths, + '100%' + ), +}); + +export default { + title: 'Components/Skeleton', + decorators: [withKnobs], +}; + +export const _SkeletonPlaceholder = () => { + return ( +
+