Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search...
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro

Command palette

Wire the Kbar module for searchable navigation, actions, and keyboard shortcuts in your app shell.
Updated 19d ago
Data filters & toolbar
Pricing & plans
5 min · Pattern
The Kbar module adds a searchable command palette with keyboard shortcuts. Mount it in your app shell header and wire items to routes or actions.

What this pattern covers

A command palette (⌘K / Ctrl+K) lets power users jump anywhere without hunting through menus:
  • Searchable list of navigation targets and actions
  • Grouped by section (Navigation, Actions, Settings)
  • Keyboard shortcuts displayed per item
  • Trigger button in the app header
Gold reference: packages/core/ai/examples/blocks/Header1.tsx and packages/core/src/modules/navigation/Kbar.tsx.

Kbar item shape

Items are plain data objects — no JSX inside the array:
const kbar = [
  {
    id: "dashboard",
    name: "Dashboard",
    icon: "home",
    section: "Navigation",
    keywords: "dashboard home overview",
    href: "/dashboard",
    shortcut: ["meta", "d"],
  },
  {
    id: "new-project",
    name: "New project",
    icon: "plus",
    section: "Actions",
    keywords: "create project new",
    perform: () => openCreateDialog(),
    shortcut: ["meta", "n"],
  },
];
Field
Purpose
`id`Unique key
`name`Display label in results
`section`Group header ("Navigation", "Actions")
`keywords`Extra search terms (space-separated)
`href`Route for navigation items
`perform`Callback for action items (no navigation)
`shortcut`Keys shown in the UI (`["meta", "k"]` → ⌘K)
`icon`Icon name from the Once UI icon set
Use href for pages and perform for in-app actions like "Toggle theme" or "Create project."

Header trigger

Wrap a Button inside the command palette module as the trigger. Pass your items array to the module and use a tertiary Button with a command icon:
<Row gap="8" vertical="center" m={{ hide: true }}>
  <Button size="s" variant="tertiary" prefixIcon="command">
    Search
  </Button>
</Row>
Place the trigger Button as a child of the Kbar module (see Header1 for the full wrapper). Hide the trigger Row on mobile (m={{ hide: true }}) where screen space is tight — users can still open the palette with the keyboard shortcut. Show the platform-appropriate modifier in shortcut hints: ⌘ on Mac, Ctrl on Windows. Header1 checks navigator.platform for this.

Global keyboard shortcut

The command palette module registers ⌘K (or Ctrl+K) automatically when mounted. You do not need a separate listener — just ensure it is rendered inside your layout, not inside a page that unmounts on navigation. Place the module in the root layout or app shell header so it persists across routes.

Sections and search

Items group under section headers in the results list. Common sections:
  • Navigation — page links (href)
  • Actions — one-off commands (perform)
  • Settings — preferences and account links
  • Recent — dynamically populated from recent pages
The built-in search matches against name, keywords, and section. Add generous keywords for items users might search by synonym ("prefs" → Settings).

Navigation vs actions

When an item has href, the module uses SmartLink routing. When it has perform, the callback runs and the palette closes.

Placement in app shell

The command palette belongs in the header's right zone, between nav links and the user menu:
See App shell navigation for the full header composition with MegaMenu and mobile fallbacks.

Write this / not this

✅ Once UI way
❌ Common mistake
Plain objects in `items` arrayJSX elements as items
`keywords` for search aliasesOnly matching on `name`
`href` for routes, `perform` for actionsMixing onClick into item data
Kbar in root layout / headerPalette inside a page component
Hide trigger on mobile, keep shortcutNo mobile access at all

Check yourself

  • Every item has a unique id
  • Navigation items use href, actions use perform
  • keywords cover common search terms
  • Module mounted in persistent layout (not per-page)
  • Trigger hidden on mobile, keyboard shortcut still works

Related

→ App shell navigation → Chat & messaging → Full reference: docs.once-ui.com — Kbar
// Navigation — uses href, router pushes on select
{ id: "billing", name: "Billing", href: "/settings/billing", section: "Settings", ... }

// Action — uses perform callback
{ id: "logout", name: "Sign out", perform: () => signOut(), section: "Actions", ... }
<Row as="header" fillWidth horizontal="between" vertical="center" ...>
  <Row gap="4" vertical="center">
    {/* Logo + NavIcon */}
  </Row>
  <Row gap="8" vertical="center">
    {/* Kbar trigger */}
    {/* UserMenu */}
  </Row>
</Row>