generated from mateusfg7/nextjs-setup
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): create kbar search trigger component and add it on Header
- Loading branch information
Showing
3 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { MagnifyingGlass } from '@/shared/lib/phosphor-icons' | ||
import { useKBar } from 'kbar' | ||
|
||
export function Search() { | ||
const { | ||
query: { toggle } | ||
} = useKBar() | ||
|
||
return ( | ||
<button | ||
onClick={toggle} | ||
className="flex flex-1 cursor-text items-center gap-5 rounded-xl bg-neutral-200/30 p-2 text-sm leading-none backdrop-blur-3xl dark:bg-neutral-800/30" | ||
> | ||
<span className="flex items-center gap-3"> | ||
<MagnifyingGlass /> | ||
<span className="text-neutral-400">Search...</span> | ||
</span> | ||
<kbd className="keyboard hidden md:flex">Ctrl K</kbd> | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters