React Native MantineNavigation

NavLink

Navigation link with active state

Import: import { NavLink } from 'react-native-mantine';

Usage

import { NavLink, Icon } from 'react-native-mantine';

<NavLink
  label="Dashboard"
  description="Overview of your account"
  icon={<Icon name="home" size={16} />}
  active
  onPress={() => navigate('Dashboard')}
/>

<NavLink label="Settings" onPress={() => navigate('Settings')}>
  <NavLink label="Profile" onPress={() => navigate('Profile')} />
</NavLink>

Props

PropTypeDefaultDescription
labelReact.ReactNodeLink label
descriptionReact.ReactNodeLink description
iconReact.ReactNodeIcon displayed on the left side
rightSectionReact.ReactNodeSection displayed on the right side
colorMantineColor'blue'Link color from theme
variantVariants<'filled' | 'light' | 'subtle'>'light'Link variant
activebooleanfalseActive state
disabledbooleanfalseDisabled state
childrenReact.ReactNodeChildren NavLinks
onPress() => voidCalled when link is pressed
accessibilityLabelstringAccessibility label for the link
styleanyAdditional styles
disableIfNoPressbooleantrueDisable link if no onPress handler is provided
testIDstringTest identifier used by testing frameworks
withTextWrapperbooleantrueIf false, children will not be wrapped in a Text component. This is useful when the children contain non-text elements like icons or custom components.

Source on GitHub · npm