@furystack/shades-common-components
Version:
Common UI components for FuryStack Shades
51 lines • 1.43 kB
TypeScript
import type { PartialElement } from '@furystack/shades';
import type { Palette } from '../../services/theme-provider-service.js';
import type { ComponentSize } from '../component-size.js';
export type SwitchProps = {
/**
* Whether the switch is checked (on)
*/
checked?: boolean;
/**
* Whether the switch is disabled
*/
disabled?: boolean;
/**
* The palette color for the switch
*/
color?: keyof Palette;
/**
* Callback when the checked state changes
*/
onchange?: (event: Event) => void;
/**
* Label text or element displayed next to the switch
*/
labelTitle?: JSX.Element | string;
/**
* The name attribute for the underlying input element
*/
name?: string;
/**
* The value attribute for the underlying input element
*/
value?: string;
/**
* Whether the switch is required
*/
required?: boolean;
/**
* The size of the switch
*/
size?: ComponentSize;
/**
* Optional props for the label element
*/
labelProps?: PartialElement<HTMLLabelElement>;
};
export declare const Switch: (props: SwitchProps & Omit<Partial<HTMLElement>, "style"> & {
style?: Partial<CSSStyleDeclaration>;
} & {
ref?: import("@furystack/shades").RefObject<Element>;
}, children?: import("@furystack/shades").ChildrenList) => JSX.Element;
//# sourceMappingURL=switch.d.ts.map