BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/neon-ui/branch-picker

BranchPicker

neon-ui/branch-picker
FreeComponent

A searchable branch selector with default/protected status and an inline create-branch affordance.

Install it

npx shadcn@latest add https://ui.neon.com/r/branch-picker.json

Source

src/components/branch-picker/branch-picker.tsxui.neon.com/r/branch-picker.json · first 6 KB
1/* oxlint-disable jsx-a11y/prefer-tag-over-role -- a custom ARIA listbox; a native select cannot filter, create, or draw the tree. */
2"use client";
3
4import {
5 ArrowDown01Icon,
6 ArrowLeft01Icon,
7 GitBranchIcon,
8 PlusSignIcon,
9 Search01Icon,
10 SquareLock01Icon,
11 Tick02Icon,
12} from "@hugeicons/core-free-icons";
13import { HugeiconsIcon } from "@hugeicons/react";
14import { useEffect, useRef, useState } from "react";
15import type { ComponentProps, FormEvent, KeyboardEvent } from "react";
16
17import { Button } from "@/components/ui/button";
18import { Input } from "@/components/ui/input";
19import {
20 Popover,
21 PopoverContent,
22 PopoverTrigger,
23} from "@/components/ui/popover";
24import {
25 Tooltip,
26 TooltipContent,
27 TooltipProvider,
28 TooltipTrigger,
29} from "@/components/ui/tooltip";
30import { cn } from "@/lib/utils";
31
32export interface Branch {
33 id: string;
34 name: string;
35 /** The project's default branch. */
36 default?: boolean;
37 /** A protected branch. */
38 protected?: boolean;
39 /** The parent branch's id; drives the drawn hierarchy. */
40 parent?: string;
41}
42
43interface TreeNode {
44 branch: Branch;
45 depth: number;
46}
47
48/* ─────────────────────────────────────────────────────────
49 * GEOMETRY
50 *
51 * The list draws a real branch graph, not indent guides:
52 * a branch sits in the lane of its depth, and a curved edge
53 * runs from its parent's node into it. Tuned tight for the
54 * 32px popover rows. While searching, the list flattens to
55 * one lane and drops the edges.
56 * ───────────────────────────────────────────────────────── */
57const ROW_H = 32;
58const LANE_W = 18;
59const PAD_X = 12;
60const DOT_R = 3;
61const CORNER = 8;
62
63const laneX = (depth: number) => PAD_X + depth * LANE_W;
64const rowY = (row: number) => row * ROW_H + ROW_H / 2;
65
66/** Depth-first flatten, assigning each branch a depth lane. */
67const buildTree = (branches: Branch[]): TreeNode[] => {
68 const ids = new Set(branches.map((branch) => branch.id));
69 const parentOf = (branch: Branch) =>
70 branch.parent && ids.has(branch.parent) ? branch.parent : undefined;
71 const childrenOf = (id?: string) =>
72 branches.filter((branch) => parentOf(branch) === id);
73
74 const nodes: TreeNode[] = [];
75
76 const walk = (branch: Branch, depth: number) => {
77 nodes.push({ branch, depth });
78// … truncated

What it pulls in

npm packages

  • @hugeicons/react
  • @hugeicons/core-free-icons

Other registry items

  • utils
  • https://ui.neon.com/r/button.json
  • https://ui.neon.com/r/input.json
  • https://ui.neon.com/r/popover.json
  • https://ui.neon.com/r/neon-tokens.json
  • https://ui.neon.com/r/tooltip.json

Files it writes

  • src/components/branch-picker/branch-picker.tsx

Facts

Registry
neon-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

ui.neon.com neondatabase/ui on GitHub Raw registry item This item as JSON

More from neon-ui

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ActivityFeedactivity-feedneon-uiComponentsFree2 deps
AgentChatagent-chatneon-uiComponentsFree6 deps
AnimatedWashanimated-washneon-uiComponentsFreeno deps · 2 files
ApiKeyListapi-key-listneon-uiComponentsFree2 deps
AppCardapp-cardneon-uiComponentsFree2 deps
AppCreatorapp-creatorneon-uiComponentsFree2 deps
AuthFormauth-formneon-uiComponentsFreeno deps
AutoscaleChartautoscale-chartneon-uiComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex