React Native MantineTypography

Code

Inline code with monospace styling

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

Usage

import { Code, Text  } from 'react-native-mantine';

// Inline code
<Text>
  Use <Code>import</Code> statement
</Text>

// With color
<Text>
  Error: <Code color="red">error.message</Code>
</Text>

// Block code
<Code block>
  const value = 42;
</Code>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeCode content to display
colorstringCode text color - theme color name (e.g., "blue") or any valid color string
blockbooleanfalseDisplay as code block instead of inline code (adds more padding and renders in BoxView)
withTextWrapperbooleantrueIf false, returns children without wrapping in Text component
styleTextStyle | ViewStyleAdditional styles to apply (TextStyle for inline, ViewStyle for block)
sizestringText size from theme (inherited from Text)
whitebooleanfalseSets text color to white
boldbooleanfalseApplies bold font weight
semiBoldbooleanfalseApplies semi-bold font weight
weight'100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'Font weight - numeric values from 100 (thin) to 900 (black)
align'left' | 'center' | 'right' | 'justify'Text alignment

Source on GitHub · npm