JSON Config

Feed the command bar a static list of pages and actions.

The most direct way to populate Slash is to pass it a JSON document describing every item it should be able to find — pages, actions, or anything else you want searchable. This is one of several data sources Slash supports, and works well for small-to-medium sites where the item list is known ahead of time.

slash-items.json
PropTypeDescription
labelrequiredstringThe text shown in results.
urlstringNavigates on select when present.
categorystringGroups items under a heading in results.
keywordsstring[]Extra terms that match without appearing in the label.
iconstringA Feather icon name shown next to the item.
actionstringAn identifier dispatched to onSelect instead of navigating.

Items with a url navigate directly. Items with an action instead call your onSelect handler with the item's action string, so you can wire up custom behavior — creating a document, toggling a setting, opening a modal — without leaving the page.

App.tsx

JSON config is static — it only changes when you redeploy. Pair it with Auto-Discovery or the Sitemap source below if you want Slash to stay current as pages are added without touching this file.