Files
tabler/shared/components/navbar/NavbarSearch.astro
T
codecalm f9230dc5a8 Add ⌘K command palette
- Mounted in BaseLayout, so the shortcut works on every page
- Navbar and sidebar search now open the palette instead of a dead form
2026-08-12 01:19:01 +02:00

22 lines
668 B
Plaintext

---
// Opens the command palette (see @ui/CommandPalette.astro, mounted in BaseLayout)
// rather than submitting a search form: one search surface, one result list.
import Icon from '@ui/Icon.astro'
interface Props {
class?: string
}
const { class: className } = Astro.props
---
<!-- BEGIN NAVBAR SEARCH -->
<div class={className}>
<button type="button" class="btn w-100 justify-content-start text-secondary" data-bs-toggle="modal" data-bs-target="#modal-command-palette" aria-label="Search pages and actions">
<Icon name="search" />
Search
<kbd class="ms-auto" data-command-palette-shortcut>⌘K</kbd>
</button>
</div>
<!-- END NAVBAR SEARCH -->