Free and open-source React header navigation components built for modern applications and websites. These header navigations are built using React Aria and styled with Tailwind CSS.
Installation
You can add this header navigation component using our CLI or manually:
npx untitledui@latest add header-navigation
Header navigation examples
Below are examples and variations of this header navigation component:
API reference
FeaturedCardCurrentProjects
Import FeaturedCardCurrentProjects from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardEventCTA
Import FeaturedCardEventCTA from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardFreeTrialCTA
Import FeaturedCardFreeTrialCTA from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardImage
Import FeaturedCardImage from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardMessage
Import FeaturedCardMessage from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardOnboardingSteps
Import FeaturedCardOnboardingSteps from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardQRCode
Import FeaturedCardQRCode from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardReferralLink
Import FeaturedCardReferralLink from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardSupportCTA
Import FeaturedCardSupportCTA from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FeaturedCardUpgradeCTA
Import FeaturedCardUpgradeCTA from @/components/application/app-navigation/base-components/featured-cards. Renders a <div> element.
FAQs
Please refer to our frequently asked questions page for more.
HeaderNavigationBase takes items as an array of nav objects. Each one needs a label and an href, and can optionally carry an icon component, a badge node, a current boolean to force the active state, and a nested items array of sub-items for the second tier. The desktop header only renders each item's label; icon and badge show up in the mobile drawer.
Pass the current path to the activeUrl prop and the header derives the active item for you: an item matches when its href equals activeUrl exactly, or when activeUrl starts with href + "/" so nested routes keep the parent highlighted. The one exception is a root href of "/", which is excluded from the prefix rule and only ever matches exactly — otherwise it would stay highlighted on every page. To override the match for one item, set current on that item.
There are two ways. Either nest an items array inside the top-level item that should own the second tier — it renders automatically when that item is active — or pass a separate subItems array to HeaderNavigationBase to control the second row directly. The secondary row is only rendered when there is at least one sub-item.
Yes. The secondaryType prop accepts "buttons" (the default, which renders NavButton pills) and "tabs", which renders the sub-items as underline tabs using the Tabs and TabList components. The tabs only receive each sub-item's label, not its href, so handle navigation yourself if you use "tabs".
Pass your own markup to the actions prop. When it is provided the built-in actions — the search, settings and notification NavButtons plus DropdownAccountButton — are skipped entirely, so you are responsible for rendering everything on that side.
Set centered to true. It defaults to false, which pins the nav items next to the logo; when enabled, the logo and actions each take equal space so the nav sits in the middle. Note that in the centered layout the search input in the buttons-style secondary row is not rendered.
Yes. The full header is hidden below the lg breakpoint, and MobileNavigationHeader renders a compact bar with a menu button that opens a dismissable React Aria modal drawer. The drawer reuses the same items array through NavList and adds a search input, Support, Settings and Open in browser links, and a NavAccountCard. activeUrl is not passed to the drawer's NavList, so items there are not highlighted as active unless you add it.