reablocks
Version:
Component library for React
41 lines (39 loc) • 956 B
TypeScript
import { ToggleTheme } from './ToggleTheme';
import { default as React, FC, LegacyRef } from 'react';
export interface ToggleProps {
/**
* Whether the toggle is checked or not.
*/
checked: boolean;
/**
* Whether the toggle is disabled or not.
*/
disabled?: boolean;
/**
* Additional class names to apply to the toggle.
*/
className?: string;
/**
* The size of the toggle.
*/
size?: 'small' | 'medium' | 'large' | string;
/**
* When the toggle is changed.
*/
onChange?: (value: boolean) => void;
/**
* When the toggle was blurred.
*/
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
/**
* Theme for the Toggle.
*/
theme?: ToggleTheme;
}
export interface ToggleRef {
/**
* Reference to the toggle element.
*/
ref?: LegacyRef<HTMLDivElement>;
}
export declare const Toggle: FC<ToggleProps & ToggleRef>;