mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 11:29:12 +00:00
33 lines
642 B
TypeScript
33 lines
642 B
TypeScript
import * as React from 'react';
|
|
import { HorizontalSwitch } from './HorizontalSwitch';
|
|
|
|
export default {
|
|
title: 'Atoms/Horizontal Switch',
|
|
component: HorizontalSwitch,
|
|
args: {
|
|
items: ['true', 'false'],
|
|
value: 'true',
|
|
},
|
|
};
|
|
|
|
const Story = (args) => {
|
|
const [value, setValue] = React.useState(args.value);
|
|
|
|
return (
|
|
<HorizontalSwitch
|
|
{...args}
|
|
value={value}
|
|
onChange={(a) => {
|
|
setValue(a);
|
|
args.onChange(a);
|
|
}}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export const Switch = Story.bind({});
|
|
export const SwitchThree = Story.bind({});
|
|
SwitchThree.args = {
|
|
items: ['aaa', 'bbb', 'ccc'],
|
|
value: 'aaa',
|
|
};
|