beta-parity-react
Version:
Beta Parity React Components
65 lines • 1.54 kB
TypeScript
import React from 'react';
import './index.css';
import './variables.css';
declare const sizeMap: {
readonly sm: "small";
readonly md: "medium";
readonly lg: "large";
};
/**
* Props for the Switch component.
*
* Extends properties from the `button` element.
*/
export interface SwitchProps extends React.ComponentPropsWithoutRef<'button'> {
/**
* The state of the switch (controlled).
*
* @default undefined
* @memberof SwitchProps
*/
active?: boolean;
/**
* The default state of the switch (initially).
*
* @default false
* @memberof SwitchProps
*/
defaultActive?: boolean;
/**
* The size of the switch.
*
* @default 'md'
* @memberof SwitchProps
*/
switchSize?: keyof typeof sizeMap;
/**
* The disabled state of the switch.
*
* @default false
* @memberof SwitchProps
*/
disabled?: boolean;
/**
* The icon state of the switch (on/off the icon).
*
* @default false
* @memberof SwitchProps
*/
icon?: boolean;
/**
* The toggle handler of the switch.
*
* @param active The new state of the switch.
* @memberof SwitchProps
*/
onToggle?: (active: boolean) => void;
}
/**
* **Parity Switch**.
*
* @see {@link https://beta-parity-react.vercel.app/switch Parity Switch}
*/
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
export {};
//# sourceMappingURL=index.d.ts.map