Avara UI

Counter Block

A multi-purpose, highly animated Counter component. Whether you need a user-interactive Stepper for e-commerce, an animated statistics ticker, a circular progress tracker, or a promotional countdown timer, this block handles it all with built-in fluid animations. The countdown comes in two designs: framed figures under a pill, or slide — soft tiles where only the figure that changed slides, the same countdown the Waitlist launch panel uses.
Explore the different variations of the Counter component — each example shows a live preview with the exact code to copy.

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.

Settype"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 label once 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

npx shadcn@latest add @algorize-ui/counter

components/custom/blocks/CounterBlock.tsx 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 max clamp 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

Usevariant"outline"
for a bordered, transparent stepper.

Soft stepper

Usevariant"soft"
for a tinted, low-contrast stepper.

Vertical stepper

Usevariant"vertical"
to stack the controls for tight sidebars.

Animated ticker

Settype"animated"
to interpolate from zero up to targetValue when it scrolls into view.

Circular progress

Settype"circular"
to draw the value as an animated SVG ring instead of a number alone.

Countdown

Settype"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

Explore the Counter component's number animation features, including customizable easing, duration, and formatting options.

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

PropTypeDefaultDescription
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.
labelstring"Counter"The descriptive text rendered alongside the counter value.
targetValuenumber100
The final number to animate towards (used in animated and circular types).
initialValuenumber1
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 "%").
barebooleanfalse
Animated only: render just the figure as a span, no card — it inherits the surrounding type. For a number inside your own layout.
decimalsnumber0
Animated only: decimal places shown while counting, e.g. 1 for 5.5.
startOnViewbooleanfalse
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.
classNamestring—
Animated only: classes for the figure (bare) or the card.
targetDateDate | string | number3 days from now
Countdown only: when the timer reaches zero — a Date, an ISO string or a timestamp.
doneLabelstring"Time's up"
Countdown only: what the label becomes once the date has passed. The slide variant also hides its figures then.