Manta Developers
GitHub
Menu

@manta-eu/react/providers/NavExtrasProvider

Reference for @manta-eu/react/providers/NavExtrasProvider as it is on main.

Type Aliases

NavExtra = object

A sidebar entry the host adds, for a feature the design system knows nothing about.

The nav is one list in Sidebar, and a host that mounts something of its own — manta/agents mounts Horns — would otherwise have to fork that list or thread a prop through every RouteLayout call site.

Properties

badge?

optional badge?: ReactNode

badgeLabel?

optional badgeLabel?: string

href

href: string

icon

icon: LucideIcon

id?

optional id?: string

isCurrent?

optional isCurrent?: (pathname) => boolean

Whether this entry is the page being looked at. Defaults to its href and anything under it.

Parameters
pathname

string

Returns

boolean

placement?

optional placement?: "top" | "end"

top puts the entry before the app’s own pages, for a host page people start from. Defaults to the end.

rulePack?

optional rulePack?: string

title

title: string


NavExtrasProviderProps = object

Properties

children

children: ReactNode

items?

optional items?: readonly NavExtra[]

Functions

NavExtrasProvider(props): Element

Parameters

props

NavExtrasProviderProps

Returns

Element


navExtrasWithRulePacks<T>(extras, rulePacks?): T[]

Type Parameters

T

T extends Pick<NavExtra, "rulePack">

Parameters

extras

readonly T[]

rulePacks?

readonly string[]

Returns

T[]


useNavExtras()

useNavExtras(): readonly NavExtra[]

Returns

readonly NavExtra[]