Skip to main content

Nav

Navigation bits in Bootstrap all share a general Nav component and styles. Swap variants to switch between each style. The base Nav component is built with flexbox and provide a strong foundation for building all types of navigation components.

This is a pass through component from React-Bootstrap.

See React-Bootstrap for additional documentation.

Basic Usage

() => {
const handleSelect = (eventKey) => alert(`selected ${eventKey}`);

return (
<Nav variant="pills" activeKey="1" onSelect={handleSelect}>
<Nav.Item>
<Nav.Link eventKey="1" href="#/home">
NavLink 1 content
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="2" title="Item">
NavLink 2 content
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="3" disabled>
NavLink 3 content
</Nav.Link>
</Nav.Item>
<NavDropdown title="Dropdown" id="nav-dropdown">
<NavDropdown.Item eventKey="4.1">Action</NavDropdown.Item>
<NavDropdown.Item eventKey="4.2">Another action</NavDropdown.Item>
<NavDropdown.Item eventKey="4.3">Something else here</NavDropdown.Item>
<NavDropdown.Divider />
<NavDropdown.Item eventKey="4.4">Separated link</NavDropdown.Item>
</NavDropdown>
</Nav>
);
}