tharikida-ui
Version:
A modern, lightweight React UI component library with built-in theming, accessibility, and full TypeScript support. Create beautiful, responsive, and customizable web apps faster with ready-to-use components for any project.
23 lines (22 loc) • 1.21 kB
TypeScript
import React from "react";
/**
* `ToggleSwitch` is a custom switch component supporting controlled/uncontrolled usage, theming, and custom styles.
*
* @param {object} props - The properties to customize the `ToggleSwitch` component.
* @param {boolean} [props.checked] - Controls the checked state (controlled component). If not provided, the switch manages its own state.
* @param {(event: React.ChangeEvent<HTMLInputElement>) => void} [props.onChange] - Called when the switch is toggled. Receives the change event.
* @param {React.CSSProperties} [props.styles] - Custom styles for the outer label.
* @param {string} [props.className] - Additional className for the outer label.
* @param {boolean} [props.disabled] - Disables the switch if true.
*
* @returns {JSX.Element} A styled toggle switch component.
*/
export interface ToggleSwitchProps {
checked?: boolean;
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
styles?: React.CSSProperties;
className?: string;
disabled?: boolean;
}
declare const ToggleSwitch: ({ checked, onChange, styles, className, disabled, }: ToggleSwitchProps) => import("react/jsx-runtime").JSX.Element;
export default ToggleSwitch;