Skip to main content
A navigation item for the sidebar that automatically resolves title and icon from the resource definition’s meta corresponding to the URL specified in to.

Import

Usage

Auto-resolved from resource meta

The simplest way to use SidebarItem 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 URLs are automatically detected and rendered with an external link icon:

Custom rendering with render prop

For full control over the rendered UI, use the render 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 with to (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 the render prop, you receive SidebarItemRenderProps:

Examples

Basic sidebar navigation

With custom badges