# Snippets

Snippets let you save pieces of text, code, templates, or commands and reuse them across your workspace. Capture content from any webpage or create snippets manually.

## Saving Snippets

### From a Webpage (Right-Click)

The fastest way to save a snippet:

1. Select any text on a webpage
2. Right-click the selection
3. Choose **"Save to Tabhive"**

The selected text is saved as a snippet in your workspace automatically.

### Manually

1. Open Tabhive
2. Click the **Snippets** icon in the header
3. Click **Add snippet**
4. Fill in the name, content, source URL (optional), and type
5. Click **Save Snippet**

## Snippet Types

Each snippet has a type to help you categorize and identify it:

| Type         | Use for                                   |
| ------------ | ----------------------------------------- |
| **Text**     | Notes, quotes, paragraphs                 |
| **Code**     | Code blocks, functions, scripts           |
| **Template** | Reusable text templates with placeholders |
| **Command**  | Terminal or shell commands                |

Code and Command snippets are displayed with monospace formatting.

## Viewing Snippets

### Snippets Modal

Click the **Snippets** icon in the header to open the full snippets view. All unsorted snippets are shown in a 3-column card grid.

### Inside Groups

Snippets assigned to a group appear at the bottom of the group. If there are multiple snippets in a group, they are shown as a **stacked card**. Hover over the stack to expand and see all snippets in the group.

## Using Snippets

### Copy a Snippet

* Hover over any snippet card and click the **copy icon**, or
* Click the snippet to open its detail view and click **Copy**

The content is copied to your clipboard.

### Open Snippet Detail

Click any snippet card to open the full detail view, which shows:

* Full content
* Source URL (if saved)
* Type and creation date
* Edit name, move, and delete options

## Organizing Snippets

### Move to a Group

You can move a snippet into any group:

**From the snippet card:**

1. Hover over the snippet and click **⋮**
2. Click **Move to group**
3. Search for and select a group

**From the detail view:**

1. Click the snippet to open its detail
2. Click **Move to group**
3. Search for and select a group

### Remove from a Group

To move a snippet back to unsorted:

1. Hover over the snippet in the group and click **⋮**
2. Click **Remove**

The snippet is removed from the group but not deleted.

### Edit Snippet Name

1. Click the snippet to open the detail view
2. Click the **pencil icon** next to the name
3. Enter the new name and press Enter or click **Save**

## Deleting Snippets

1. Click the snippet to open the detail view
2. Click **Remove**

Or from the Snippets modal:

1. Hover over the snippet card and click **⋮**
2. Click **Remove**

Removed snippets go to the [Bin](/bin) for 30 days.

## Plan Limits

| Plan     | Snippets   |
| -------- | ---------- |
| Free     | 3 snippets |
| Pro      | Unlimited  |
| Lifetime | Unlimited  |

## Roles & Permissions

| Action            | Viewer | Editor | Owner |
| ----------------- | ------ | ------ | ----- |
| View snippets     | ✓      | ✓      | ✓     |
| Create snippets   | —      | ✓      | ✓     |
| Edit snippet name | —      | ✓      | ✓     |
| Move to group     | —      | ✓      | ✓     |
| Delete snippets   | —      | ✓      | ✓     |

<Cards>
  <Card title="Groups" href="/groups" description="Assign snippets to groups to keep them organized" />

  <Card title="Workspaces" href="/workspaces" description="Snippets are scoped to your workspace" />

  <Card title="Sharing" href="/sharing" description="Share groups that contain snippets" />
</Cards>
