1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-30 17:30:23 +02:00
Files
nes.css/story/inputs/checkboxes.template.js
2021-05-11 14:21:01 +08:00

27 lines
602 B
JavaScript

import { boolean } from '@storybook/addon-knobs';
import classNames from 'classnames';
export default () => {
const isDark = boolean('is-dark', false);
const isDisabled = boolean('is-disabled', false);
const checkBoxClasses = classNames(
'nes-checkbox',
{
'is-dark': isDark,
},
{
'is-disabled': isDisabled,
},
);
return `
<div style="${isDark ? 'background-color: black;' : ''}">
<label>
<input type="checkbox" ${isDisabled && 'disabled'} class="${checkBoxClasses}" checked />
<span>Enable</span>
</label>
</div>
`;
};