COMPONENTS/FEEDBACK
Progress.
A clear sense of how far along.
In practice
Bringing it together68%
Native progress element: set value and max for a determinate value, omit value for indeterminate progress. Always label it.
Installation
Install Coal once. Components and TypeScript declarations are included. React 19 and React DOM 19 are peer dependencies.
Terminal · local package
npm install http://localhost:3100/downloads/chlohal-coal-ui-0.5.0.tgzThis installs the local package. It is not yet published on npm. See installation for stylesheet setup and integration.
Usage
example.tsx
"use client";
import * as React from "react";
import "@chlohal/coal-ui/styles.css";
import { Progress } from "@chlohal/coal-ui";
export default function Example() {
return (<div>
<div>
<span>Bringing it together</span>
<span>68%</span>
</div>
<Progress value={68} aria-label="Project completion"/>
</div>);
}
Source
The original Coal implementation. Use the package export to integrate it.
packages/react/src/progress.tsx
import * as React from "react";
import { cn } from "./internal.js";
export function Progress({
className,
...props
}: React.ComponentPropsWithRef<"progress">) {
return (
<progress max={100} className={cn("coal-progress", className)} {...props} />
);
}
Accessibility checklist
- Provide an accessible name for controls, including icon-only buttons.
- Check keyboard navigation, visible focus and disabled states in your application.
- Do not rely on color alone to communicate status.