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 flex-col gap-8 w-full">
<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 flex-col gap-8 w-full">
<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>