UNPKG

@react-md/form

Version:

This package is for creating all the different form input types.

35 lines (34 loc) 1.43 kB
import type { CSSProperties, HTMLAttributes, InputHTMLAttributes } from "react"; import type { PropsWithRef } from "@react-md/utils"; /** @remarks \@since 2.8.0 */ export interface SwitchTrackProps extends InputHTMLAttributes<HTMLInputElement> { /** * If an `id` is provided, the track will contain a checkbox input element and * render the "ball" as a `<label>`. If the `id` is omitted, no input element * will be rendered and the "ball" will be rendered as a `<span>`. * * Basically only omit the `id` if this is used in another accessible widget * like `menuitemcheckbox`. */ id?: string; /** * An optional style object to provide to the ball. */ ballStyle?: CSSProperties; /** * An optional class name to provide to the ball. */ ballClassName?: string; /** * Any additional props and optional ref to provide to the track itself since * all the props are normally provided to the `<input>` element instead. */ containerProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>; } /** * This is most likely an internal only component that is used to render the * switch element either as a checkbox or in the `MenuItemSwitch` component. * * @remarks \@since 2.8.0 */ export declare const SwitchTrack: import("react").ForwardRefExoticComponent<SwitchTrackProps & import("react").RefAttributes<HTMLInputElement>>;