shadcn.io is not affiliated with official shadcn/ui
Keyboard Shortcuts Task List Block for React Aria
A task list driven by single keys while a row has focus: j and k move, x ticks, e edits the title in place, Backspace deletes with Undo, n jumps to the add field and ? shows the legend, with each key read back.
Installation
Overview
Give power users a task list they can run without the mouse, with this keyboard shortcut to-do list block for React with React Aria. A hairline frame with a plus mark on each corner holds an add field with the only Shine Button, a list of seven tasks, a foot, and a legend. Each task is one button that ticks it, with a roving tab stop so Tab enters the list once. While focus is on a row, j or Down and k or Up move along the rows, x ticks, e swaps the title for an Input (Enter saves, Escape cancels), Backspace deletes with a one-line Undo, n jumps to the add field and ? shows or hides the legend. The polite line under the list reads each key back ("Last key: j. On 'Pay the water bill', 4 of 7."). The legend is a list of Kbd keys that a Switch shows or folds. For planners, backlog tools and anything people live in all day.
FAQ
Where do the keys work?
Only while focus is on a task row. The listener sits on the list band, not on the window, and ignores keys with Ctrl, Cmd or Alt held and keys pressed in a field, so typing a task never triggers a shortcut and the site's own keys are untouched. Single letters are fine here because they only act inside the list; an app with global single-key shortcuts should let people turn them off.
How does editing in place work?
e (or the pencil on a row) swaps that row's title for an input holding the current text, with focus in it. Enter saves it, Escape puts the old title back, and Save and Cancel buttons do the same for a pointer. An empty title is refused with a message. Focus returns to the row after either exit.
Why is each row a single button?
It gives the list one tab stop and the right semantics: the row is a toggle button named by its title and pressed when done, aria-current marks the active row, and Enter and Space tick it natively. The checkbox inside is only a drawing of that state, so it is hidden and inert. The edit and delete icons beside it are for pointer and touch; keyboard users have e and Backspace.