NovaUI
Components

Text

A versatile text component with multiple semantic variants for consistent typography.

The Text component is a foundational typography primitive built on React Native's Text component with NativeWind styling. It supports multiple semantic variants — from headings to body text, blockquotes, and muted labels — providing a consistent typographic system across your application.

Preview

Heading 1Heading 2Heading 3Heading 4Paragraph text with comfortable line height for reading.Lead text for introductions.Muted text for secondary information.

Installation

npx novaui-cli add text

Import

import { Text } from 'novaui-components'

Basic Usage

By default, the Text component renders with text-base text-foreground:

This is default text content.
import { Text } from 'novaui-components'

export function BasicText() {
  return <Text>This is default text content.</Text>
}

Variants

Headings

Use heading variants for titles and section headers:

Heading 1Heading 2Heading 3Heading 4
<Text variant="h1">Heading 1</Text>
<Text variant="h2">Heading 2</Text>
<Text variant="h3">Heading 3</Text>
<Text variant="h4">Heading 4</Text>

Paragraph

Optimized for body text with comfortable leading:

The quick brown fox jumps over the lazy dog. This paragraph text uses a relaxed line height for comfortable reading across multiple lines of content.
<Text variant="p">
  The quick brown fox jumps over the lazy dog. This paragraph text uses a relaxed
  line height for comfortable reading across multiple lines of content.
</Text>

Lead

Larger, muted text for introductions or subtitles:

A beautiful component library for React Native with web support.
<Text variant="lead">A beautiful component library for React Native with web support.</Text>

Large

Semibold larger text for emphasis:

Important notice
<Text variant="large">Important notice</Text>

Small

Compact, medium-weight text for fine print:

Small caption text
<Text variant="small">Small caption text</Text>

Muted

Subdued text for secondary or supporting information:

Last updated 3 days ago
<Text variant="muted">Last updated 3 days ago</Text>

Blockquote

Styled text for quotes with a left border and italic formatting:

"The best way to predict the future is to create it."
<Text variant="blockquote">
  "The best way to predict the future is to create it."
</Text>

Props API

TextProps

Extends React.ComponentPropsWithoutRef<typeof Text> and includes:

PropTypeDefaultDescription
variant'default' | 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'blockquote' | 'lead' | 'large' | 'small' | 'muted''default'The typographic style variant
classNamestring-Additional CSS classes for custom styling
childrenReact.ReactNode-The text content

Best Practices

  1. Use semantic variants: Choose variants that match the content's purpose — h1-h4 for headings, p for body text, muted for secondary info.

  2. Maintain hierarchy: Use heading variants in order (h1 > h2 > h3 > h4) to create a clear visual hierarchy.

  3. Consistent usage: Use the same variant for the same type of content throughout your app.

  4. Accessibility: Heading variants don't automatically set accessibility roles on native — consider adding accessibilityRole="header" when needed.

  5. Don't nest Text: In React Native, nested Text components inherit styles. Use a single Text with the appropriate variant instead.

  • Use Typography (H1-H5, P) for components with built-in accessibility roles
  • Combine with Label for form field labels
  • Pair with Badge for labeled content

On this page