skip to the page
superthread
compositionssearch palette
system
superthread
version
2.15.1
date
24.11.26

search palette

one search over an app's pages and commands. a field-shaped button opens the command dialog; selecting a result closes it and hands the value to the app.

bunx --bun shadcn@latest add @mk/search-palette

serves constellation, trisys, and artifacts.

example

open either trigger, type a ship's name and choose with the arrow keys and enter. escape closes the dialog. the selected sample page appears below its trigger.

light

selected: none yet

dark

selected: none yet

open

the open surface, kept in the page so it takes no focus on arrival. filter the pages here too. the unavailable archive stays disabled.

light

selected: none yet

dark

selected: none yet

contact edgedraws where a floating layer meets the page, under its soft lift

states

the trigger is a control, so keyboard focus draws a ring outside it. a search with no match replaces the results with a quiet sentence.

light

rest
input edge, button behavior

focus
2 px control ring

disabled
no action

dark

rest
input edge, button behavior

focus
2 px control ring

disabled
no action

light

selected: none yet

dark

selected: none yet

shortcuts

cmd k or ctrl k toggles search, including from a text field. slash opens it away from editable text. this page gives those keys to the light example so two specimens do not compete.

SearchPalette
owns open state, or takes open and onOpenChange from the app. set hotkey to another letter or null to disable both shortcuts.
SearchPaletteTrigger
names the search. it prints no keycap.
SearchPaletteContent
supplies the named input and live results. pass its select callback to each CommandItem to close and handle the choice.