@als-tp/als-react-ts-ui
Version:
A comprehensive React TypeScript UI component library built with Base UI by ALSInnovation
45 lines • 1.46 kB
TypeScript
import * as React from "react";
/**
* Props for the ALSToggle component
*/
export interface ALSToggleProps {
/** Unique value for the toggle when used in a toggle group */
value?: string;
/** Whether the toggle is pressed (controlled) */
pressed?: boolean;
/** Default pressed state (uncontrolled) */
defaultPressed?: boolean;
/** Callback when pressed state changes */
onPressedChange?: (pressed: boolean) => void;
/** Whether the toggle is disabled */
disabled?: boolean;
/** Size variant */
size?: "sm" | "md" | "lg";
/** Visual variant */
variant?: "default" | "primary" | "success" | "error";
/** Additional CSS class - can be a string or function that receives toggle state */
className?: string | ((state: {
pressed: boolean;
disabled: boolean;
}) => string | undefined);
/** Inline styles */
style?: React.CSSProperties;
/** Accessible label */
"aria-label"?: string;
/** ID of element that labels this toggle */
"aria-labelledby"?: string;
/** Children content */
children?: React.ReactNode;
}
/**
* ALSToggle - A two-state button component based on Base UI Toggle
*
* @example
* ```tsx
* <ALSToggle aria-label="Toggle feature">
* Toggle me
* </ALSToggle>
* ```
*/
export declare const ALSToggle: React.ForwardRefExoticComponent<ALSToggleProps & React.RefAttributes<HTMLButtonElement>>;
//# sourceMappingURL=ALSToggle.d.ts.map