UNPKG

@renderlesskit/react

Version:

Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit

27 lines (26 loc) 1.31 kB
import * as React from "react"; import { AriaSliderProps } from "@react-types/slider"; import { SliderBaseStateReturn } from "./index"; export declare type SliderState = { /** * Ref for the "track" element. The width of this element provides the "length" * of the track -- the span of one dimensional space that the slider thumb can be. It also * accepts click and drag motions, so that the closest thumb will follow clicks and drags on * the track.. */ trackRef: React.RefObject<HTMLElement>; /** Props for the label element. */ labelProps: React.LabelHTMLAttributes<HTMLLabelElement>; /** Props for the root element of the slider component; groups slider inputs. */ groupProps: React.HTMLAttributes<HTMLElement>; /** Props for the track element. */ trackProps: React.HTMLAttributes<HTMLElement>; /** Props for the output element, displaying the value of the slider thumbs. */ outputProps: React.OutputHTMLAttributes<HTMLOutputElement>; }; export declare type SliderActions = {}; export declare type SliderStateReturn = SliderState & SliderActions & {}; export declare type SliderInitialState = AriaSliderProps & { state: SliderBaseStateReturn; }; export declare function useSliderState(props: SliderInitialState): SliderStateReturn;