Skip to content

Nav highlight

The shared highlight that glides between tabs, segments and nav rows.

Render NavHighlight inside the current item only, give that item relative isolate, and give the highlight its fill and radius with className. Wrap each set in NavHighlightGroup.

Between rows

Two sets side by side

Installation

npx shadcn@latest add @khaeli/nav-highlight

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

npm packages
  • motion ^12.23.12

Accessible name

  • The highlight is decoration and is hidden from assistive technology with aria-hidden. It has no keyboard behaviour of its own.
  • The item that holds it must say it is current: aria-current="page" on a nav row, aria-pressed on a segment, aria-selected on a tab. @khaeli/tabs does this itself.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/nav-highlight.json