Components
Progress
Displays the status of a task that takes a long time.
Anatomy#
Import the component and assemble its parts:
import { Progress } from '@egoist/solid-base/progress';
<Progress.Root>
<Progress.Label />
<Progress.Track>
<Progress.Indicator />
</Progress.Track>
<Progress.Value />
</Progress.Root>;API reference#
<Progress.Root>
Groups all parts of the progress bar and provides the task completion status to screen readers. Renders a <div> element.
aria-valuetextstring—A string value that provides a user-friendly name for aria-valuenow, the current value of the progress bar.
formatIntl.NumberFormatOptions—Options to format the value.
getAriaValueText((formattedValue: string, value: 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 bar.
localeIntl.LocalesArgument—The locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale. When server rendering, en-US is used until hydration.
maxnumber100The maximum value.
minnumber0The minimum value.
value*number | null—The current value. The component is indeterminate when value is null.
classstring | ClassValue | ((state: State) => ClassValue)—CSS class applied to the element, or a function that returns a class based on the component's state.
styleJSX.CSSProperties | string | ((state: State) => JSX.CSSProperties | string)—Style applied to the element, or a function that returns a style based on the component's state.
renderkeyof JSX.IntrinsicElements | ((props: HTMLProps, state: State) => JSX.Element)—Allows you to replace the component's HTML element with a different tag, or compose it with another component.
Accepts a tag name, or a function that receives the props to spread and the component's state, and returns the element to render.
data-completePresent when the progress has completed.
data-indeterminatePresent when the progress is in indeterminate state.
data-progressingPresent while the progress is progressing.
<Progress.Track>
Contains the progress bar indicator. Renders a <div> element.
classstring | ClassValue | ((state: State) => ClassValue)—CSS class applied to the element, or a function that returns a class based on the component's state.
styleJSX.CSSProperties | string | ((state: State) => JSX.CSSProperties | string)—Style applied to the element, or a function that returns a style based on the component's state.
renderkeyof JSX.IntrinsicElements | ((props: HTMLProps, state: State) => JSX.Element)—Allows you to replace the component's HTML element with a different tag, or compose it with another component.
Accepts a tag name, or a function that receives the props to spread and the component's state, and returns the element to render.
data-completePresent when the progress has completed.
data-indeterminatePresent when the progress is in indeterminate state.
data-progressingPresent while the progress is progressing.
<Progress.Indicator>
Visualizes the completion status of the task. Renders a <div> element.
classstring | ClassValue | ((state: State) => ClassValue)—CSS class applied to the element, or a function that returns a class based on the component's state.
styleJSX.CSSProperties | string | ((state: State) => JSX.CSSProperties | string)—Style applied to the element, or a function that returns a style based on the component's state.
renderkeyof JSX.IntrinsicElements | ((props: HTMLProps, state: State) => JSX.Element)—Allows you to replace the component's HTML element with a different tag, or compose it with another component.
Accepts a tag name, or a function that receives the props to spread and the component's state, and returns the element to render.
data-completePresent when the progress has completed.
data-indeterminatePresent when the progress is in indeterminate state.
data-progressingPresent while the progress is progressing.
<Progress.Value>
A text element displaying the current value. Renders a <span> element.
classstring | ClassValue | ((state: State) => ClassValue)—CSS class applied to the element, or a function that returns a class based on the component's state.
styleJSX.CSSProperties | string | ((state: State) => JSX.CSSProperties | string)—Style applied to the element, or a function that returns a style based on the component's state.
renderkeyof JSX.IntrinsicElements | ((props: HTMLProps, state: State) => JSX.Element)—Allows you to replace the component's HTML element with a different tag, or compose it with another component.
Accepts a tag name, or a function that receives the props to spread and the component's state, and returns the element to render.
data-completePresent when the progress has completed.
data-indeterminatePresent when the progress is in indeterminate state.
data-progressingPresent while the progress is progressing.
<Progress.Label>
An accessible label for the progress bar. Renders a <span> element.
classstring | ClassValue | ((state: State) => ClassValue)—CSS class applied to the element, or a function that returns a class based on the component's state.
styleJSX.CSSProperties | string | ((state: State) => JSX.CSSProperties | string)—Style applied to the element, or a function that returns a style based on the component's state.
renderkeyof JSX.IntrinsicElements | ((props: HTMLProps, state: State) => JSX.Element)—Allows you to replace the component's HTML element with a different tag, or compose it with another component.
Accepts a tag name, or a function that receives the props to spread and the component's state, and returns the element to render.
data-completePresent when the progress has completed.
data-indeterminatePresent when the progress is in indeterminate state.
data-progressingPresent while the progress is progressing.