UNPKG

@cimpress/react-components

Version:
30 lines 1.05 kB
import React from 'react'; import { PublicComponentProps } from './types'; export interface ToggleProps extends PublicComponentProps { /** * Disables the switch. onClick function will not fire. */ disabled?: boolean; /** * Text to display for the 'off' position of the switch. For best results, limit to 3 or fewer characters. */ offText?: string; /** * Controls whether or not the switch is in the 'on' position. */ on?: boolean; /** * Function to trigger when the toggle is clicked. */ onClick?: (e: any) => void; /** * Text to display for the 'on' position of the switch. For best results, limit to 3 or fewer characters. */ onText?: string; /** * Determines the size of the switch. Defaults to the larger size, pass 'sm' for a smaller toggle. */ size?: 'sm'; } export declare const Toggle: ({ className, disabled, offText, on, onClick, onText, size, style, ...props }: ToggleProps) => React.JSX.Element; //# sourceMappingURL=Toggle.d.ts.map