Skip to content
synccn

Transfer List

New

Two searchable lists with checkboxes and buttons to move items between them, double-click and keyboard support.

Available scopes

6
  • projects:writeCreate and edit projects
  • deployments:writeTrigger and roll back deploys
  • env:readRead environment variables
  • env:writeChange environment variables
  • billing:readView invoices
  • team:adminOwners only

Token scopes

2
  • projects:readList and view projects
  • deployments:readView deployments and logs

2 scopes on this token · double-click to move one

Installation

$ pnpm dlx shadcn@latest add @synccn/transfer-list

First time in this project? Connect synccn with one command.

Usage

import { TransferList } from "@/components/ui/transfer-list";<TransferList items={scopes} value={granted} onValueChange={setGranted} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

TransferList

Two lists with checkboxes and buttons to move items between them: search each side, select all, double-click or press Enter to move. Stacks on narrow screens.

  • itemsrequired
    TransferItem[]

    Every item, on either side.

  • value
    string[]

    Controlled values on the right, in order.

  • defaultValue
    string[]

    Default []

    Values on the right at first, when uncontrolled.

  • onValueChange
    (value: string[]) => void

    Called with the values on the right.

  • titles
    [string, string]

    Default ["Available", "Selected"]

    Headings for the left and right lists.

  • searchable
    boolean

    Default true

    Shows a search box above each list.

  • height
    number

    Default 240

    Height of each list, in pixels.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

  • lib/hooksuseControllable (works controlled or uncontrolled)
  • lib/utilscn (merges class names)

npm packages

Keyboard

  • ↓or↑Move through a list
  • SpaceCheck or uncheck
  • EnterMove checked items (or the focused one) to the other list
  • Ctrl+Aor⌘ACheck all

Accessibility

  • Each side is a multi-select listbox; select-all is a tri-state checkbox.
  • Moves are announced in a polite live region.

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: checkbox, group, listbox, option
  • ARIA attributes: aria-activedescendant, aria-checked, aria-disabled, aria-label, aria-labelledby, aria-live, aria-selected
  • Keys handled: ArrowUp, ArrowDown, Home, End, Enter, Space
  • Shows a visible focus ring for keyboard users
  • Includes text only screen readers hear
  • Labels are tied to their controls
  • Announces changes to screen readers