Componentpickers1.45 KB gzipZero dependencies

Tree Select

Hierarchical seating dropdown selector with expandable zone nodes.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add tree-select

Or install the full npm package:

npm install bigbullui

Usage

tsx6 lines
import { TreeSelect } from "@/components/ui/tree-select"; <TreeSelect  data={[{ id: "orch", label: "Orchestra", children: [{ id: "row-a", label: "Row A" }] }]}  defaultValue="Row A"/>

Source code

tree-select.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxtree-select.tsx158 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface TreeSelectNode {  id: string;  label: string;  children?: TreeSelectNode[];} export interface TreeSelectProps extends Omit<React.HTMLAttributes<HTMLElement>, "value" | "defaultValue"> {  data: TreeSelectNode[];  value?: string;  defaultValue?: string;  onValueChange?: (val: string, node: TreeSelectNode) => void;  placeholder?: string;  className?: string;

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { TreeSelect } from "@/components/ui/tree-select"; <TreeSelect />
PropTypeDescription
dataTreeSelectNode[]Dataset array rendered in charts, grids, or tables.
valuestringControlled value.
defaultValuestringInitial value when uncontrolled. (Default: "")
onValueChange(val: string, node: TreeSelectNode) => voidCallback invoked on value change.
placeholderstringPlaceholder text shown when empty. (Default: "SELECT TICKET SEAT / ZONE")
classNamestringOptional Tailwind or custom CSS classes merged with component styles.