Generates a <nav> Element wrapped in a NavigationContext identified as nav, unless differently specified.

TrackedNav: (props: {
objectiv?: {
id?: string,
normalizeId?: boolean,
}) => <nav>

objectiv prop attributes

typedefault value
optionalidstringinferred from native id or title, fallback to nav
  • When the id attribute is omitted, we attempt to infer it from one of the elements' native props: id or title.

If that fails, we fallback to nav.



Automatic Events


Usage example

import { TrackedNav } from '@objectiv/tracker-react';

<a href={'/'}>Homepage</a>
<a href={'/about'}>About us</a>
<a href={'/product'}>The Product</a>
<TrackedNav id={'Footer Navigation'}>
<a href={'/'}>Homepage</a>
<a href={'/privacy'}>Privacy</a>
<TrackedNav objectiv={{ id: 'Secondary Footer' }}>
<a href={'/contact'}>Contact</a>
<a href={'/blog'}>Blog</a>

By default, all Tracked Elements automatically normalize their Context identifiers to a kebab-cased format.

This can be disabled via the normalizeId option:

import { TrackedNav } from '@objectiv/tracker-react';

<TrackedNav objectiv={{ id: 'Main Navigation', normalizeId: false }}>

Did you know ?

TrackedNav internally uses TrackedNavigationContext.