Skip to content
PixiKit

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
NameTypeDefaultDescription
itemsCapsuleNavItem[]DEFAULT_ITEMSThe navigation links: `{ label, href, icon, ariaLabel }`. Items without an href render as buttons.
logostring | ReactNodeDEFAULT_LOGOImage URL or element shown in the round logo button. It spins on hover.
logoAltstring"Logo"Accessible label for the logo link.
logoHrefstring"#"Where the logo links to.
activeHrefstringNoneMarks the item with this href as the current page. Leave it out to let the nav track clicks itself.
defaultActiveIndexnumber0Which item starts active when activeHref is not set.
onItemClick(item: CapsuleNavItem, index: number, event: ReactMouseEvent<HTMLElement>) => voidNoneCalled when an item is clicked.
linkComponentElementType"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.
highlightColorstringNoneColor of the fill, the gliding pill and the dot. Labels on it pick black or white for contrast.
highlightTextColorstringNoneOverrides the label color on the highlight.
barColorstringNoneOverrides the background of the bar and logo.
textColorstringNoneOverrides the label color.
bouncenumber0.3How much the gliding pill and the dot overshoot as they settle, from 0 to 1.
stretchnumber0.5How 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) => voidNoneCalled when the folded menu opens or closes.
introbooleantruePops the logo in and unrolls the bar on mount.
ariaLabelstring"Main"Accessible name of the nav landmark.
classNamestring""
styleCSSPropertiesNone

More navigation components in Pro

View all

Related