to.
Import
Usage
Auto-resolved from resource meta
The simplest way to useSidebarItem is to provide only the to prop. The title and icon will be automatically resolved from your resource definitions:
Override title and icon
You can override the auto-resolved title and icon:External links
External URLs are automatically detected and rendered with an external link icon:Custom rendering with render prop
For full control over the rendered UI, use therender prop:
Props
string
required
Target URL. External URLs (starting with
http:// or https://) are rendered as external links.string
Override title. When omitted, title is auto-resolved from resource meta.
ReactNode
Override icon. When omitted, icon is auto-resolved from resource meta.
boolean
Opens link in new tab with
target="_blank". When true, adds an external link icon and opens in new tab.'exact' | 'prefix'
default:"'prefix'"
How to match the current path for active state:
"exact": Only highlight when the path matches exactly"prefix": Highlight when the current path starts withto(with segment boundary check)
(props: SidebarItemRenderProps) => ReactNode
Custom rendering function. When specified, receives
title, icon, url, and isActive for full customization.Render Prop
When using therender prop, you receive SidebarItemRenderProps:
Examples
Basic sidebar navigation
With custom badges
Mixed internal and external links
Related Components
- SidebarGroup - Collapsible group for organizing sidebar items
- SidebarLayout - Layout with sidebar and header