// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page ToggleCountDetail {
layout = "showcase"
state playground_size = ctx.url.searchParams.get("pg_size") ?? "default"
state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "segmented"
state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
state playground_name = ctx.url.searchParams.get("pg_name") ?? "pricing-cycle"
state playground_value = ctx.url.searchParams.get("pg_value") ?? "annual"
state playground_firstValue = ctx.url.searchParams.get("pg_firstValue") ?? "monthly"
state playground_firstLabel = ctx.url.searchParams.get("pg_firstLabel") ?? "Monthly"
state playground_secondValue = ctx.url.searchParams.get("pg_secondValue") ?? "annual"
state playground_secondLabel = ctx.url.searchParams.get("pg_secondLabel") ?? "Annual"
state playground_ariaLabel = ctx.url.searchParams.get("pg_ariaLabel") ?? "Billing frequency"
state playground_items = ctx.url.searchParams.get("pg_items") ?? "[\n {\n \"label\": \"Startup\",\n \"monthly\": 19,\n \"annual\": 190\n },\n {\n \"label\": \"Team\",\n \"monthly\": 89,\n \"annual\": 890\n },\n {\n \"label\": \"Enterprise\",\n \"monthly\": 129,\n \"annual\": 1290\n }\n]"
state playground_currency = ctx.url.searchParams.get("pg_currency") ?? "$"
state playground_suffix = ctx.url.searchParams.get("pg_suffix") ?? ""
state playground_firstValueKey = ctx.url.searchParams.get("pg_firstValueKey") ?? "monthly"
state playground_secondValueKey = ctx.url.searchParams.get("pg_secondValueKey") ?? "annual"
state playground_emptyValue = ctx.url.searchParams.get("pg_emptyValue") ?? "—"
state playground_align = ctx.url.searchParams.get("pg_align") ?? "end"
state playground_fullWidth = ctx.url.searchParams.get("pg_fullWidth") ?? "true"
state playground_disabled = ctx.url.searchParams.get("pg_disabled") ?? "false"
state playground_animate = ctx.url.searchParams.get("pg_animate") ?? "true"
state playground_animationDuration = ctx.url.searchParams.get("pg_animationDuration") ?? "450"
state playground_animationSteps = ctx.url.searchParams.get("pg_animationSteps") ?? "18"
seo {
title = "Toggle Count"
description = "Theme-aware, responsive toggle count component."
}
view {
Interactive playgroundConfigure Toggle Count
Change any prop and inspect the server-rendered component immediately.
Live preview
<ToggleCount
name="pricing-cycle"
value="annual"
items='[
{
"label": "Startup",
"monthly": 19,
"annual": 190
},
{
"label": "Team",
"monthly": 89,
"annual": 890
},
{
"label": "Enterprise",
"monthly": 129,
"annual": 1290
}
]'
/>
Live examplesDesigned for real product surfaces
Compare configurations and resize the browser to check responsive behavior.
<ToggleCount
name="pricing-cycle"
value="annual"
items='[
{
"label": "Startup",
"monthly": 19,
"annual": 190
},
{
"label": "Team",
"monthly": 89,
"annual": 890
},
{
"label": "Enterprise",
"monthly": 129,
"annual": 1290
}
]'
/>
<ToggleCount
variant="switch"
name="pricing-switch"
items='[
{
"label": "Startup",
"monthly": 19,
"annual": 190
},
{
"label": "Team",
"monthly": 89,
"annual": 890
},
{
"label": "Enterprise",
"monthly": 129,
"annual": 1290
}
]'
align="center"
/>
<ToggleCount
name="contract-length"
value="quarterly"
firstValue="quarterly"
firstLabel="Quarterly"
secondValue="yearly"
secondLabel="Yearly"
items='[
{
"label": "Core",
"description": "For small product teams",
"quarterly": 29,
"yearly": 22
},
{
"label": "Scale",
"description": "For growing organizations",
"quarterly": 79,
"yearly": 62
}
]'
currency="€"
suffix="/seat"
firstValueKey="quarterly"
secondValueKey="yearly"
/>
<ToggleCount
name="disabled-pricing-cycle"
value="annual"
items='[
{
"label": "Startup",
"monthly": 19,
"annual": 190
},
{
"label": "Team",
"monthly": 89,
"annual": 890
},
{
"label": "Enterprise",
"monthly": 129,
"annual": 1290
}
]'
disabled="true"
/>
Component eventsEvents
Public events declared by this component. Custom events bubble from the component root and expose state through event.detail.
@changeFires when the component value or selection changes.
@toggleFires when the component toggles between states.
const component = document.querySelector('[data-wrn-events]')
component.addEventListener('change', (event) => {
console.log(event.detail)
})
Component APIProps and configuration
All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|
size | string | "default" | No |
color | string | "primary" | No |
variant | string | "segmented" | No |
class | string | "" | No |
name | string | "billing-cycle" | No |
value | string | "monthly" | No |
firstValue | string | "monthly" | No |
firstLabel | string | "Monthly" | No |
secondValue | string | "annual" | No |
secondLabel | string | "Annual" | No |
ariaLabel | string | "Billing frequency" | No |
items | string | [] | No |
currency | string | "$" | No |
suffix | string | "" | No |
firstValueKey | string | "monthly" | No |
secondValueKey | string | "annual" | No |
emptyValue | string | "—" | No |
align | string | "end" | No |
fullWidth | boolean | true | No |
disabled | boolean | false | No |
animate | boolean | true | No |
animationDuration | number | 450 | No |
animationSteps | number | 18 | No |
}
}