Components
- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- 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
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Hooks
Hitbox
Expand hit areas of interactive elements without affecting layout.
Kudos to Kian Bazza for the original implementation.
Installation#
pnpm dlx shadcn@latest add @shark/hitbox
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 |