Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook: Add Placeholder component story #19734

Merged
merged 2 commits into from
Jan 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions packages/components/src/placeholder/stories/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* External dependencies
*/
import { boolean, text } from '@storybook/addon-knobs';

/**
* Internal dependencies
*/
import Placeholder from '../';
import TextControl from '../../text-control';

export default { title: 'Components/Placeholder', component: Placeholder };

export const _default = () => {
const icon = text( 'Icon', 'smiley' );
const instructions = text( 'Instructions', 'Here are instructions you should follow' );
const label = text( 'Label', 'My Placeholder Label' );
const isColumnLayout = boolean( 'isColumnLayout', false );

return (
<Placeholder
icon={ icon }
instructions={ instructions }
label={ label }
isColumnLayout={ isColumnLayout }
>
<div>
<TextControl
label="Sample Field"
placeholder="Enter something here"
/>
</div>
</Placeholder>
);
};