Components
Text
Typed, theme-aware text component for RNJet.
Text
A drop-in replacement for React Native's Text — with built-in theming, typography scale, and i18n support.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | TextType | regular-base | Typography variant (size + weight + line height) |
color | ColorProp | text.primary | Theme color token |
trans | TranslationKey | — | i18n key — renders translated string |
text | string | — | Plain string shorthand |
textAlign | TextStyle['textAlign'] | — | Text alignment |
children | ReactNode | — | Inline content |
style | TextStyle | — | Override styles (note: disables lineHeight from type) |
All other React Native TextProps are supported via spread.
Usage
With i18n key:
<Text trans="welcome:greeting" />With plain string:
<Text text="Hello World" />With children:
<Text>Hello World</Text>With type and color:
<Text type="bold-2xl" color="text.primary">
RNJet
</Text>With alignment:
<Text type="regular-sm" textAlign="center" color="text.secondary">
Subtitle here
</Text>Typography Types
The type prop controls fontFamily, fontSize, fontWeight, and lineHeight together — all defined in src/theme/text-theme.ts. Convention is {weight}-{size}:
bold-2xl bold-xl bold-lg bold-base bold-sm bold-xs bold-2xs
regular-2xl regular-xl regular-lg regular-base regular-sm regular-xs regular-2xs
light-2xl light-xl light-lg light-base light-sm light-xs light-2xsColor Tokens
The color prop accepts a dot-notation theme color token resolved from the active theme (light/dark):
<Text color="text.primary" /> // main text
<Text color="text.secondary" /> // muted text
<Text color="error.default" /> // error stateTokens are defined in src/theme/light.ts and src/theme/dark.ts.
Notes
transtakes priority overtext, which takes priority overchildrenallowFontScalingis alwaysfalse— prevents system font size from breaking layouts- Passing a custom
styledisables the automaticlineHeightfrom thetypeso it doesn't conflict with your override