# Preview and code

> Docs-style switch between live preview and code snippet.

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

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

## Install

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

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

## Dependencies

- npm packages: `lucide-react`
- Registry items: `tabs`

## Files

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

```tsx
import { CodeIcon, EyeIcon } from 'lucide-react'

import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from '@/components/ui/tabs'

export function Tabs13() {
  return (
    <Tabs defaultValue="preview" className="w-full max-w-md items-center gap-4">
      <TabsList variant="line">
        <TabsTrigger value="preview">
          <EyeIcon data-icon="inline-start" />
          Preview
        </TabsTrigger>
        <TabsTrigger value="code">
          <CodeIcon data-icon="inline-start" />
          Code
        </TabsTrigger>
      </TabsList>
      <TabsContent value="preview" className="w-full">
        <div className="bg-muted/40 flex h-28 items-center justify-center rounded-md border">
          <span className="text-muted-foreground text-sm">Live preview</span>
        </div>
      </TabsContent>
      <TabsContent value="code" className="w-full">
        <pre className="bg-muted text-muted-foreground overflow-x-auto rounded-md border p-3 font-mono text-xs">
          {`<Button>Click me</Button>`}
        </pre>
      </TabsContent>
    </Tabs>
  )
}
```
