Components & blocks

What the registry ships, where each item lands in your repo, how to find what exists, and how to keep vendored components up to date.

What item types exist

Run bunx shadcn@latest list @nx-ui for the live list rather than trusting a fixed count. As a map of the families:

  • UI components (registry:ui) — the full shadcn suite, restyled Nexus. Always land at components/ui/<name>.tsx.
  • AI Elements (ai-*) — AI SDK ports (conversation, message, reasoning, tool, prompt-input, the workflow canvas…) that install to components/ai/.
  • Blocks (registry:block) — the app-shell family, marketing patterns, domain pickers, maps and the data-table kit. These install in two shapes (see below).
  • Theme & brand items — the base theme plus the brand variants, and flare-styles.
  • Data & lib items — reference datasets (data-ewc-codes, data-material-terms, data-project-scopes) and shared modules (utils, mapbox, os-grid-reference), plus the use-mobile hook.

Block install paths — two behaviours

In this repo all block source lives under components/blocks/, but they don't all install the same way. The path is driven by whether the block's registry item carries an explicit file target.

Single-file app-shell blocks flatten

The shell family — app-shell, app-sidebar, sidebar-nav, org-switcher, user-menu, page-header, app-breadcrumbs, featured-icon, theme-toggle, nx-logo and other top-level single-file blocks — carries no target. The CLI installs each by basename into your components alias root, so @nx-ui/user-menu lands at components/user-menu.tsx (not components/blocks/). Import from @/components/<name>.

Multi-file & categorised blocks install nested

Every newer block carries an explicit target that preserves its source subdirectory: the data-table kit → components/blocks/data-table/…; the domain pickers → components/blocks/domain/<name>/…; the maps → components/blocks/maps/<name>.tsx; the marketing patterns → components/blocks/marketing/<name>.tsx. Import from where they land.

Don't guess — check where a block installs

Because the path differs per block, verify it before wiring the import. viewlists each file's install target:
shell
bunx shadcn@latest view @nx-ui/<name>   # shows every file's target path

Discovery — finding what exists

Browse the registry with the real shadcn v4 commands:

shell
bunx shadcn@latest list @nx-ui          # every item in the registry
bunx shadcn@latest search @nx-ui -q menu # filter by keyword
bunx shadcn@latest view @nx-ui/button    # inspect one item's files + deps

You can also fetch the raw registry index directly — one JSON object listing every item with its files and dependencies:

shell
curl -H "Authorization: token $NX_UI_GITHUB_TOKEN" \
  https://raw.githubusercontent.com/nexus-regen/nx-ui/main/public/r/registry.json
  • The showcase app (this gallery) is the visual catalogue — every component in both light and dark mode. Press ⌘K (or Ctrl K) to jump to any item by name.
  • Machine-readable indexes — the showcase publishes /llms.txt (a compact catalogue of every item with its blurb and install command) and /llms-full.txt (the same, with each item's full source inlined), regenerated at build. They are the fastest way for an agent to survey the registry.

Updating components

Vendored components are yours — once installed, the files are yours and nx-ui never reaches into your repo. To pick up upstream changes, re-run the add command with --overwrite and review the diff, same as any dependency bump:

shell
bunx shadcn@latest add @nx-ui/button --overwrite
git diff -- components/ui/button.tsx     # review, same as any dependency bump

Because nx-ui keeps a deliberately minimal diff from upstream shadcn, these diffs are small. There is no separate "sync" command — re-add with --overwrite is the whole story.

Wrap, don't fork

Never edit a vendored component in place beyond trivial needs — --overwrite discards local edits. Build app-specific behaviour in a wrapper component that composes the nx-ui one. If a change is generally useful (a bug fix, a missing variant), PR it into nx-ui:components/… so every consumer gets it, rather than letting it rot as a local fork.
Next: the App-shell pattern for how the shell blocks compose, or Blocks and Components to browse them live.