retro-react
Version:
A React component library for building retro-style websites
56 lines (55 loc) • 1.44 kB
TypeScript
/// <reference types="react" />
import { ThemeUICSSObject } from 'theme-ui';
import { ComponentColors } from "../../utils/getColorScheme";
export declare type SwitchVariant = 'rounded' | 'square';
export declare type SwitchSize = 'small' | 'medium' | 'large';
export interface SwitchProps extends Omit<React.HTMLAttributes<HTMLLabelElement>, 'onChange'> {
/**
* The variant of the Switch.
*
* @default 'square'
*/
variant?: SwitchVariant;
/**
*
* The size of the Switch.
*
* @default 'medium'
*/
size?: SwitchSize;
/**
*
* The color of the Switch.
*
* @default 'primary'
*/
color?: ComponentColors | 'greyscale';
/**
*
* The controlled state of the Switch.
*
* @default false
*/
toggled?: boolean;
/**
* Is the Switch disabled?
*
* @default false
*/
disabled?: boolean;
/**
*
* The onChange event handler of the Switch.
*
* @default undefined
*/
onChange?: React.ChangeEventHandler<HTMLInputElement>;
sx?: ThemeUICSSObject;
}
/**
* Switches are used to toggle between two states.
*
* @example
* <Switch toggled={toggled} onChange={handleToggle} />
*/
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLLabelElement>>;