@manta-eu/react/providers/NavExtrasProvider
Reference for @manta-eu/react/providers/NavExtrasProvider as it is on main.
Type Aliases
NavExtra
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?
optionalbadge?:ReactNode
badgeLabel?
optionalbadgeLabel?:string
href
href:
string
icon
icon:
LucideIcon
id?
optionalid?:string
isCurrent?
optionalisCurrent?: (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?
optionalplacement?:"top"|"end"
top puts the entry before the app’s own pages, for a host page people start from. Defaults to the end.
rulePack?
optionalrulePack?:string
title
title:
string
NavExtrasProviderProps
NavExtrasProviderProps =
object
Properties
children
children:
ReactNode
items?
optionalitems?: readonlyNavExtra[]
Functions
NavExtrasProvider()
NavExtrasProvider(
props):Element
Parameters
props
Returns
Element
navExtrasWithRulePacks()
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[]