UNPKG

@react-md/form

Version:

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

53 lines (52 loc) 1.76 kB
import type { HTMLAttributes } from "react"; import type { LabelRequiredForA11y } from "@react-md/utils"; import type { SliderThumbOptions, ThumbIndex } from "./types"; /** * @remarks \@since 2.5.0 */ export interface BaseThumbProps extends HTMLAttributes<HTMLSpanElement>, SliderThumbOptions { /** * The index of the thumb which is used for some additional styling * behavior. */ index: ThumbIndex; /** * The current value for the slider. */ value: number; /** * An optional name to apply to the hidden input field representing the value * of the slider. */ name?: string; /** * The prefix to use for the id of the thumb. When the `id` prop is omitted, * the `id` for this component will be created by `${baseId}-thumb-${index + 1}`. * * Either the `id` or `baseId` props are required for a11y. */ baseId?: string; /** * Boolean if the thumb is currently in an active state which will add a * "bubble" around the thumb. */ active?: boolean; /** * Boolean if the thumb should animate between positions when the `value` * changes. This should normally be set to `false` while dragging the thumb * since it'll make it look like the thumb is lagging behind the mouse cursor * or user's finger. */ animate?: boolean; } /** * @remarks \@since 2.5.0 */ export declare type SliderThumbProps = LabelRequiredForA11y<BaseThumbProps>; /** * The slider thumb implements the `role="slider"` for the `Slider` and * `RangeSlider` components. * * @remarks \@since 2.5.0 */ export declare const SliderThumb: import("react").ForwardRefExoticComponent<SliderThumbProps & import("react").RefAttributes<HTMLSpanElement>>;