Counter Block
slide — soft tiles where only the figure that changed slides, the same countdown the Waitlist launch panel uses.Slide countdown
Days, hours, minutes and seconds to a date on soft tiles. Watch the seconds: only the figure that changed slides, the others hold still.
- Set
type"countdown" - with
variant="slide"for the tile design. The figures read--until the first tick, so server and client paint the same. targetDate- is a
Date, ISO string or timestamp; left out, it counts three days from mount. doneLabel- replaces
labelonce the date has passed, and the figures go away.
Installation
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Install Counter
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Counter needs only the cn helper and lucide-react, which the installation guide already put in place.
Examples
Stepper
An interactive quantity picker.
type"stepper"- renders the plus/minus quantity control.
min- and
maxclamp the value — the buttons disable at each end. initialValue- is where it starts; state is internal from then on.
label- captions the control above the buttons.
Outline stepper
- Use
variant"outline" - for a bordered, transparent stepper.
Soft stepper
- Use
variant"soft" - for a tinted, low-contrast stepper.
Vertical stepper
- Use
variant"vertical" - to stack the controls for tight sidebars.
Animated ticker
- Set
type"animated" - to interpolate from zero up to
targetValuewhen it scrolls into view.
Circular progress
- Set
type"circular" - to draw the value as an animated SVG ring instead of a number alone.
Countdown
- Set
type"countdown" - to tick down to a target date rather than counting up. This is the default design — framed figures under a pill with a clock.
Features
Customizable
Easily adapt the component's styling and behavior to fit your application's unique design system.
Accessible
Built with accessibility in mind, ensuring all users can interact with your application effectively.
Responsive
Fully responsive design that looks and works great across desktop, tablet, and mobile devices.
Performant
Optimized for maximum performance with minimal re-renders and efficient state management.
Best Practices & Guidelines
Usage Guidelines
Follow standard design principles when implementing this component. Ensure proper contrast, spacing, and context within your layout.
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
type | "stepper" | "animated" | "circular" | "countdown" | "stepper" | Determines the core functionality and layout of the counter. |
variant | "default" | "outline" | "soft" | "vertical" | "slide" | "default" | outline, soft and vertical are layouts for the
stepper type; slide is the countdown's tile design, where a figure that changes slides out above as the new one comes up from below. |
color | "primary" | "indigo" | "rose" | "emerald" | "zinc" | "inherit" | string | "primary" | Applies global color themes. Accepts valid hex codes (e.g.
"#00FF00"). inherit takes the surrounding text colour, for a counter inside a section that sets its own. |
label | string | "Counter" | The descriptive text rendered alongside the counter value. |
targetValue | number | 100 | The final number to animate towards (used in animated and
circular types). |
initialValue | number | 1 | The starting value for the stepper type. |
min / max | number | 0 / 100 | Sets the bounds for the stepper type, automatically
disabling buttons when limits are reached. |
prefix / suffix | string | "" | Strings to append before or after the number (e.g. "$" or
"%"). |
bare | boolean | false | Animated only: render just the figure as a span, no card — it inherits the surrounding type. For a number inside your own layout. |
decimals | number | 0 | Animated only: decimal places shown while counting, e.g. 1 for 5.5. |
startOnView | boolean | false | Animated only: wait until the counter is on screen before counting, so a figure below the fold is seen counting. Under prefers-reduced-motion the target is shown at once. |
className | string | — | Animated only: classes for the figure ( bare) or the card. |
targetDate | Date | string | number | 3 days from now | Countdown only: when the timer reaches zero — a Date, an ISO string or a timestamp. |
doneLabel | string | "Time's up" | Countdown only: what the label becomes once the date has passed. The slide variant also hides its figures then. |