<Nav> Component
<Nav> is a list of (client-side/normal) navigation with automatically toggling-on the <NavItem>'s active state at corresponding URL.
Here the demo:
<Nav> Component<Nav> is a list of (client-side/normal) navigation with automatically toggling-on the <NavItem>'s active state at corresponding URL.
Here the demo:
<Nav> ComponentThere are 2 ways to install <Nav> component into your react app project:
Specifies how comparisons are made for the current URL with the href/to property inside <Link> component.
In order to the properties below to work, you should place a <Link> component inside the <NavItem>, with the href property (NextJS) or to property (ReactRouter).
// NextJs:
<NavItem caseSensitive={false} end={false}>
<Link href='/products'>Products</Link>
</NavItem>
// ReactRouter:
<NavItem caseSensitive={false} end={false}>
<Link to='/products'>Products</Link>
</NavItem>caseSensitive PropertyDefines the string sensivity comparison for the current URL with the href/to property inside <Link> component.
The possible values are:
undefinedtruefalseend PropertyDetermines how nested URLs are treated against the href/to property inside <Link> component.
The possible values are:
undefinedtruefalseNavigates between pages using JavaScript way, without causing a whole page HTTP request.
<NavItem> designed to work with <Link> component of React Router and Next JS (Gatsby JS and React Remix are coming soon).
When there is a <Link> component inside the <NavItem>, at render phase, the hierarchy of <NavItem> and <Link> is automatically swapped for you. Here the illustration:
href PropertyNavigates to another pages or to external websites using traditional link.
onClick PropertyExecutes a JavaScript's callback function when the <NavItem> is clicked.
The alternative appearances of the <Nav> layout without changing the <Nav>'s functionality.
listStyle PropertySets the alternative appearances of the <Nav>.
The possible values are:
undefined'regular''flat''flush''joined''content''button''tab''breadcrumb''bullet''numbered'Here the preview:
orientation PropertySets the orientation of the <Nav>.
The possible values are:
undefined'inline''block'Here the preview:
size PropertyDefines the alternative size of the <Nav>.
You can set the size individually for each <NavItem>.
The possible values are:
undefined'sm''md''lg'Here the preview:
theme PropertyDefines the contextual theme of the <Nav>.
You can set the theme individually for each <NavItem>.
The possible values are:
undefined'primary''secondary''success''info''warning''danger''light''dark'Here the preview:
gradient PropertyActivates a 3D mode of the <Nav>.
You can set the gradient individually for each <NavItem>.
The possible values are:
undefined'inherit'truefalseHere the preview:
outlined PropertyActivates an outlined mode (background-less, contrast foreground, and contrast border) of the <Nav>.
You can set the outlined individually for each <NavItem>.
The possible values are:
undefined'inherit'truefalseHere the preview:
mild PropertyActivates a mild mode (mild background, contrast foreground, and contrast border) of the <Nav>.
You can set the mild individually for each <NavItem>.
The possible values are:
undefined'inherit'truefalseHere the preview:
The conditions of the <Nav> behavior or functionality.
enabled PropertyDefines the enabled/disabled state of the <Nav>.
You can set the enabled individually for each <NavItem>.
The possible values are:
undefinedtruefalseHere the preview:
inheritEnabled PropertyInfluences the <Nav>'s disabled state by <ancestor enabled={false}>.
You can set the inheritEnabled individually for each <NavItem>.
The possible values are:
undefinedtruefalseHere the preview:
Overwrites the internal (sub) components used as the composition of <Nav> component.
listComponent PropertyOverwrites the internal <List> component used as the composition of <Nav> component.
<Nav listComponent={
<MyCustomList />
} />listItemComponent PropertyOverwrites the internal <ListItem> component used as the composition of <NavItem> component.
<NavItem listItemComponent={
<MyCustomListItem />
} />Because <Nav> is made from <List>, so all properties from <List> are inherited.
You can see the documentation of <List> here.