File Editor
Directories:
.. (Back)
input
ripple
Files:
button-group.stories.js
button.stories.js
categories.stories.js
codemirror.stories.js
color.stories.js
range.stories.js
select-advanced.stories.js
select-menu.stories.js
tags.stories.js
toggle.stories.js
Create New File
Create
Edit File: toggle.stories.js
// External dependencies. import React from 'react'; import { useArgs } from '@storybook/preview-api'; // Internal dependencies. import Toggle from '../../controls/toggle/toggle'; export default { title: 'Controls/Toggle', component: Toggle, render: (args) => { const [{ value }, updateArgs] = useArgs(); const handleChange = (name, newValue) => { updateArgs({ value: newValue }); }; return ( <Toggle {...args} onChange={handleChange} /> ); }, argTypes:{ onChange:{ table: { disable: true, }, }, options:{ table: { disable: true, }, }, } }; export const Default = { args: { value: 'off', options: { on: 'on', off: 'off', type: 'default' }, }, }; export const ToggledOn = { args: { ...Default.args, value: 'on', }, };
Save Changes
Rename File
Rename