shadcn.io is not affiliated with official shadcn/ui
Notes Capture Command Menu Block for React
A notes app's command menu shown open as its panel: type a sentence with #tags and Enter saves it to Recent, tag chips filter the list, and a pin button or Alt P moves a note to Pinned.
Installation
Overview
Capture a thought and find it again with this notes command menu for React with Base UI. It opens from the notes panel in Scrawlmill, a notes app, whose header holds an outline field with its ⌘ K cap, and the app is drawn under a soft scrim inside a hairline frame with a plus mark on each corner. The menu is the catalog Command, and its field is both search and capture: type a sentence with #idea in it and the first row becomes Save note, with the tags as chips as you type. Enter saves it to the top of Recent and the menu stays open for the next one; a new tag joins the chip row above the field, a ToggleGroup that filters the list by tag. A pin button on each note, or Alt P on the highlighted one, moves it between Pinned and Recent, and Enter on a note opens it in the drawn app and closes the menu. For preview the menu is drawn open in place when the page loads; the field, or Ctrl or ⌘ K while focus is in the block, opens the real command dialog with the same notes, filter and query. For notes, journals and any app where writing a line should take one keystroke.
FAQ
Why is the menu already open, and what do I keep?
So you can see it without a click. On load the menu is the Command drawn inline over a picture of the notes app, in a plain shell that is not modal, so nothing is trapped, hidden or focused and the page around the preview keeps working. The header's field opens the real command dialog, modal, with its focus trap, Escape and focus return, and the inline copy stays closed until a reload. Both show the same Palette and share the block's state, so a note saved in the copy is in the dialog. In your app keep the dialog and drop the copy: the "in-place" state, the scrim with its shell and the Escape and blur effects.
How are tags read from the text?
readQuery takes every word that starts with a hash and stands alone between spaces (letters, digits, underscores and hyphens, up to twenty characters), lower-cases it, keeps each once and removes it from the note's words. So "Ask Dana about the lease #errand #errand" saves "Ask Dana about the lease" with one tag. A line with tags and no words offers no Save row. A note already on the list (same words, any case) is refused in words instead of saved twice.
How do the chips and the search combine?
The chips show All and each tag with its count, one always chosen. The list shows the notes that carry the chosen tag, contain the words you typed and carry any tags you typed. Saving a note that the current chip would hide switches the chip back to All and says so on the status line, so a saved note is never invisible. The foot counts the notes shown, or the matches while you type.
How does pinning work?
The pin button on a row is a real button that doesn't choose the row and stays out of the tab order; Alt P (Option P on a Mac) does the same on the highlighted row, so the keyboard has its own route. Pinned notes sit in the Pinned group above Recent, and the status line says what was pinned. With nothing highlighted, Alt P says to move to a note first.
What stays local, and how do I wire it?
All of it. The notes are state in the block, the days are fixed text and the status line says nothing is saved. In your app load START from your store, write save and pin through to it, and set day from the note's timestamp.
Is it accessible from the keyboard?
Yes. Type to capture or search, the arrow keys move through the rows, Enter saves or opens, Alt P pins, and Escape closes the menu with focus on the field. Tab reaches the tag chips, which scroll sideways on a phone. Ctrl or ⌘ K opens the dialog while focus is inside the block, and only then. The rows are options of a cmdk listbox; the block turns off its own fuzzy filter and lists the rows itself.
Related
- Pro
A to-do app's command menu shown open over the Today list: type a sentence to add a task with !1 to !3 setting its priority, tick tasks with Enter or Space, and filter Active, Done or All.
- #**>Pro
Markdown Formatting Command Menu
Edit and insertA notes editor's formatting menu shown open over a note: a real textarea with a sample sits above seven rows that format its selection or insert a block, and a preview and a mono line show the result.
- Pro
Snippet Library Command Menu
Edit and insertA code editor's snippet library as a command menu shown open over the editor: a language switch, a pane that follows the highlighted snippet with highlighted code and Copy, and Enter inserts it into the buffer.
- 471Pro
Docs Search Command Menu
Search everythingA docs host's scoped search shown open under the header field: chips for All, Guides, Reference and Releases that carry how many pages match, and results with a path and one line of the page with the matched words marked.
- Pro
Recent Items Command Menu
Search everythingA project hub's command menu shown open on what you opened lately: Today, Yesterday and Earlier buckets before you type, recent matches first when you do, opening a row moves it to the top, and a last row clears the list.
- 1234Pro
Account Switcher Command Menu
SwitchersAn agency billing portal's account switcher as a command menu shown open under the account chip: four accounts with initials, role and plan, a tick on the current one, the keys 1 to 4 to switch straight to an account, and the chip and status line that follow the choice.