About this set
Four horizontal link bars that each mark the current page a different way. Growing underline scales a 2px bar out from the centre of the current link, and to 60% on hover. Sliding pill puts a filled indigo pill behind the current link and slides it to the next one when the current page changes. Top bar hangs a 3px tab from the top edge of the current link. Dot marker is a borderless row with a small dot under the current link. Use the underline or top bar for section tabs on a project or settings page, the pill for a compact app switcher, and the dot for a quiet marketing header. Every indicator is drawn with ::before or ::after from aria-current=”page”, so the state exposed to screen readers is the state people see. The pill is the only variant with script: it measures the current link, writes its offset and size to four custom properties on the list, and re-measures through a ResizeObserver and a MutationObserver when the row wraps or aria-current moves. Until the script runs, the current link gets the pill colour directly. Rows wrap and centre under 480px.
What’s included
- Four indicators: growing underline, sliding pill, top bar and dot
- Current page drawn from aria-current="page" in every variant
- Sliding pill re-measures itself when the row wraps or the current page changes
- Pill falls back to a highlighted link before the script runs
- Bootstrap version uses .nav, .nav-link and .nav-pills
Accessibility
Each bar is a list of links inside a nav with its own aria-label, and the current link carries aria-current="page", which is also what draws the indicator. Links show a 2px indigo :focus-visible outline. The indicator transitions switch off under prefers-reduced-motion.
Customise it
Change --ind-accent, --ind-ink and --ind-muted on .ind for colour; the padding on .ind a sets the size. In Bootstrap the link colours and padding are the --bs-nav-link-* variables on .ind; in Tailwind edit the #4f46e5 and #667085 values in the after:, before: and aria-[current=page]: utilities.



















