Components
Navigation
Sidebar navigation based on React Router NavLink
Overview
Navigation is a sidebar navigation compound component. Based on React Router's NavLink, it automatically tracks the active state based on URL.
- Compound — Container, List, Item
- Auto active — Automatic active state detection based on URL
- Match strategy — exact, startsWith, endsWith matching
- Render prop — Access
{ isActive, isPending }in Item's children, className, style
Basic Usage
Render Prop Pattern
States
| State | When | Look |
|---|---|---|
| Default | — | Default background |
| Hover | Pointer over the item | Hover background |
| Selected | Current page (aria-current="page") | Secondary background |
| Disabled | disabled (aria-disabled="true") | Disabled background, text and icon colors |
| Focused | Keyboard focus | 2px focus ring inside the item |
Links have no native disabled attribute, so a disabled item keeps its link but is marked with aria-disabled="true" and does not navigate or call onClick.
The Basic Usage example above includes a disabled item (Reports).
Match Strategy
Sub-components
Navigation.Container
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
children | ReactNode | - | Yes | Usually List. Fixed to the left edge, 256px wide |
className | string | - | No | Extra CSS class |
Fixed sidebar: position: fixed, width: 256px, padding: 600.
Navigation.List
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
children | ReactNode | - | Yes | Items |
match | 'exact' | 'startsWith' | 'endsWith' | 'exact' | No | How every item in the list finds the current page |
className | string | - | No | Extra CSS class |
Wrapped with <nav aria-label="Main navigation">.
Navigation.Item
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
to | string | - | Yes | Destination path. Also used to find the current page |
iconName | IconName | - | No | Icon before the text (when children is not a function) |
disabled | boolean | false | No | Disabled. Adds aria-disabled="true" and blocks navigation |
match | 'exact' | 'startsWith' | 'endsWith' | - | No | How to compare paths to find the current page. Falls back to the List match, then exact |
onClick | MouseEventHandler<HTMLAnchorElement> | - | No | Click handler. Not called when disabled |
children | ReactNode | ((props: ItemRenderProps) => ReactNode) | - | Yes | Text or a render function |
aria-label | string | - | No | Accessible name |
Render Prop Type
export type ItemRenderProps = {
isActive: boolean
isPending: boolean
}Specification
base
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | padding | $size.space.300 |
| enabled | root | gap | $size.space.300 |
| enabled | root | borderRadius | $size.radius.200 |
| enabled | root | backgroundColor | $color.background.default.default |
| enabled | root | color | $color.text.default.default |
| hover | root | backgroundColor | $color.background.default.defaultHover |
| selected | root | backgroundColor | $color.background.default.secondary |
| disabled | root | backgroundColor | $color.background.disabled.default |
| disabled | root | color | $color.text.disabled.default |
| disabled | icon | color | $color.icon.disabled.default |
Guidelines
- Container uses
position: fixed, so applymargin-left: 256pxto adjacent content match="startsWith"is suitable for most nested routes- Requires React Router dependency — use only in React Router projects