Components
- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Kudos to Kian Bazza for the original implementation.
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/hitbox.json
Usage
<Button className="hitbox-6">Click me</Button> <Checkbox className="hitbox-4" /> <a href="/page" className="hitbox-y-3 block py-2">Link</a>
Examples
Basic
Use hitbox-* to extend the hit area uniformly on all sides.
Individual sides
Target specific sides with hitbox-l-*, hitbox-r-*, hitbox-t-*, and hitbox-b-*.
Horizontal and vertical
Use hitbox-x-* and hitbox-y-* for axis shorthands.
Custom values
Use arbitrary values with bracket syntax.
Debugging
Add hitbox-debug to visualize the expanded hit area.
Sidebar navigation
Use hitbox-y-* so adjacent items feel continuous.
API Reference
| Class | Expansion |
|---|---|
hitbox | Base (no expansion) |
hitbox-* | All sides (spacing or [value]) |
hitbox-l-* | Left |
hitbox-r-* | Right |
hitbox-t-* | Top |
hitbox-b-* | Bottom |
hitbox-x-* | Left and right |
hitbox-y-* | Top and bottom |
hitbox-debug | Debug overlay |