UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

64 lines (63 loc) 2.16 kB
import * as React from 'react'; export type ProgressStatus = 'indeterminate' | 'progressing' | 'complete'; declare function useProgressRoot(parameters: useProgressRoot.Parameters): useProgressRoot.ReturnValue; declare namespace useProgressRoot { interface Parameters { /** * The label for the Indicator component. */ 'aria-label'?: string; /** * An id or space-separated list of ids of elements that label the Indicator component. */ 'aria-labelledby'?: string; /** * A string value that provides a human-readable text alternative for the current value of the progress indicator. */ 'aria-valuetext'?: string; /** * Accepts a function which returns a string value that provides an accessible name for the Indicator component * @param {number | null} value The component's value * @returns {string} */ getAriaLabel?: (index: number | null) => string; /** * Accepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress indicator. * @param {number | null} value The component's value to format * @returns {string} */ getAriaValueText?: (value: number | null) => string; /** * The maximum value * @default 100 */ max?: number; /** * The minimum value * @default 0 */ min?: number; /** * The current value. The component is indeterminate when value is `null`. * @default null */ value: number | null; } interface ReturnValue { getRootProps: (externalProps?: React.ComponentPropsWithRef<'div'>) => React.ComponentPropsWithRef<'div'>; /** * The maximum value */ max: number; /** * The minimum value */ min: number; /** * Value of the component */ value: number | null; status: ProgressStatus; } } export { useProgressRoot };