# Smart Paste

> A link field where a pasted or typed URL folds into a chip with its favicon, title and domain, right where the text was, and Backspace unfolds it back into text to edit.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Inputs |
| Live preview | https://uibrik.com/components/smart-paste |
| Writes | 1 file into `components/uibrik/smart-paste/` |
| Packages | `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 30, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/smart-paste.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/smart-paste`.

Can't run commands? https://uibrik.com/components/smart-paste/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { SmartPaste } from "@/components/uibrik/smart-paste/smart-paste";

const defaultValue = [
  "https://github.com/vercel/next.js",
  "linear.app/changelog",
];

<SmartPaste
  placeholder="Paste a link"
  max={6}
  duration={0.4}
  openOnClick
  disabled={false}
  defaultValue={defaultValue}
  label="Links"
  // value={["…"]}
  // onChange={(links) => {}}
  // favicon={(url) => {}}
  // resolve={(url, signal) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/smart-paste.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `placeholder` | `string` | `"Paste a link"` | Shown while there are no links. |
| `max` | `number` | `6` | Most links allowed. |
| `duration` | `number` | `0.4` | How long a chip takes to fold or unfold. |
| `openOnClick` | `boolean` | `true` | Open a chip's link in a new tab when it's clicked. |
| `disabled` | `boolean` | `false` | Grey the field out and ignore input. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `value / onChange` | `string[] / (links) => void` |  | Controlled links, as typed or pasted. |
| `defaultValue` | `string[]` |  | Links on mount when uncontrolled. |
| `favicon` | `(url) => ReactNode \| string` |  | The icon for a link, worked out at once: a node, or an image URL that fades in once loaded. Point image URLs at your own favicon proxy or a service; leave out for letter tiles. |
| `resolve` | `(url, signal) => LinkMeta \| null \| Promise<LinkMeta \| null>` |  | Looks up a link's title (and a better icon), once per link. Return a value to show it on the first frame, or a promise; the chip eases to its new width when it lands. Fetch through your own server: browsers block reading other sites' pages. |
| `label` | `string` | `"Links"` | Names the field for screen readers. |
| `className` | `string` |  | Classes for the field. |

## Where it fits

- **Attaching links to issues**: Pasted URLs become readable chips with titles, so a ticket shows what each link is. Pairs with [Issue Tracker](https://uibrik.com/components/issue-tracker.md) (Pro).
- **Resources and references**: A list of docs or designs reads as names instead of long URLs. Pairs with [Tag Input](https://uibrik.com/components/tag-input.md).
- **Composers and forms**: Links stay editable: Backspace turns a chip back into its URL in place. Pairs with [Email Composer](https://uibrik.com/components/email-composer.md).

## Same shelf: Inputs

- [Spill Textarea](https://uibrik.com/components/spill-textarea.md): A textarea with a character limit. A ring fills as you write and turns amber near the end; past the limit each new letter blushes red, tips over and falls out of the field, leaving an empty gap where it was, or stays red while a copy of it falls.
- [Swap Fields](https://uibrik.com/components/swap-fields.md): A from/to pair whose fields trade places along opposite arcs when you press swap, carrying their values with them while the slot labels hand over.
- [Swatch Picker](https://uibrik.com/components/swatch-picker.md) (Pro): A row of colour dots where the chosen one stretches into an editable hex pill; + grows the card around a live colour panel, and dots come out by holding, right-clicking or dragging them off the row.
- [Tactile Toggles](https://uibrik.com/components/tactile-toggles.md): A settings list whose switches squish under the finger, drag like the real thing, sweep a faint tint across the row as they turn on, and pause the rows they override.
- [Tag Input](https://uibrik.com/components/tag-input.md): A field that turns typed or pasted text into chips that pop in and shrink out, with Backspace to select and remove, arrow keys to move between chips and a nudge for duplicates.
- [Time Morph](https://uibrik.com/components/time-morph.md) (Pro): A time chip that opens in place into scroll wheels: the time stays put while the hours, minutes and AM/PM around it roll into view, then fold back on the new time.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/smart-paste/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
