Table — Selection in the Leading Mark
- from @astryx
- by Astryx
Selection without a checkbox column: each item shows its avatar, and the checkbox takes the avatar slot while a mouse is over it, on keyboard focus, and everywhere once anything is selected; on touch screens it always shows. The state comes from useTableSelectionState, and the checkboxes render in the name column instead of the useTableSelection column, so checked items get no aria-selected or highlight; add them if needed.
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-table-selection-state-table-selection-in-the-leading-markRegistry dependencies0
The CLI adds no other registry items with this one.
