KQ-900 · ROOM/SWITCHER
Room Switcher
A room header with a switcher behind a hotkey. Ctrl or Cmd with K raises a panel inside the component's own frame that rises from 8px on snap behind a fading scrim, and typing filters the rooms: the matches carry layout and travel on glide while the rest leave on the exit ease, against a ResizeObserver-measured list height. Enter switches and the header slides — the room you left rises out while the one you chose arrives from below, both stacked in one grid cell and keyed by a jump counter — then focus returns to the trigger.
KQ-900 · ROOM/SWITCHER
#dispatchMorning run, gate BInes CortaGate B is loaded, sixteen pallets.2 unread here · 12 rooms
In #dispatch · 12 rooms · press Ctrl K
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/room-switcher
Props
- rooms
- SwitcherRoom[]
- default —
- Every room: id, name, topic, its last line and who wrote it, plus optional direct and unread marks.
- value / defaultValue
- string
- default —
- Controlled or initial room id; defaults to the first room.
- onValueChange
- (id: string) => void
- default —
- Fires from Enter or an option press.
- open / defaultOpen
- boolean
- default false
- Controlled or initial panel state.
- onOpenChange
- (open: boolean) => void
- default —
- Fires from the hotkey, the trigger, Escape, the scrim, or a chosen room.
- onQueryChange
- (query: string, matches: number) => void
- default —
- Fires from every keystroke with the trimmed query and how many rooms matched.
- hotkey
- string
- default "k"
- The key that raises the panel, pressed with Ctrl or Cmd.
- hotkeyHint
- string
- default "Ctrl K"
- What the trigger prints in its keycaps, space separated.
- placeholder
- string
- default "Jump to a room"
- The field's placeholder, which also names it.
- emptyLabel
- string
- default "No room matches that."
- The sentence shown when nothing matches.
- label
- string
- default —
- Names the switcher, its dialog and its listbox for assistive technology.
| Prop | Type | Default | Description |
|---|---|---|---|
| rooms | SwitcherRoom[] | — | Every room: id, name, topic, its last line and who wrote it, plus optional direct and unread marks. |
| value / defaultValue | string | — | Controlled or initial room id; defaults to the first room. |
| onValueChange | (id: string) => void | — | Fires from Enter or an option press. |
| open / defaultOpen | boolean | false | Controlled or initial panel state. |
| onOpenChange | (open: boolean) => void | — | Fires from the hotkey, the trigger, Escape, the scrim, or a chosen room. |
| onQueryChange | (query: string, matches: number) => void | — | Fires from every keystroke with the trimmed query and how many rooms matched. |
| hotkey | string | "k" | The key that raises the panel, pressed with Ctrl or Cmd. |
| hotkeyHint | string | "Ctrl K" | What the trigger prints in its keycaps, space separated. |
| placeholder | string | "Jump to a room" | The field's placeholder, which also names it. |
| emptyLabel | string | "No room matches that." | The sentence shown when nothing matches. |
| label | string | — | Names the switcher, its dialog and its listbox for assistive technology. |