Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Global Navigation

  • Navbar
  • BeianFooter
  • Brand
  • AppLauncher
  • Sidebar
  • NavMenu
  • NavigationMenu
  • Menu
  • Menubar
  • Dock
  • BubbleMenu
  • CardNav
  • FlowingMenu
  • GooeyNav
  • PillNav
  • StaggeredMenu

In-page Navigation

  • RouteTabs
  • Tabs
  • Breadcrumb
  • Pagination
  • Anchor
  • Affix
  • BackTop
  • Stepper
  • Steps
  • PageHeader

Actions and Tools

  • Command
  • ContextMenu
  • Toolbar
  • Accordion
  • Collapsible
  • Link
  • AnimatedThemeToggler

PillNav

pill-nav

Renders pill-shaped navigation with hover fill, inverted labels, and an active dot.

Usage

Basic usage

Input items and activeHref, activate the item to stay in the inverted state and light up the indicator dot.

  • HomeHome
  • FeaturesFeatures
  • PricingPricing
  • DocsDocs
tsx
<PillNav
  items={[
    { href: "#home", label: "Home" },
    { href: "#features", label: "Features" },
    { href: "#pricing", label: "Pricing" },
    { href: "#docs", label: "Docs" },
  ]}
  activeHref="#home"
/>

With brand logo

The logo slot renders the circular logo on the left side. When hovering, the entire logo rotates in one circle.

Hu
  • HomeHome
  • FeaturesFeatures
  • PricingPricing
  • DocsDocs
tsx
<PillNav items={items} activeHref="#features" logo={<Mark />} />

Close entrance animation

initialLoadAnimation={false} Skip the pop-up/expand animation for the first load.

Hu
  • HomeHome
  • FeaturesFeatures
  • PricingPricing
  • DocsDocs
tsx
<PillNav
  items={items}
  activeHref="#pricing"
  logo={<Mark />}
  initialLoadAnimation={false}
/>

When to use

Use PillNav for lightweight CSS-only site navigation that can render directly in a server component, often beside a brand logo. Use GooeyNav for particle bursts, NavigationMenu or NavMenu for multilevel menus, or Navbar for structural header layout. Every item renders as an anchor, and activeHref matches by string.

Import

ts
import { PillNav } from "@hulianui/ui"

Props

Inherits Omit<HTMLAttributes<HTMLElement>, "children"> on the root nav.

NameTypeDefaultDescription
items*PillNavItem[]-{ href, label, ariaLabel? } entries rendered as pills.
activeHrefstring-Exact href receiving persistent inversion and the active dot.
logoHrefstringitems[0].href → "#"Logo destination.
logoAriaLabelstring"Home"Logo accessible label.
initialLoadAnimationbooleantrueInitial logo and pill entrance, skipped under reduced motion.
classNamestring-Root nav class name.

PillNavItem

NameTypeDefaultDescription
href *string-Link destination (external http/https/mailto/tel/# or an in-app route; the component only renders an <a>).
label *string-Displayed text.
ariaLabelstringFalls back to labelAccessible label.

Slots

SlotTypeDescription
logoReact.ReactNodeOptional circular logo, usually an image or icon, rotating on hover.

Example

tsx
<PillNav items={[{ href: "#home", label: "Home" }, { href: "#features", label: "Features" }, { href: "#pricing", label: "Pricing" }, { href: "#docs", label: "Docs" }]} activeHref="#home" logo={<Mark />} />

Without a logo:

tsx
<PillNav items={items} activeHref="#features" />

Usage guidelines

  • activeHref must exactly equal an item href, including anchors and trailing slashes.
  • In sliding-pill designs, inverted text belongs inside and above the pill to avoid delayed color changes; see [[sliding-pill-indicator-inverted-text-lives-in-pill-z-above]].
  • An inline wrapper around a block logo can align to the baseline and sit low in a flex row. Use flex items-center and leading-none; see [[flex-row-pill-offset-from-inline-child-in-block-wrapper]].

Related

Navbar · BeianFooter · NavMenu · NavigationMenu · Menu · Menubar

Playground

Hu
  • HomeHome
  • FeaturesFeatures
  • PricingPricing
  • DocsDocs
<PillNav
  items={[
    { href: "#home", label: "Home" },
    { href: "#features", label: "Features" },
    { href: "#pricing", label: "Pricing" },
    { href: "#docs", label: "Docs" },
  ]}
  activeHref="#home"
  logo={<Mark />}
  initialLoadAnimation={true}
/>
PreviousGooeyNavNavigationNextStaggeredMenu

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Example
    • Usage guidelines
    • Related
  • Playground