@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! ⚡
62 lines • 1.9 kB
TypeScript
import { Toggle as BaseToggle } from "@base-ui/react/toggle";
import * as React from "react";
export type ToggleVariant = "default" | "outline";
export type ToggleSize = "default" | "sm" | "lg";
export interface ToggleVariantOptions {
/**
* Controls the rendered visual variant.
* @default "default"
*/
variant?: ToggleVariant;
/**
* Controls the rendered size variant.
* @default "default"
*/
size?: ToggleSize;
/**
* Applies additional CSS classes to the component root element.
* @default undefined
*/
className?: string;
}
/** Returns the CSS module classes used by the toggle wrapper. */
export declare function toggleVariants({ variant, size, className }?: Readonly<ToggleVariantOptions>): string;
export interface ToggleProps extends Omit<React.ComponentPropsWithRef<typeof BaseToggle>, "className"> {
/**
* Applies additional CSS classes to the component root element.
* @default undefined
*/
className?: string;
/**
* Controls the rendered visual variant.
* @default "default"
*/
variant?: ToggleVariant;
/**
* Controls the rendered size variant.
* @default "default"
*/
size?: ToggleSize;
}
/**
* Renders the toggle control.
*
* @remarks
* - Renders a `<button>` element by default
* - Built on {@link https://base-ui.com/react/components/toggle | Base UI Toggle}
* - Supports the `render` prop for element composition
*
* @example
* ```tsx
* <Toggle>Content</Toggle>
* ```
*
* @see {@link https://base-ui.com/react/components/toggle | Base UI Documentation}
*/
declare const Toggle: React.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
declare namespace Toggle {
type Props = ToggleProps;
type State = BaseToggle.State;
}
export { Toggle };
//# sourceMappingURL=toggle.d.ts.map