Components
Dot-based step indicator that takes a total amount of steps and the current activeIndex as a controlled component. Pairs with Carousel and Pagination for syncing scroll or navigation state, and supports a media color for static dark backgrounds.
npx @21st-dev/cli add reshaped/reshaped-progress-indicatorLoading preview...
import * as React from "react";
import { Button, Reshaped, View } from "reshaped/bundle";
import ProgressIndicator from "@/components/ui/reshaped-progress-indicator";
function Component() {
const total = 5;
const [activeIndex, setActiveIndex] = React.useState(0);
return (
<View gap={4}>
<View direction="row" gap={2} align="center">
<Button
onClick={() => {
setActiveIndex((prev) => Math.max(0, prev - 1));
}}
>
Previous
</Button>
<Button
onClick={() => {
setActiveIndex((prev) => Math.min(total - 1, prev + 1));
}}
>
Next
</Button>
</View>
<ProgressIndicator total={total} activeIndex={activeIndex} />
</View>
);
}
export default function Demo() {
return (
<Reshaped theme="slate">
<div style={{ margin: "0 auto", padding: 24, display: "flex", justifyContent: "center" }}>
<Component />
</div>
</Reshaped>
);
}
Loading preview...