UNPKG

@cimpress/react-components

Version:
50 lines 1.82 kB
import React from 'react'; import { CodeExample } from '@cimpress/react-components'; import ToggleCode from '!raw-loader!./toggle.jsx'; import ToggleDemo from './toggle.jsx'; import ComponentDoc from '../../shared/TabbedComponentDoc'; const ToggleDocs = () => { const toggleProps = [ { name: 'on', type: 'boolean', default: '', description: "Controls whether or not the switch is in the 'on' position", }, { name: 'onClick', type: 'function', default: '', description: 'Function to trigger when the toggle is clicked.', }, { name: 'onText', type: 'string', default: 'On', description: "Text to display for the 'on' position of the switch. For best results, limit to 3 or fewer characters.", }, { name: 'offText', type: 'string', default: 'Off', description: "Text to display for the 'off' position of the switch. For best results, limit to 3 or fewer characters.", }, { name: 'size', type: 'string', default: '', description: "Determines the size of the switch. Defaults to the larger size, pass 'sm' for a smaller toggle.", }, { name: 'disabled', type: 'boolean', default: 'false', description: 'Disables the switch. onClick function will not fire.', }, ]; return (React.createElement(ComponentDoc, { name: "Toggle", propInfos: toggleProps }, React.createElement(ToggleDemo, null), React.createElement(CodeExample, { code: ToggleCode }))); }; export default ToggleDocs; //# sourceMappingURL=index.js.map