EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
TopNav·component·@astryxdesign/core

Top Nav Heading

Product/suite/account heading for the TopNav heading slot. Supports smart interaction boundary logic: logo, heading text, superheading/subheading with independent links, and an optional menu popover with automatic chevron indicator.

Open in Playground @astryxdesign/core/TopNav

Showcases and examples

2 documented examples

Top Nav Heading

Demonstrates TopNavHeading with a logo and text, both as a plain display and as a clickable link.

Preview loads on approachPreview loads on approach
Exact source · top-nav-heading-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {TopNav, TopNavHeading} from '@astryxdesign/core/TopNav';
import {VStack} from '@astryxdesign/core/Layout';
import {NavIcon} from '@astryxdesign/core/NavIcon';

function AppIcon() {
  return (
    <svg
      width="20"
      height="20"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.5">
      <path
        strokeLinecap="round"
        strokeLinejoin="round"
        d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z"
      />
    </svg>
  );
}

export default function TopNavHeadingShowcase() {
  return (
    <VStack gap={4}>
      <TopNav
        label="Plain heading example"
        heading={
          <TopNavHeading
            heading="Acme Platform"
            logo={<NavIcon icon={<AppIcon />} />}
          />
        }
      />
      <TopNav
        label="Linked heading example"
        heading={
          <TopNavHeading
            heading="Acme Platform"
            logo={<AppIcon />}
            headingHref="/"
          />
        }
      />
    </VStack>
  );
}

Usage

Product/suite/account heading for the TopNav heading slot. Supports smart interaction boundary logic: logo, heading text, superheading/subheading with independent links, and an optional menu popover with automatic chevron indicator.

Typed props

PropType and behavior
logoReactNode
Logo element to display before the heading text. Can be an image, NavIcon, or any ReactNode.
Slot: Icon
headingstring
Product/app name displayed as the primary heading text.
headingHrefstring
Link for the heading text (e.g. product home). When no menu is present and this is the only href, the whole heading becomes one clickable link.
superheadingstring
Text above the heading (e.g. suite name). Rendered in a smaller secondary style.
superheadingHrefstring
Link for the superheading text (e.g. suite home). When provided alongside a menu, renders as an independent inline link.
subheadingstring
Text below the heading (e.g. account context). Rendered in a smaller secondary style.
subheadingHrefstring
Link for the subheading text. When provided alongside a menu, renders as an independent inline link.
headerEndContentReactNode
Content rendered at the trailing edge of the heading row (e.g. a badge or status indicator).
Slot: Button
menuReactNode
Menu content shown in a popover dropdown. When provided, a chevron indicator appears automatically. Interaction boundary is determined by the presence of hrefs: no hrefs means the whole header is the trigger; with hrefs, links are independent and the chevron area is the trigger.
Slot: Button
asLinkComponentType
Custom component to render instead of <a>. Overrides the provider-level default set by LinkProvider. Must accept href, className, style, and children props.
xstyleStyleXStyles
StyleX styles for layout customization. Must be a stylex.create() value.