UNPKG

@adaptui/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

38 lines (37 loc) 969 B
/** * Provides state for the `Progress` components. * @example * ```jsx * const progress = useProgressState(); * <Progress state={progress} /> * ``` */ export declare function useProgressState({ value: defaultValue, min, max, ...props }?: ProgressStateProps): ProgressState; export declare type ProgressState = { /** * The `value` of the progress indicator. * * If `null` the progress bar will be in `indeterminate` state * @default 0 */ value: number | null; /** * The minimum value of the progress * @default 0 */ min: number; /** * The maximum value of the * @default 100 */ max: number; /** * `true` if `value` is `null` */ isIndeterminate: boolean; /** * Percentage of the value progressed with respect to min & max */ percent: number | null; }; export declare type ProgressStateProps = Pick<Partial<ProgressState>, "value" | "min" | "max">;