# Snippet Composition 1 - Install command

> Full install snippet with stable and preview tabs plus dynamic copy button.

A shadcn/ui block from the [@shadcnblocks](https://shadcnblocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/snippet-snippet-composition-1).

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/snippet-snippet-composition-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/snippet-snippet-composition-1-light-f4ce5794166f0d7c.png
- Registry item: https://shadcnblocks.com/r/snippet-snippet-composition-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/snippet-snippet-composition-1.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: `https://www.kibo-ui.com/r/snippet.json`

## Files

### `example/snippet/snippet-composition-1.tsx`

```tsx
"use client";

import { useState } from "react";

import {
  Snippet,
  SnippetCopyButton,
  SnippetHeader,
  SnippetTabsContent,
  SnippetTabsList,
  SnippetTabsTrigger,
} from "@/components/kibo-ui/snippet";

export const title = "Install command";

const commands = {
  stable: "curl -f https://example.com/install.sh | bash",
  preview: "curl -f https://example.com/preview.sh | bash",
};

const Example = () => {
  const [tab, setTab] = useState("stable");

  return (
    <div className="w-full max-w-lg">
      <Snippet value={tab} onValueChange={setTab}>
        <SnippetHeader>
          <SnippetTabsList>
            <SnippetTabsTrigger value="stable">Stable</SnippetTabsTrigger>
            <SnippetTabsTrigger value="preview">Preview</SnippetTabsTrigger>
          </SnippetTabsList>
          <SnippetCopyButton value={commands[tab as keyof typeof commands]} />
        </SnippetHeader>
        <SnippetTabsContent value="stable">
          {commands.stable}
        </SnippetTabsContent>
        <SnippetTabsContent value="preview">
          {commands.preview}
        </SnippetTabsContent>
      </Snippet>
    </div>
  );
};

export default Example;
```
