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 authored and opr committed Dec 10, 2020
1 parent 483b1e3 commit 503776d
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 503776d

Please sign in to comment.