Knit UI
GitHub

Playground

Loading playground…

false
false
false
Playground
<NavLink
  label="NavLink"
  variant="light"
  active={false}
  disabled={false}
  noWrap={false}
  disableRightSectionRotation={false}
/>

Examples

Variants

Every visual variant side by side at default size.

Loading example…

VariantsSourceStorybook

Active

Active state applied to each variant — shows how the active theme ramp is used per variant.

Loading example…

ActiveSourceStorybook

Shadows

Each elevation of the inherited shadow prop applied to the NavLink row.

Loading example…

ShadowsSourceStorybook

Disabled

Disabled state — reduced opacity and no pointer events.

Loading example…

DisabledSourceStorybook

With Description

Label plus a secondary description line below it.

Loading example…

With DescriptionSourceStorybook

With Sections

Left and right sections hold icons or badges.

Loading example…

With SectionsSourceStorybook

Nested

Nested NavLink children — the parent shows a chevron that rotates on expand.

Loading example…

NestedSourceStorybook

Controlled

Controlled open state — the parent component drives opened and onChange.

Loading example…

ControlledSourceStorybook

Styles

Per-slot styles targets individual parts — here the root row, the label, and the description.

Loading example…

StylesSourceStorybook

Sidebar

A realistic navigation sidebar built from NavLink items.

Loading example…

SidebarSourceStorybook

Compound API

Compound sub-components (NavLink.Root, NavLink.Body, NavLink.Label, etc.) used directly for custom layouts.

Loading example…

Compound APISourceStorybook

Props

PropTypeDefaultDescription
activeboolean | undefinedfalseApplies active styles to the item.
childrenReactNodeNested `NavLink` children.
childrenOffsetnumber | SpaceTokens | Animated.AnimatedNode | "safe" | null | undefined'$lg'Left indentation applied to nested children.
defaultOpenedboolean | undefinedfalseUncontrolled initial open state.
descriptionReactNodeDescription displayed below the label.
disabled systemboolean | undefinedfalseDisables pointer events and reduces opacity.
disableRightSectionRotationboolean | undefinedfalseDisables chevron rotation when expanded.
keepMountedboolean | undefinedtrueKeep nested children mounted when collapsed.
labelReactNodeNavLinkMain link label.
leftSectionReactNodeSection on the left of the label.
noWrapboolean | undefinedfalseTruncates label and description to one line.
onChange((opened: boolean) => void) | undefinedCalled when open state changes.
openedboolean | undefinedControlled open state.
rightSectionReactNodeSection on the right of the label (defaults to chevron when children exist).
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
styles systemSlotStyles<NavLinkStyles> | undefinedPer-slot style sugar — props spread onto the matching styled part.
theme systemThemeName | null | undefinedApplies a theme to this element
variant systemNavLinkVariant | undefined
filled · light · subtle
'light'Visual style — controls hover and active background colours.

Style slots

Every part of NavLink can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
bodystyles={{ body: { … } }}
chevronstyles={{ chevron: { … } }}
childrenstyles={{ children: { … } }}
descriptionstyles={{ description: { … } }}
labelstyles={{ label: { … } }}
leftSectionstyles={{ leftSection: { … } }}
rightSectionstyles={{ rightSection: { … } }}
rootstyles={{ root: { … } }}
wrapperstyles={{ wrapper: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 496 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.