Progress

import {Progress} from "@qui/react-vscode"

Examples

Showcase

Dark Modern
Label
import type {ReactElement} from "react"
import {Progress} from "@qui/react-vscode"
export default function Showcase(): ReactElement {
return (
<Progress.Root className="w-[240px]">
<Progress.Label>Label</Progress.Label>
<Progress.Track>
<Progress.Bar />
</Progress.Track>
</Progress.Root>
)
}

Layout

Compose the label and value in different DOM positions to create an inline progress bar.

Dark Modern
Label
50
import type {ReactElement} from "react"
import {Progress} from "@qui/react-vscode"
export default function Layout(): ReactElement {
return (
<Progress.Root className="w-[240px]" defaultValue={50}>
{({value}) => (
<div className="flex gap-4">
<Progress.Label>Label</Progress.Label>
<Progress.Track>
<Progress.Bar />
</Progress.Track>
<Progress.Value>{value}</Progress.Value>
</div>
)}
</Progress.Root>
)
}

API

ProgressRootProps

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
React children prop.
| ReactNode
| ((
props: any,
) => ReactNode)
The initial value of the progress when it is first rendered. Use when you do not need to control the state of the progress.
number
The maximum allowed value of the progress bar.
number
The minimum allowed value of the progress bar.
number
Callback fired when the value changes.
    (
    value: number | object,
    ) => void
    The current value of the progress bar.
    number
    Type
    | ElementType
    | ComponentType
    Default
    'div'
    
    Description
    The component used for the root node. It can be a React component or element.
    Type
    | ReactNode
    | ((
    props: any,
    ) => ReactNode)
    Description
    React children prop.
    Type
    number
    Description
    The initial value of the progress when it is first rendered. Use when you do not need to control the state of the progress.
    Type
    number
    Description
    The maximum allowed value of the progress bar.
    Type
    number
    Description
    The minimum allowed value of the progress bar.
    Type
    (
    value: number | object,
    ) => void
    Description
    Callback fired when the value changes.
      Type
      number
      Description
      The current value of the progress bar.