useFocusTrap — Quick Edit Panel
- from @astryx
- by Astryx
A custom quick-edit panel, not built on Dialog, that traps focus with useFocusTrap: focusFirst moves focus to its field on open, Tab and Shift+Tab stay inside it, Escape closes it through onEscape, and closing returns focus to the Quick edit button.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @astryx/example-use-focus-trap-quick-edit-panelRegistry dependencies0
The CLI adds no other registry items with this one.
