Capsule Nav
A logo bubble and a bar of pill links: a circle rises through the hovered pill as its label rolls over, or one pill glides between items, and a dot marks the current page.
pixikit.com/docs/components/capsule-nav
Customize
Default active index0
Theme
Layout
Item style
Hover effect
Indicator
Surface
Size
Highlight color
Bounce0.30
Stretch0.50
Collapse
Intro
Props
27| Name | Type | Default | Description |
|---|---|---|---|
items | CapsuleNavItem[] | DEFAULT_ITEMS | The navigation links: `{ label, href, icon, ariaLabel }`. Items without an href render as buttons. |
logo | string | ReactNode | DEFAULT_LOGO | Image URL or element shown in the round logo button. It spins on hover. |
logoAlt | string | "Logo" | Accessible label for the logo link. |
logoHref | string | "#" | Where the logo links to. |
activeHref | string | None | Marks the item with this href as the current page. Leave it out to let the nav track clicks itself. |
defaultActiveIndex | number | 0 | Which item starts active when activeHref is not set. |
onItemClick | (item: CapsuleNavItem, index: number, event: ReactMouseEvent<HTMLElement>) => void | None | Called when an item is clicked. |
linkComponent | ElementType | "a" | Renders the links, so you can pass your router's link. It receives href, className and children. |
theme | "dark" | "light" | "dark" | Color scheme of the surfaces, labels and highlight. |
layout | "split" | "joined" | "split" | Split puts the logo in its own bubble beside the bar. Joined holds everything in one capsule. |
itemStyle | "pill" | "plain" | "pill" | Pill gives every item its own raised pill. Plain shows the labels straight on the bar. |
hoverEffect | "fill" | "glide" | "none" | "fill" | Fill rises a circle through the hovered pill as its label rolls over. Glide slides one pill to the item under the cursor. |
indicator | "dot" | "pill" | "none" | "dot" | How the current page is marked: a small dot that slides between items, or a filled pill. |
surface | "glass" | "solid" | "none" | "glass" | Background of the bar and logo: frosted glass, an opaque fill, or nothing. |
size | "sm" | "md" | "lg" | "md" | Height, padding and text size. |
highlightColor | string | None | Color of the fill, the gliding pill and the dot. Labels on it pick black or white for contrast. |
highlightTextColor | string | None | Overrides the label color on the highlight. |
barColor | string | None | Overrides the background of the bar and logo. |
textColor | string | None | Overrides the label color. |
bounce | number | 0.3 | How much the gliding pill and the dot overshoot as they settle, from 0 to 1. |
stretch | number | 0.5 | How far the gliding pill stretches toward its target before the back edge catches up, from 0 to 1. |
collapse | "auto" | "always" | "never" | "auto" | When the links fold into a menu button. Auto folds them only when they no longer fit. |
onMenuToggle | (open: boolean) => void | None | Called when the folded menu opens or closes. |
intro | boolean | true | Pops the logo in and unrolls the bar on mount. |
ariaLabel | string | "Main" | Accessible name of the nav landmark. |
className | string | "" | |
style | CSSProperties | None |