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
Skip Nav
Lets keyboard users skip to main content.
Skip to content
Main Content
This is the main content area. When users press Tab and then Enter on the skip link, focus jumps here.
Click on the "Preview" tab and use the tab key to see the skip to content link.
Installation#
pnpm dlx shadcn@latest add @shark/skip-nav
Usage#
- Place
SkipNavLinkas one of the first focusable elements on the page. - Use
SkipNavContentto wrap your main content. It renders a div with an id that the link targets.
import { SkipNavContent, SkipNavLink } from "@/components/ui/skip-nav";
<SkipNavLink /> <nav>...</nav> <SkipNavContent /> <main>Your main content</main>
API Reference#
SkipNavLink#
| Prop | Type | Default |
|---|---|---|
id | string | "skip-nav-content" |
className | string | - |
asChild | boolean | false |
SkipNavContent#
| Prop | Type | Default |
|---|---|---|
id | string | "skip-nav-content" |
className | string | - |
asChild | boolean | false |