@synergycodes/axiom
Version:
A React library for creating node-based UIs and diagram-driven applications. Perfect for React Flow users, providing ready-to-use node templates and components that work seamlessly with React Flow's ecosystem.
43 lines (42 loc) • 1.33 kB
TypeScript
import { SwitchProps } from '@mui/base';
import { ChangeEvent } from 'react';
import { SelectorSize } from '../../shared/types/selector-size';
export type BaseSwitchProps = {
/**
* Size of the switch component
*/
size?: SelectorSize;
/**
* Custom styles to apply to the switch
*/
styles?: string;
/**
* Custom content for the thumb of the switch
*/
thumbChildren?: React.ReactNode;
/**
* Custom content for the track of the switch
*/
trackChildren?: React.ReactNode;
/**
* Custom class name for the switch component
*/
className?: string;
/**
* Whether the switch is checked or not
*/
checked?: boolean;
/**
* Whether the switch is disabled
*/
disabled?: boolean;
/**
* Callback function when the switch state changes
*/
onChange?: (checked: boolean, event: ChangeEvent<HTMLInputElement>) => void;
} & Omit<SwitchProps, 'onChange'>;
/**
* A Switch component that allows users to toggle between two states, such as on and off.
* Typically used for settings or preferences, it provides immediate visual feedback.
*/
export declare function Switch({ size, className, styles, thumbChildren, trackChildren, onChange, ...props }: BaseSwitchProps): import("react/jsx-runtime").JSX.Element;