@arolariu/components
Version:
🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡
32 lines • 1.12 kB
TypeScript
import { Switch as BaseSwitch } from "@base-ui/react/switch";
import * as React from "react";
/**
* Props for the shared switch wrapper.
*/
interface SwitchProps extends Omit<React.ComponentPropsWithRef<typeof BaseSwitch.Root>, "className"> {
/** Additional CSS classes merged with the switch root styles. @default undefined */
className?: string;
}
/**
* Toggles between on and off states with a styled thumb control.
*
* @remarks
* - Renders a `<button>` element by default
* - Built on {@link https://base-ui.com/react/components/switch | Base UI Switch}
* - Supports the `render` prop for element composition
* - Styling via CSS Modules with `--ac-*` custom properties
*
* @example Basic usage
* ```tsx
* <Switch defaultChecked />
* ```
*
* @see {@link https://base-ui.com/react/components/switch | Base UI Documentation}
*/
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React.RefAttributes<HTMLElement>>;
declare namespace Switch {
type Props = SwitchProps;
type State = BaseSwitch.Root.State;
}
export { Switch };
//# sourceMappingURL=switch.d.ts.map