shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Progress

Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.

x
package examples import "github.com/axadrn/shadcn-templ/v2/components/progress"

Installation

shadcn-templ add progress

Usage

import "github.com/axadrn/shadcn-templ/v2/components/progress"
@progress.Progress(progress.Props{Value: 33})

Composition

With label and value

Use progress.Label and progress.Value to add a label and value display.

@progress.Progress(progress.Props{Value: 56, Class: "w-full max-w-sm"}) {	@progress.Label() {		Upload progress	}	@progress.Value()}
progress.Progress├── progress.Label├── progress.Value└── ProgressTrack    └── ProgressIndicator

Label

Use progress.Label and progress.Value to add a label and value display.

Upload progress
x
package examples import "github.com/axadrn/shadcn-templ/v2/components/progress"

Controlled

A progress bar that can be controlled by a slider.

x
package examples import (

API Reference

Progress

The Progress component renders the bar and exposes its state on aria-valuenow, updating the attribute moves the indicator.

Prop Type Default
Value int 0
Max int 100
Class string -

ProgressLabel

The progress.Label component displays a label above the bar.

Prop Type Default
Class string -

ProgressValue

The progress.Value component displays the current value as a percentage.

Prop Type Default
Class string -