Componentpickers1.45 KB gzipZero dependencies
Tree Select
Hierarchical seating dropdown selector with expandable zone nodes.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add tree-selectOr install the full npm package:
npm install bigbulluiUsage
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 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| data | TreeSelectNode[] | Dataset array rendered in charts, grids, or tables. |
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onValueChange | (val: string, node: TreeSelectNode) => void | Callback invoked on value change. |
| placeholder | string | Placeholder text shown when empty. (Default: "SELECT TICKET SEAT / ZONE") |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |