UNPKG

@accelint/design-toolkit

Version:

An open-source component library to serve as part of the entire ecosystem of UX for Accelint.

45 lines (42 loc) 1.08 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { SwitchProps } from './types.js'; import 'react'; import 'react-aria-components'; /** * Switch - A toggle control for binary state changes * * Provides an accessible toggle switch component for enabling/disabling features * or settings. Offers clear visual feedback for on/off states with smooth transitions * and proper keyboard and screen reader support. * * @example * // Basic switch * <Switch>Enable notifications</Switch> * * @example * // Controlled switch * <Switch * isSelected={isEnabled} * onChange={setIsEnabled} * > * Dark mode * </Switch> * * @example * // Switch with default state * <Switch defaultSelected> * Auto-save documents * </Switch> * * @example * // Disabled switch * <Switch isDisabled> * Premium feature (upgrade required) * </Switch> * * @example * // Switch without label (icon-only) * <Switch aria-label="Toggle sidebar" /> */ declare function Switch({ ref, ...props }: SwitchProps): react_jsx_runtime.JSX.Element; export { Switch };