import React from 'react' import { CRow, CCol, CCard, CCardBody, CCardHeader, CDropdown, CDropdownItem, CDropdownMenu, CDropdownToggle, CNav, CNavItem, CNavLink, } from '@coreui/react' import { DocsCallout, DocsExample } from 'src/components' const Navs = () => { return ( React Navs Base navs

The base .nav component is built with flexbox and provide a strong foundation for building all types of navigation components. It includes some style overrides (for working with lists), some link padding for larger hit areas, and basic disabled styling.

Active Link Link Disabled

Classes are used throughout, so your markup can be super flexible. Use{' '} <ul>s like above, <ol> if the order of your items is important, or roll your own with a <nav> element. Because the .nav uses display: flex, the nav links behave the same as nav items would, but without the extra markup.

Active Link Link Disabled
React Navs Horizontal alignment

Change the horizontal alignment of your nav with{' '} flexbox utilities . By default, navs are left-aligned, but you can easily change them to center or right aligned.

Centered with .justify-content-center:

Active Link Link Disabled

Right-aligned with .justify-content-end:

Active Link Link Disabled
React Navs Vertical

Stack your navigation by changing the flex item direction with the{' '} .flex-column utility. Need to stack them on some viewports but not others? Use the responsive versions (e.g., .flex-sm-column).

Active Link Link Disabled
React Navs Tabs

Takes the basic nav from above and adds the variant="tabs" class to generate a tabbed interface

Active Link Link Disabled
React Navs Pills

Take that same HTML, but use variant="pills" instead:

Active Link Link Disabled
React Navs Fill and justify

Force your .nav's contents to extend the full available width one of two modifier classes. To proportionately fill all available space with your{' '} .nav-items, use layout="fill". Notice that all horizontal space is occupied, but not every nav item has the same width.

Active Link Link Disabled

For equal-width elements, use layout="justified". All horizontal space will be occupied by nav links, but unlike the .nav-fill above, every nav item will be the same width.

Active Link Link Disabled
React Navs Working with flex utilities

If you need responsive nav variations, consider using a series of{' '} flexbox utilities. While more verbose, these utilities offer greater customization across responsive breakpoints. In the example below, our nav will be stacked on the lowest breakpoint, then adapt to a horizontal layout that fills the available width starting from the small breakpoint.

Active Link Link Disabled
React Navs Tabs with dropdowns Active Dropdown button Action Another action Something else here Link Disabled React Navs Pills with dropdowns Active Dropdown button Action Another action Something else here Link Disabled
) } export default Navs