Skip to main content

NeoPopTypography

A text component that applies NeoPop typographic tokens — font type, weight, letter spacing, line-height multiplier, and text transform — consistently across the design system.

Usage

// dark mode example
import { NeoPopTypography } from 'neopop-rn';
import { FontType, FontWeight } from 'neopop-rn/primitives/typography';

<NeoPopTypography
fontType={FontType.HEADING}
fontWeight={FontWeight.BOLD}
fontSize={24}
color="#ffffff"
>
Dark Heading
</NeoPopTypography>
// light mode example
import { NeoPopTypography } from 'neopop-rn';
import { FontType, FontWeight } from 'neopop-rn/primitives/typography';

<NeoPopTypography
fontType={FontType.BODY}
fontWeight={FontWeight.REGULAR}
fontSize={14}
color="#0d0d0d"
>
Body copy for a light screen.
</NeoPopTypography>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeRequired. Text content.
fontTypeFontTypeSelects the typographic role, which controls letter spacing, line-height multiplier, text transform, and default font family (see FontType table).
fontWeightFontWeightNumeric weight string applied directly to fontWeight (see FontWeight table).
fontSizenumberFont size in logical pixels.
colorstringText color.
fontFamilystringOverrides the default font family for the selected fontType.
lineHeightnumberExplicit line height; if omitted, computed as fontSize × LINE_HEIGHT_MULTIPLIER[fontType].
overflowTextOverflow'ellipsis' or 'clip'. Maps to React Native's ellipsizeMode.
lineClampnumberMaximum number of lines before truncation (maps to numberOfLines).
styleStyleProp<TextStyle>Additional text styles applied last (can override any token).

FontType × FontWeight Table

FontTypeenum valueDefault familyLetter spacingLine-height multiplierText transform
HEADING'heading'System-0.51.2none
CAPS'caps'System1.51.3uppercase
BODY'body'System01.5none
SERIF_HEADING'serif-heading'Georgia-0.31.15none
FontWeightenum value (string)
EXTRA_BOLD'800'
BOLD'700'
SEMI_BOLD'600'
MEDIUM'500'
REGULAR'400'
THIN'300'

colorConfig

NeoPopTypography does not accept a colorConfig prop. Use the color prop or style to override text color.

Notes

  • CAPS applies textTransform: 'uppercase' automatically; you do not need to set it via style.
  • SERIF_HEADING defaults to Georgia; on Android, ensure the font is bundled or it will fall back to the system serif.
  • When both lineHeight and fontType are provided, the explicit lineHeight takes precedence over the multiplier.
  • overflow and lineClamp must be set together for truncation to work correctly on Android.