# Credit card auto-pay

> A visual credit card mockup above a labeled switch for enabling automatic monthly payments.

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

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

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/switch-09.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: `switch`, `field`

## Files

### `registry/patterns/switch/switch-09.tsx`

```tsx
import { WifiIcon } from 'lucide-react'

import {
  Field,
  FieldContent,
  FieldDescription,
  FieldLabel,
} from '@/components/ui/field'
import { Switch } from '@/components/ui/switch'

export function Switch09() {
  return (
    <div className="w-full max-w-xs">
      <div className="bg-primary text-primary-foreground flex aspect-[1.586/1] flex-col justify-between rounded-xl p-5 shadow-md">
        <div className="flex items-center justify-between">
          <div className="bg-primary-foreground/20 h-7 w-10 rounded-md" />
          <WifiIcon className="size-5 rotate-90" />
        </div>
        <div className="flex flex-col gap-2">
          <span className="font-mono text-lg tracking-widest">
            •••• •••• •••• 4242
          </span>
          <div className="flex items-end justify-between">
            <span className="text-sm font-medium">Ada Lovelace</span>
            <span className="text-sm font-semibold italic">VISA</span>
          </div>
        </div>
      </div>
      <Field orientation="horizontal" className="mt-4">
        <FieldContent>
          <FieldLabel htmlFor="switch-09">Automatic payments</FieldLabel>
          <FieldDescription>
            Charge this card on the 1st of each month.
          </FieldDescription>
        </FieldContent>
        <Switch id="switch-09" defaultChecked />
      </Field>
    </div>
  )
}
```
