Skip to content
Navigation

GlassNavbar

A frosted top bar that firms up once the page scrolls. It fits its own width: links in a row when wide, a menu button with a drop-down panel when narrow.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
brandReactNodeโ€”Logo or site name on the left.
items{ label, href }[]โ€”The links.
actionReactNodeโ€”Button on the right, e.g. a sign-up link.
activestringfirst hrefhref of the active link at start.
onSelect(item, e) => voidโ€”Click handler. Call e.preventDefault() to stay on the page.
thresholdnumber24Pixels scrolled before the glass turns solid.
containerRefObject<HTMLElement>โ€”Scrolling box to watch. Leave out to watch the page.
accentstring"#a78bfa"Active underline colour.
labelstring"Main"Name read out by screen readers.
classNamestring"text-sm text-white"Text size and colour. Place it yourself (e.g. sticky top-0).