import "./switch.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; /** What a `render` callback is handed — the kit's own, in BOTH modes. */ export type SwitchState = { checked: boolean; disabled: boolean | undefined; }; export interface SwitchProps extends StyleProps { testID?: string; /** * Accessible name. Required on an interactive switch (one with `onChange`) * OUTSIDE a `FormField`, and its absence there THROWS — a nameless toggle * announces only its state. Inside a field the visible label names it and * this is ignored. A read-only indicator needs none: it is not in the tree. */ accessibilityLabel?: string; value?: boolean | null; disabled?: boolean; onChange?: (value: boolean) => void; ref?: React.Ref; /** * The state is {@link SwitchState}, not Base UI's — this entry is a Base UI * control in one mode and a plain indicator in the other, and a callback whose * argument changed shape with `onChange` would be unwritable. */ render?: useRender.RenderProp; } /** * The on/off toggle. A boolean IS a switch — not a two-option select, not a * popover holding one checkbox — and it commits on flip, so it belongs only * where there is nothing to save. * * **With no `onChange` it is a read-only INDICATOR** and renders no control: no * role, no tab stop, nothing for a screen reader to operate. That is what lets * one sit inside `SwitchRow`, where the button is the control and a second * one inside it would be invalid markup. */ export declare function Switch({ testID, accessibilityLabel, value, disabled, onChange, render, ref, ...props }: SwitchProps): React.JSX.Element;