TopNav

Horizontal app header with brand, navigation items and an actions area. Use size (xs, sm, md, lg, xl) to change density.

Jump to API reference

Import

Vue
import { UiTopNav } from '@ziyarago/ui/vue'

Default

ZiyaraGo
Sign in
Vue
<UiTopNav
  brand="ZiyaraGo"
  value="tours"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'tours', label: 'Tours', icon: 'map' }, { value: 'hotels', label: 'Hotels', icon: 'building-2' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', count: 4 }]"
>
  <template #actions>Sign in</template>
</UiTopNav>

Text only

ZiyaraGo
Vue
<UiTopNav
  brand="ZiyaraGo"
  value="home"
  :items="[{ value: 'home', label: 'Home' }, { value: 'tours', label: 'Tours' }, { value: 'about', label: 'About' }]"
 />

Sub-menus

ZiyaraGo
Sign in
Vue
<UiTopNav
  brand="ZiyaraGo"
  value="invoices"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', children: [{ value: 'upcoming', label: 'Upcoming', icon: 'calendar-clock' }, { value: 'past', label: 'Past', icon: 'history' }, { separator: true }, { value: 'cancelled', label: 'Cancelled', icon: 'calendar-x', count: 3 }] }, { value: 'billing', label: 'Billing', icon: 'receipt', children: [{ heading: 'Money' }, { value: 'invoices', label: 'Invoices', icon: 'file-text' }, { value: 'payouts', label: 'Payouts', icon: 'banknote' }, { heading: 'Setup' }, { value: 'plans', label: 'Plans', icon: 'layers' }] }, { value: 'settings', label: 'Settings', icon: 'settings' }]"
>
  <template #actions>Sign in</template>
</UiTopNav>

Overflow into More (narrow)

ZiyaraGo
Vue
<UiTopNav
  brand="ZiyaraGo"
  value="content"
  :items="[{ value: 'platform', label: 'Platform', icon: 'house' }, { value: 'tenants', label: 'Tenants', icon: 'shield-check' }, { value: 'billing', label: 'Billing', icon: 'receipt' }, { value: 'ops', label: 'Operations', icon: 'wrench', count: 4 }, { value: 'content', label: 'Content', icon: 'layout-grid' }, { value: 'support', label: 'Support', icon: 'life-buoy' }, { value: 'audit', label: 'Audit', icon: 'scroll-text' }]"
 />

Sizes

ZiyaraGo
Sign in
ZiyaraGo
Sign in
ZiyaraGo
Sign in
ZiyaraGo
Sign in
ZiyaraGo
Sign in
Vue
<UiTopNav
  brand="ZiyaraGo"
  value="tours"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'tours', label: 'Tours', icon: 'map' }, { value: 'hotels', label: 'Hotels', icon: 'building-2' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', count: 4 }]"
  size="xs"
>
  <template #actions>Sign in</template>
</UiTopNav>

<UiTopNav
  brand="ZiyaraGo"
  value="tours"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'tours', label: 'Tours', icon: 'map' }, { value: 'hotels', label: 'Hotels', icon: 'building-2' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', count: 4 }]"
  size="sm"
>
  <template #actions>Sign in</template>
</UiTopNav>

<UiTopNav
  brand="ZiyaraGo"
  value="tours"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'tours', label: 'Tours', icon: 'map' }, { value: 'hotels', label: 'Hotels', icon: 'building-2' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', count: 4 }]"
  size="md"
>
  <template #actions>Sign in</template>
</UiTopNav>

<UiTopNav
  brand="ZiyaraGo"
  value="tours"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'tours', label: 'Tours', icon: 'map' }, { value: 'hotels', label: 'Hotels', icon: 'building-2' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', count: 4 }]"
  size="lg"
>
  <template #actions>Sign in</template>
</UiTopNav>

<UiTopNav
  brand="ZiyaraGo"
  value="tours"
  :items="[{ value: 'home', label: 'Home', icon: 'house' }, { value: 'tours', label: 'Tours', icon: 'map' }, { value: 'hotels', label: 'Hotels', icon: 'building-2' }, { value: 'bookings', label: 'Bookings', icon: 'calendar-check', count: 4 }]"
  size="xl"
>
  <template #actions>Sign in</template>
</UiTopNav>

API reference

Horizontal app header with a brand area, navigation items and an actions area.

Props

PropType and valuesDefaultDescription
brandstring | VNode—Logo or product name on the left.
items{ value: string | number; label: string; icon?: string; count?: string | number; children?: ({ value: string | number; label: string; icon?: string; count?: string | number; disabled?: boolean } | { heading: string } | { separator: true })[] }[]'[]'Navigation entries. count renders a small counter after the label. An entry with children becomes a drop-down: click or ArrowDown opens a menu of its children (each with an optional icon and count, headings and separators allowed); selecting one calls change with the child value. The entry is marked current when one of its children is.
valuestring | number—Value of the active item (aria-current="page").
overflowmenunone'menu''menu': entries that do not fit move into a trailing "More" drop-down (measured after render and on resize; server rendering shows all entries). 'none': no collapsing, the row scrolls sideways and sub-menus are clipped, so avoid children with it.
moreLabelstring'More'Accessible name of the overflow drop-down button.
sizexssmmdlgxl'md'Scale of header padding, item height and text.

Slots

Vue: named slots. React: a prop with the same name; default is children.

actionsRight side of the header (buttons, avatar). React also accepts an actions prop.

Events

Vue: @name. React: onName.

changeCalled with the value of the clicked item or sub-menu item.

Notes

  • Controlled: update value yourself in the change handler.
  • Items use count; SubNav uses badge for the same purpose.
  • Entries with children and the More menu share the Dropdown keyboard behaviour: ArrowDown opens, arrows and Home/End move, Escape closes and returns focus to the button.