Combobox, cloth picker and ⌘K
Async search over thousands of rows: debounced server search + per_page, “20 of 186”, loading / empty / error, multi-select, creatable, recent picks, and matching on the en or cn name. The cloth picker re-points to admin.fabrics.index (~3,600 cloths); ⌘K adds server quick search plus pages from /me/menu.
Covers: combobox primitive, combobox designer, cloth-picker designer, command-palette designer. Exports: Combobox, ClothPicker, CommandPalette.
Anatomy
The component as it sits in the product: English, compact, real data shapes.
Command palette (⌘K)
Server quick search across orders (admin.dashboard.quick-search) plus navigation built from /me/menu: only pages the role can open.
States
8 states, left to right, top to bottom. A mock poll never finishes, so each state is drawn on purpose.
Density
Compact (2b ultra, the default) and comfortable, side by side. Same markup, only the density tokens change.
English · 中文
Staff pick en or cn (T001 Q25). Labels arrive localised; CJK falls back to PingFang SC / Noto Sans SC.
Long string · permission denied
The long-string case (PL-063) and what a role without the permission sees (the server decides; T003).
Both apps
One @rj/admin-kit component, two themes: the Laravel admin (navy pinned) and the DTC admin (kit v4 Midnight green), by token swap only.
Contract
The @rj/admin-kit API for this family. Mirrored in CONTRACT.md.
- Export
Combobox·@rj/admin-kit- Props
query(async fn: search, page) ·value·multiple·creatable·recentKey·renderOption·minChars- States
- closed · typing · loading · results · empty · error · selected · multi · creatable · read-only
- shadcn / Radix
- Popover + Command (cmdk)
- Package underneath
- cmdk · @tanstack/react-query · use-debounce · @tanstack/react-virtual
- Accessibility
- combobox / listbox roles, aria-activedescendant; result count announced
- API operations
- admin.fabrics.index (search, per_page) · admin.orders.lookup · admin.pickers.account-options
- Phone variant
- full-screen picker sheet
- Export
ClothPicker·@rj/admin-kit- Props
supplierfacet ·status·multiple- States
- as Combobox + stock chip
- Package underneath
- Combobox + cloth row
- API operations
- admin.fabrics.index
- Export
CommandPalette·@rj/admin-kit- Props
menu(from /me/menu) ·quickSearch- shadcn / Radix
- Dialog + Command
- Package underneath
- cmdk · react-hotkeys-hook
- Accessibility
- ⌘K / Ctrl K; Esc closes and returns focus
- API operations
- admin.dashboard.quick-search · admin.me.menu
- Phone variant
- search icon in the app bar, full screen