| Server IP : 72.60.233.178 / Your IP : 216.73.216.91 Web Server : Apache System : Linux srv1210665.hstgr.cloud 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : armaladmin ( 1001) PHP Version : 8.3.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/armaladmin/public_html/wp-content/themes/Divi/common/stories/controls/ |
Upload File : |
// 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',
},
};