195 Pro components and page blocks

Get Pro

Updated

Pin Tab

Pro

Preview

Customize

Max tab width168px
Duration0.35s

Installation

Pro

Pin Tab is a Pro component

Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.

Install with a key

  1. Add the Pro registry to components.json:
    components.json
    {
      "registries": {
        "@uibrik-pro": {
          "url": "https://uibrik.com/r/pro/{name}.json",
          "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" }
        }
      }
    }
  2. Put your key in .env.local and add that file to .gitignore:
    .env.local
    UIBRIK_LICENSE=your-license-key
  3. Install it:
    Terminal
    npx shadcn@latest add @uibrik-pro/pin-tab

Usage

import { PinTab } from "@/components/uibrik/pin-tab/pin-tab";​const tabs = [  { id: "github", title: "Pull requests", icon: <GithubLogo /> },  { id: "figma", title: "Design system", icon: <FigmaLogo /> },  // …3 more];​<PinTab  maxTabWidth={168}  duration={0.35}  tabs={tabs}  defaultPinned={["github"]}  defaultActive="figma"  // pinned={["…"]}  // onPinnedChange={(ids) => {}}  // active="…"  // onActiveChange={(id) => {}}/>

Where to use Pin Tab

  • Browser-style workspaces

    Pinned tabs shrink to an icon at the front, so favourites stay one click away without taking room.

    Pairs with Split Panes

  • Open documents in an editor

    The title fades out before the tab shrinks, so text never squashes as the width changes.

    Pairs with Code Block

  • Saved views in dashboards

    Pin the views people check daily and leave the rest as regular tabs.

    Pairs with Project Dashboard and Filter Bar

Props

PinTab
maxTabWidth
Type number
168
Widest a regular tab grows.
duration
Type number
0.35
How long a tab takes to shrink, grow and move.
tabs
Type { id: string; title: string; icon: ReactNode }[]
–
The tabs, in their unpinned order.
pinned / onPinnedChange
Type string[] / (ids) => void
–
Controlled pinned ids, in the order they sit at the front.
defaultPinned
Type string[]
["github"]
Pinned ids on mount when uncontrolled.
active / onActiveChange
Type string / (id) => void
–
Controlled active tab.
defaultActive
Type string
–
Active tab on mount when uncontrolled.
className
Type string
–
Classes for the bar.