# Pricing toggle

> Monthly versus yearly billing toggle swaps the price.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/tabs-14).

- Page, with a live preview: https://shadcn.exchange/r/flx/tabs-14
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/tabs-14-light-cdfd0b725eccb203.png
- Registry item: https://ui.flexnative.com/r/tabs-14.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/tabs-14.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `tabs`, `badge`

## Files

### `registry/patterns/tabs/tabs-14.tsx`

```tsx
import { Badge } from '@/components/ui/badge'
import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from '@/components/ui/tabs'

export function Tabs14() {
  return (
    <Tabs defaultValue="yearly" className="w-full max-w-sm items-center gap-6">
      <TabsList className="w-full">
        <TabsTrigger value="monthly">Monthly</TabsTrigger>
        <TabsTrigger value="yearly">
          Yearly
          <Badge variant="secondary">−20%</Badge>
        </TabsTrigger>
      </TabsList>
      <TabsContent value="monthly" className="text-center">
        <div className="flex items-baseline justify-center gap-1">
          <span className="text-3xl font-semibold">$12</span>
          <span className="text-muted-foreground text-sm">/ month</span>
        </div>
        <p className="text-muted-foreground mt-1 text-sm">
          Billed monthly. Cancel anytime.
        </p>
      </TabsContent>
      <TabsContent value="yearly" className="text-center">
        <div className="flex items-baseline justify-center gap-1">
          <span className="text-3xl font-semibold">$115</span>
          <span className="text-muted-foreground text-sm">/ year</span>
        </div>
        <p className="text-muted-foreground mt-1 text-sm">
          Two months free vs monthly billing.
        </p>
      </TabsContent>
    </Tabs>
  )
}
```
