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

Commit

Permalink
story for CheckboxControl aka Checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
haszari committed Aug 20, 2020
1 parent 55d563d commit 27f749e
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 Component from '../';

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

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

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

0 comments on commit 27f749e

Please sign in to comment.