import { Progress } from '@skeletonlabs/skeleton-react';
export const Page = () => {
return <Progress value={50} max={100} />;
Colors
Set the color using the meterBg
prop.
import { Progress } from '@skeletonlabs/skeleton-react';
export const Page = () => {
<div className="flex w-full flex-col gap-8">
<Progress value={50} max={100} meterBg="bg-primary-500" />
<Progress value={50} max={100} meterBg="bg-secondary-500" />
<Progress value={50} max={100} meterBg="bg-tertiary-500" />
Height
Set the height using the height
prop.
import { Progress } from '@skeletonlabs/skeleton-react';
export const Page = () => {
<div className="flex w-full flex-col gap-8">
<Progress value={50} max={100} />
<Progress value={50} max={100} height="h-4" />
<Progress value={50} max={100} height="h-8" />
Indeterminate
When no value is present, or the value is undefined
, an indeterminate animation will be shown.
import { Progress } from '@skeletonlabs/skeleton-react';
export const Page = () => {
return <Progress value={undefined} />;
Custom Animations
A custom indeterminate animation can be set by providing an animation class to the meterAnimate
prop.
import { Progress } from '@skeletonlabs/skeleton-react';
export const Page = () => {
<Progress value={undefined} meterAnimate="my-custom-animation" />
{/* RECOMMENDED: add these styles to your global stylesheet. */}
animation: my-custom-animation 2s ease-in-out infinite;
@keyframes my-custom-animation {
Native Alternative
A native progress element is available cross browser, but does not support indeterminate animations.
<progress class="progress" value="50" max="100"></progress>
API Reference
Progress
Property | Type | Description |
value | number | |
max | number | |
labelledBy | string | |
base | string | |
bg | string | Set root background classes |
width | string | |
height | string | |
rounded | string | |
classes | string | Set root arbitrary classes |
meterBase | string | |
meterBg | string | |
meterRounded | string | Set meter rounded classes. |
meterTransition | string | Set meter transition classes. |
meterAnimate | string | Set meter animation classes for indeterminate mode. |
meterClasses | string | Set meter arbitrary classes. |