Skip to main content
SidebarItem
@coinbase/cds-web@8.38.5
A navigation item component designed to work within a Sidebar.
import { SidebarItem } from '@coinbase/cds-web/navigation/SidebarItem'
Related components

Basics

SidebarItem requires an icon and title. Place it inside a Sidebar component which provides context for collapsed state and variant styling.

Loading...

Active State

Use the active prop to indicate the currently selected navigation item. The active state changes the text and icon color to provide visual feedback.

Loading...

Collapsed State

When the parent Sidebar is collapsed, SidebarItem automatically hides the title text and shows only the icon. Use tooltipContent to display a tooltip on hover, which is essential for usability since the title is hidden.

Loading...

Styling

Border Radius

The default border radius is 1000 (pill shape) for the default sidebar variant. You can customize it with the borderRadius prop.

Loading...

Custom Component

Use the Component prop to render a completely custom layout while still benefiting from SidebarItem's state management. Your custom component receives icon, title, color, active, and isCollapsed props.

Loading...

Accessibility

SidebarItem automatically sets accessibilityLabel to the title value and uses aria-current="page" when active. When collapsed, the accessibility label is applied to the Pressable to ensure screen readers announce the item correctly.

Provide a custom accessibilityLabel for more descriptive screen reader announcements.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.