UNPKG

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.

48 lines (47 loc) 1.9 kB
import React from "react"; /** * `CheckBox` is a customizable checkbox component that supports theming, custom styles, controlled/uncontrolled usage, and accessibility. * * @param {object} props - The properties to customize the CheckBox component. * @param {boolean} [props.checked] - If provided, the checkbox is controlled. * @param {(checked: boolean) => void} [props.onChange] - Callback when the checked state changes. * @param {string} [props.label] - Optional label to display next to the checkbox. * @param {React.CSSProperties} [props.styles] - Custom styles for the checkbox container. * @param {string} [props.className] - Additional className for the checkbox container. * @param {boolean} [props.disabled=false] - Whether the checkbox is disabled. * @param {number} [props.cornerRadius] - Custom border radius for the checkbox. Overrides theme.cornerRadius if provided. * @returns {JSX.Element} A styled, accessible checkbox component. */ export interface CheckBoxProps { /** * If provided, the checkbox is controlled. */ checked?: boolean; /** * Callback when the checked state changes. */ onChange?: (checked: boolean) => void; /** * Optional label to display next to the checkbox. */ label?: string; /** * Custom styles for the checkbox container. */ styles?: React.CSSProperties; /** * Additional className for the checkbox container. */ className?: string; /** * Whether the checkbox is disabled. * @default false */ disabled?: boolean; /** * Custom border radius for the checkbox. Overrides theme.cornerRadius if provided. */ cornerRadius?: number; } declare const CheckBox: ({ checked, onChange, label, styles, className, disabled, cornerRadius, }: CheckBoxProps) => import("react/jsx-runtime").JSX.Element; export default CheckBox;