Uai

marketingpricing-toggle.tsx

Color theme

component · 61/108

Pricing Toggle

Switch billing periods while keeping prices, billing context, and savings labels in sync.

Install

Install manuallyView source on GitHub

Anatomy

  • PricingToggle
  • PricingToggleList
  • PricingToggleOption
  • PricingTogglePrice

Accessibility3 checks

  • Options form an APG radio group: one tab stop, with arrow keys, Home, and End moving and selecting.
  • Savings labels sit inside the option, so the accessible name reads “Yearly Save 20%”.
  • PricingTogglePrice renders only for the selected period; wrap prices in a polite live region to announce changes.
canvasvariant="segmented"marketing
Marketing and conversion
Starter

$10 per seat / month

Billed $120 yearly instead of $144.

For small teams getting organized.

Team

$19 per seat / month

Billed $228 yearly instead of $288.

Shared workspaces, roles, and audit history.

pricing toggle variant

Code example

usage.tsx
"use client";import { useState } from "react";import {  PricingToggle,  PricingToggleList,  PricingToggleOption,  PricingTogglePrice,  PricingToggleSavings,  type PricingToggleVariant,} from "@/components/ui/uai/pricing-toggle";const plans = [  { name: "Starter", monthly: 12, yearly: 10, note: "For small teams getting organized." },  { name: "Team", monthly: 24, yearly: 19, note: "Shared workspaces, roles, and audit history." },];export function PricingTogglePreview({  variant = "segmented",}: {  variant?: PricingToggleVariant;}) {  const [period, setPeriod] = useState("yearly");  return (    <PricingToggle variant={variant} value={period} onValueChange={setPeriod}>      <PricingToggleList aria-label="Billing period">        <PricingToggleOption value="monthly">Monthly</PricingToggleOption>        <PricingToggleOption value="yearly">          Yearly <PricingToggleSavings>Save 20%</PricingToggleSavings>        </PricingToggleOption>      </PricingToggleList>      <div        aria-live="polite"        style={{          display: "grid",          gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))",          gap: 12,        }}      >        {plans.map((plan) => (          <div            key={plan.name}            style={{              display: "grid",              alignContent: "start",              gap: 6,              padding: 16,              border: "1px solid var(--uai-border)",              borderRadius: 14,              background: "var(--uai-surface)",            }}          >            <strong style={{ fontWeight: 500 }}>{plan.name}</strong>            <p              style={{                margin: 0,                fontSize: 24,                lineHeight: "28px",                fontWeight: 600,                letterSpacing: "-0.02em",                fontVariantNumeric: "tabular-nums",              }}            >              <PricingTogglePrice period="monthly">${plan.monthly}</PricingTogglePrice>              <PricingTogglePrice period="yearly">${plan.yearly}</PricingTogglePrice>              <span                style={{                  fontSize: 12,                  fontWeight: 400,                  letterSpacing: 0,                  color: "var(--uai-subtle)",                }}              >                {" "}                per seat / month              </span>            </p>            <p              style={{                margin: 0,                fontSize: 12,                color: "var(--uai-muted)",                fontVariantNumeric: "tabular-nums",              }}            >              <PricingTogglePrice period="monthly">                Billed monthly. Cancel anytime.              </PricingTogglePrice>              <PricingTogglePrice period="yearly">                Billed ${plan.yearly * 12} yearly instead of ${plan.monthly * 12}.              </PricingTogglePrice>            </p>            <p style={{ margin: 0, fontSize: 12, color: "var(--uai-subtle)" }}>{plan.note}</p>          </div>        ))}      </div>    </PricingToggle>  );}

Manual installation

pricing-toggle.tsx

Loading component source…

esc
ThinkingAI
MessageAI
CitationAI
AttachmentAI
Tool CallAI
Response StatusAI
Run SummaryAI
Conversation ThreadAI · Block
Research SessionAI · Block
File AnalysisAI · Block
Agent RunAI · Block
Approval CardFeedback
Empty StateFeedback
Status BannerFeedback
Progress SummaryFeedback
Inline FeedbackFeedback
Confirmation DialogFeedback
Activity TimelineFeedback
Skeleton GroupFeedback
Prompt ComposerForms
Form FieldForms
Search FieldForms
Filter BarForms
File UploadForms
Date Range PickerForms
Form Error SummaryForms
Unsaved Changes BarForms
Step IndicatorForms
Task ListData Display
Data Table ToolbarData Display
Metric CardData Display
Description ListData Display
Comparison TableData Display
Kanban BoardData Display
Calendar ViewData Display
Audit LogData Display
App HeaderNavigation
App SidebarNavigation
Breadcrumb TrailNavigation
Page TabsNavigation
Command MenuNavigation
Split PaneNavigation
Sign-in CardAuthentication
Sign-up CardAuthentication
Password RecoveryAuthentication
Code VerificationAuthentication · Block
Onboarding WizardAuthentication · Block
Workspace SetupAuthentication · Block
Coupon FieldCommerce
Quantity PickerCommerce
Cart ItemCommerce
Price SummaryCommerce
Order StatusCommerce
Product DetailCommerce · Block
Product ListingCommerce · Block
Cart DrawerCommerce · Block
CheckoutCommerce · Block
Order TrackingCommerce · Block
Subscription ManagementCommerce · Block
Announcement BarMarketing
Pricing ToggleMarketing
Testimonial CardMarketing
Product GalleryMarketing
Trust PanelMarketing
Newsletter FormMarketing
Hero SectionMarketing · Block
Feature ShowcaseMarketing · Block
Pricing SectionMarketing · Block
Testimonials SectionMarketing · Block
FAQ SectionMarketing · Block
Call to ActionMarketing · Block
Waitlist SectionMarketing · Block
Contact SectionMarketing · Block
Author CardContent
CommentContent
Reaction BarContent
Share MenuContent
Changelog EntryContent
Article PageContent · Block
Documentation PageContent · Block
Changelog PageContent · Block
Comment ThreadContent · Block
Community FeedContent · Block
Public ProfileContent · Block
Map FrameMaps
Map ControlsMaps
Map MarkerMaps
Map LegendMaps
Place CardMaps
Route SummaryMaps
Dashboard ShellApplication · Block
Settings PageApplication · Block
Profile PageApplication · Block
Team ManagementApplication · Block
Notification CenterApplication · Block
Billing PortalApplication · Block
Search ResultsApplication · Block
Resource ManagerOperations · Block
Data ExplorerOperations · Block
Import WorkflowOperations · Block
Approval QueueOperations · Block
Audit Log ViewerOperations · Block
Incident DashboardOperations · Block
Report BuilderOperations · Block
Document FieldBrazil
CEP FieldBrazil
Pix PaymentBrazil
Installment PickerBrazil