All components · Category: Pricing and counters
Stat counter
Big numbers that roll up when they come into view.
Figures that roll up digit by digit, rightmost first, the first time they appear on screen, and never again. Values, labels and units come from props. Without motion, or without a browser observer, the final numbers are simply there, and each one is read whole by a screen reader.
01
Try it
Props
Generated from the component's manifest and the values above.
index.html
<stat-counter
still
locale="en"
stats="[{"value":100,"label":"Sites on the Agency plan"},{"value":24,"label":"Months of history on Pro"},{"value":14,"label":"Grace days past a limit"}]"
></stat-counter>
- Add the site's Taggor script once; the component appears when it loads.
taggor-component.js
const element = document.createElement("stat-counter");
element.setAttribute("still", "");
element.setAttribute("locale", "en");
element.stats = [
{
"value": 100,
"label": "Sites on the Agency plan"
},
{
"value": 24,
"label": "Months of history on Pro"
},
{
"value": 14,
"label": "Grace days past a limit"
}
];
document.body.append(element);
- Add the site's Taggor script once; the component appears when it loads.
- Lists and objects go in as a property of the element, not an attribute.
StatCounter.tsx
import { useEffect, useRef } from "react";
export function StatCounter() {
const ref = useRef<HTMLElement>(null);
useEffect(() => {
const element = ref.current;
if (!element) return;
Object.assign(element, {
stats: [
{
"value": 100,
"label": "Sites on the Agency plan"
},
{
"value": 24,
"label": "Months of history on Pro"
},
{
"value": 14,
"label": "Grace days past a limit"
}
],
});
}, []);
return <stat-counter ref={ref} still="" locale="en" />;
}
- Add the site's Taggor script once; the component appears when it loads.
- React 18 sends every prop of a custom element as a text attribute.
- Lists and objects go in as a property of the element, not an attribute.
StatCounter.tsx
import { useEffect, useRef } from "react";
export function StatCounter() {
const ref = useRef<HTMLElement>(null);
useEffect(() => {
const element = ref.current;
if (!element) return;
Object.assign(element, {
stats: [
{
"value": 100,
"label": "Sites on the Agency plan"
},
{
"value": 24,
"label": "Months of history on Pro"
},
{
"value": 14,
"label": "Grace days past a limit"
}
],
});
}, []);
return <stat-counter ref={ref} still locale="en" />;
}
- Add the site's Taggor script once; the component appears when it loads.
- React 19 sets a property when the element already has it, an attribute otherwise.
- Lists and objects go in as a property of the element, not an attribute.
src/StatCounter.vue
<template>
<stat-counter
:still.prop="true"
locale="en"
:stats.prop="[{"value":100,"label":"Sites on the Agency plan"},{"value":24,"label":"Months of history on Pro"},{"value":14,"label":"Grace days past a limit"}]"
/>
</template>
vite.config.ts
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag === "stat-counter",
},
},
}),
],
});
- Add the site's Taggor script once; the component appears when it loads.
- vite.config.ts tells Vue that this tag is not a Vue component.
- Lists and objects go in as a property of the element, not an attribute.
src/app/stat-counter.component.ts
import { Component, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
@Component({
selector: "app-stat-counter",
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<stat-counter [still]="true" locale="en" [stats]="values.stats"></stat-counter>
`,
})
export class StatCounterComponent {
readonly values = {
stats: [
{
"value": 100,
"label": "Sites on the Agency plan"
},
{
"value": 24,
"label": "Months of history on Pro"
},
{
"value": 14,
"label": "Grace days past a limit"
}
],
};
}
- Add the site's Taggor script once; the component appears when it loads.
- The component declares CUSTOM_ELEMENTS_SCHEMA.
- Lists and objects go in as a property of the element, not an attribute.
src/TaggorComponent.svelte
<stat-counter
still
locale="en"
stats={[
{
"value": 100,
"label": "Sites on the Agency plan"
},
{
"value": 24,
"label": "Months of history on Pro"
},
{
"value": 14,
"label": "Grace days past a limit"
}
]}
></stat-counter>
- Add the site's Taggor script once; the component appears when it loads.
How an agent gets a component like this onto a site:
taggor checktaggor publishThe CSS variables the component exposes, set the way a customer's page would.
styles.css
stat-counter {
--sc-radius: 18px;
}02
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| stats | list | none | The numbers: a value, a label, an optional prefix and suffix and decimals. |
| still | boolean | false | Shows the final numbers at once and never rolls (static previews). |
| hideSample | boolean | false | Hides the Sample content mark (use it with your own numbers). |
| locale | pt-BR | en | en | – |
Prop names and descriptions are the component's own, in English, as its author wrote them.
03
Events
This component fires no event.
04
Build one with your agent
Paste this into your agent. It asks you before it signs in, pays or goes further than checking and publishing.
Build me a Taggor component like "Stat counter" (stat-counter): Big numbers that roll up when they come into view.
Fetch https://taggor.dev/agent-setup/prompt.md and follow its instructions to set me up for Taggor. Ask me before you sign in, create an account, accept terms, pay for anything or type a secret.
Check it with `taggor check` and publish it with `taggor publish`, and stop there.
Do not promote it to production, attach it to a site, roll back anything or use --yes, --force or --force-drop-invalid unless I ask for exactly that in this conversation.
05
Related components
- Pricing toggle<pricing-toggle>
- Launch countdown<launch-countdown>
- Success check<success-check>