Inline commands open panel — Search block

Pro

search-inline-commands-open-panel · for app pages

Inline commands open panel

The panel open in the page, for a search page or the app’s empty search state

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/search-inline-commands-open-panel

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import SearchInlineCommandsOpenPanel from '@/components/trame/blocks/search/search-inline-commands-open-panel.vue'

const props = {
label: "Search…",
placeholder: "Find a page, a listing, an action…",
groups: [
{
label: "Pages",
items: [
{
id: "p1",
label: "Home",
description: "Today’s dashboard",
icon: "page",
shortcut: "⌘1",
action: "home"
},
{
id: "p2",
label: "Orders",
description: "34 in progress",
icon: "record",
action: "orders"
}
]
},
{
label: "Actions",
items: [
{
id: "a1",
label: "Create a product",
description: "A blank listing",
icon: "create",
shortcut: "⌘N",
action: "product.create"
},
{
id: "a2",
label: "Invite a teammate",
icon: "user",
action: "team.invite"
}
]
}
],
recent: [
{
label: "today’s orders",
action: "orders"
},
{
label: "fisherman sweater",
action: "products"
}
],
options: {
footnote: "Every page and action in your workspace, one shortcut away."
}
}
</script>

<template>
<SearchInlineCommandsOpenPanel v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
label*stringWordsthe panel’s heading ("Search…")
placeholderstringWordsthe field’s placeholder ("Search for a page, a record, an action…")
groupsGroup[]Datathe entries, grouped (pages, records, actions)
recentRecent[]Datathe recent searches, the app’s own history
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Group groups[] · 2 props
PropTypeDescription
label*stringWordsthe group’s heading ("Pages", "Actions")
items*Item[]the group’s items, in order
Item groups[].items[] · 6 props
PropTypeDescription
id*string | numberDatathe entry’s id in the tool that answers it
label*stringWordswhat the entry says ("Orders", "Create a product")
descriptionstringWordsa secondary line (a path, a count, a hint)
shortcutstringWordsthe entry’s keyboard shortcut as the app writes it ("⌘N")
icon'page' | 'record' | 'create' | 'user' | 'settings' | 'link'the icon shown with the item
action*stringActionthe page the entry opens
Recent recent[] · 2 props
PropTypeDescription
label*stringWordsa recent search, as the visitor typed it
action*stringActionthe page it leads to
Options options · 4 props
PropTypeDescription
emptyTitlestringWordswhat the panel says when nothing matches ("No results")
emptyTextstringWordsthe empty state’s one line of advice
footnotestringWordsa line under the panel (the shortcut, the scope of the search)
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: groups[].items[], recent[]

A search section, for app pages; it uses @lucide/vue, clsx, tailwind-merge.

More search blocks

  • Command menu dialog: the app’s palette: a quiet trigger showing the shortcut, the panel opens over the page.
  • Filter builder rows: Above a data table or in a filter panel: a stack of condition rows (field, operator, value) under "Match all / any", with "Add condition", "Apply" and "Save view" at the foot.
  • Filter builder sentence: When the filter should read as plain words ("Show deals where stage is Won and amount is greater than 10000"): each part is a token that opens a small popover to change it.
  • Record faceted: A large index searched often: the kinds and their counts in a side column, the field and the flat list of hits beside it; on a phone the kinds fold into a row above.
  • Record grouped: A first look across everything: one section per kind (projects, tasks, documents, people) with its best five hits and a "See all 24" link to that kind alone.
  • Record tabbed: People who know what they want: tabs of the kinds with their counts above one flat list of mixed hits, each with its kind’s sign, its reference, the title with the matched words, a snippet and where it lives.

All 7 search blocks