Segmented Process

A multi-segment progress bar for showing how a total breaks down into parts, with per-segment tooltips and optional threshold markers.

Source Tailwind CSS

Unstable: this component's API may still change between releases. Depend on it, but expect to update call sites on upgrade.

Segment A 45.0 · 45%
Segment B 30.0 · 30%
Segment C 15.0 · 15%

Installation

import "github.com/kerkenes/templ-ui/components/segmentedprocess"

Load the script once in your layout:

<head>
  @segmentedprocess.Script()
</head>

Examples

Thresholds

Builds 32.0 GB · 32%
Logs 14.0 GB · 14%
Backups 8.0 GB · 8%
70 GB

Domain Compress

DomainCompress: false

Used 82.0 · 8%
Reserved 20.0 · 2%
100

DomainCompress: true

Used 82.0 · 8%
Reserved 20.0 · 2%
100

Custom Height

Segment A 45.0 · 45%
Segment B 30.0 · 30%
Segment C 15.0 · 15%

API Reference

Required parameter
Hover for description

SegmentedProcess

Multi-segment progress bar with per-segment tooltips and threshold markers.

Name Type Default
ID

Unique identifier for the root element.

string
-
Class

Additional CSS classes to apply to the root element.

string
-
Attributes

Additional HTML attributes to apply to the root element.

templ.Attributes
-
Segments

Segments stacked left to right. Each has a Label and a Value; color cycles through the chart palette by position.

[]Segment
-
Max

The domain the bar represents 100% of, unless DomainCompress overrides it.

float64
0
Thresholds

Optional target markers drawn above the bar. Each has a Value, Label, and Variant ('default', 'success', 'danger', 'warning').

[]Threshold
-
DomainCompress

Scale the bar's visual domain to the last threshold (placed at 90% of the bar's width) instead of Max. Ignored without thresholds.

bool
false
Unit

Appended to displayed values, e.g. 'GB'.

string
-
Height

Bar height in pixels.

int
12
AriaLabel

Overrides the generated "X of Y unit used" summary read by screen readers.

string
-