Skip to content

Nav

A list of links between pages, sections or filters. Each item is a real link: the server renders the page with the right item active.

  • Nav: static navigation, each item links to a URL. Use it for sub-pages, settings sections, list filters.
  • Tabs: switches between panes already in the page, with JavaScript, without loading a new page.
  • Navbar: the header or sidebar of the app, with the brand, the main menu and a collapse toggler.

A Nav with variant="tabs" looks like Tabs, but its items are links, not pane switchers.

variant sets the look: default (plain links), tabs, pills or underline:

vertical stacks the items in a column, for a side menu:

fill makes the items take the full width, each in proportion to its text. justified gives them all the same width:

Nav:

Prop Type Default Description
variant string 'default' default tabs (nav-tabs) pills (nav-pills) underline (nav-underline)
vertical bool false Stacks the items in a column (flex-column)
fill bool false Items share the full width, in proportion to their content (nav-fill)
justified bool false Items share the full width equally (nav-justified)

Other attributes go to the root <ul class="nav">.

Nav:Item:

Prop Type Default Description
href string? null Link target; without it, the <a> has no href
active bool false The current item (active, with aria-current="page")
disabled bool false Not clickable (disabled, with aria-disabled="true")

Other attributes go to the <a class="nav-link">, not to the <li>.

Component Renders
Nav:Item <li class="nav-item"> around an <a class="nav-link">