Black Friday: 30% off Pro

Get 30% off

Updated

Smart Paste

New

Preview

Customize

Max6
Duration0.40s

Installation

npx shadcn@latest add https://uibrik.com/r/smart-paste.json
Adds the files to components/uibrik/smart-paste and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/smart-paste.

Usage

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) => {}}/>

Where to use Smart Paste

  • Attaching links to issues

    Pasted URLs become readable chips with titles, so a ticket shows what each link is.

    Pairs with Issue Tracker

  • Resources and references

    A list of docs or designs reads as names instead of long URLs.

    Pairs with Tag Input

  • Composers and forms

    Links stay editable: Backspace turns a chip back into its URL in place.

    Pairs with Email Composer

Props

SmartPaste
placeholder
Type string
"Paste a link"
Shown while there are no links.
max
Type number
6
Most links allowed.
duration
Type number
0.4
How long a chip takes to fold or unfold.
openOnClick
Type boolean
true
Open a chip's link in a new tab when it's clicked.
disabled
Type boolean
false
Grey the field out and ignore input.
value / onChange
Type string[] / (links) => void
–
Controlled links, as typed or pasted.
defaultValue
Type string[]
–
Links on mount when uncontrolled.
favicon
Type (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
Type (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
Type string
"Links"
Names the field for screen readers.
className
Type string
–
Classes for the field.