// 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 {
Advanced Forms component

Toggle Count

Theme-aware, responsive toggle count component.

23 props0 slots2 eventsTheme readyResponsive
Interactive playground

Configure Toggle Count

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<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
    }
  ]'
/>
Component props23 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Pricing

Monthly and annual pricing

Compare plan prices with an aligned segmented control and clear selected state.

01
Live preview
Component usage.wrn
<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
    }
  ]'
/>
Pricing

Switch control

Use a compact switch between labels while updating every displayed plan value.

02
Live preview
Component usage.wrn
<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"
/>
Configuration

Custom billing periods

Configure custom values, labels, currency, suffixes, and plan descriptions.

03
Live preview
Component usage.wrn
<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"
/>
States

Disabled pricing toggle

Keep the current comparison visible while preventing billing-period changes.

04
Live preview
Component usage.wrn
<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 events

Events

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.
Event listener.js
const component = document.querySelector('[data-wrn-events]')

component.addEventListener('change', (event) => {
  console.log(event.detail)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
sizestring"default"No
colorstring"primary"No
variantstring"segmented"No
classstring""No
namestring"billing-cycle"No
valuestring"monthly"No
firstValuestring"monthly"No
firstLabelstring"Monthly"No
secondValuestring"annual"No
secondLabelstring"Annual"No
ariaLabelstring"Billing frequency"No
itemsstring[]No
currencystring"$"No
suffixstring""No
firstValueKeystring"monthly"No
secondValueKeystring"annual"No
emptyValuestring"—"No
alignstring"end"No
fullWidthbooleantrueNo
disabledbooleanfalseNo
animatebooleantrueNo
animationDurationnumber450No
animationStepsnumber18No
} }