@eureca/eureca-ui
Version:
UI component library of Eureca's user and admin apps
28 lines (23 loc) • 615 B
JavaScript
import React, { useState } from 'react';
import { withKnobs, text, boolean } from '@storybook/addon-knobs';
import { Checkbox } from '../';
export default {
title: 'Material/Checkbox',
decorators: [withKnobs],
includeStories: [],
};
export function BasicCheckbox() {
const [value, setValue] = useState(false);
const labelText = text('Label', 'Label text');
const isDisabled = boolean('Disabled');
return (
<Checkbox
label={labelText}
name="clickable-label"
value={value}
checked={value}
disabled={isDisabled}
onChange={() => setValue(!value)}
/>
);
}