Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Add storybook demo for CheckboxControl (#3030)
Browse files Browse the repository at this point in the history
* story for CheckboxControl aka Checkbox

* Rename exported story to Default and use correct component name

This keeps our stories more consistent
  • Loading branch information
haszari committed Dec 10, 2020
1 parent 483b1e3 commit 83da31e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions assets/js/base/components/checkbox-control/stories/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* External dependencies
*/
import { text } from '@storybook/addon-knobs';
import { useState } from 'react';

/**
* Internal dependencies
*/
import CheckboxControl from '../';

export default {
title: 'WooCommerce Blocks/@base-components/CheckboxControl',
component: CheckboxControl,
};

export const Default = () => {
const [ checked, setChecked ] = useState( false );

return (
<CheckboxControl
label={ text( 'Label', 'Yes please' ) }
checked={ checked }
onChange={ ( value ) => setChecked( value ) }
/>
);
};

0 comments on commit 83da31e

Please sign in to comment.