suiss/ui
  • Docs
  • Components
  • Patterns
  • Interactions
  • Charts
  • Blocks
  • AI
GitHubCreate
DocsComponentsPatternsInteractionsChartsBlocksAICreate
Components84
  • Overview
  • Accordion
  • Alert
  • Alert Dialog
  • Alert Sheet
  • Amount Input
  • Aspect Ratio
  • Attachment
  • Avatar
  • Badge
  • Bottom Bar
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Chip
  • Code Block
  • Collapsible
  • Combobox
  • Command
  • Context Menu
  • Dialog
  • Direction
  • Drawer
  • Dropdown Menu
  • Empty
  • FAB
  • Field
  • Fullscreen Menu
  • Haptics
  • Header
  • Hover Card
  • Icon
  • Input
  • Input Accessory Bar
  • Input Group
  • Input OTP
  • Item
  • Kbd
  • Keyboard Scroll View
  • Keypad
  • Label
  • Marker
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Page Indicator
  • Pagination
  • Pin Pad
  • Popover
  • Progress
  • QR Scanner
  • Questionnaire
  • Radio Group
  • Resizable
  • Screen
  • Scroll Area
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature Pad
  • Skeleton
  • Slider
  • Spinner
  • Switch
  • Tab Bar
  • Table
  • Tabs
  • Text
  • Textarea
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Trace
  • Wheel Picker
  • Widget

suiss/ui · Component

Text

Styled text with typography variants for headings, body copy, quotes, code and captions.

Text is an open-source component from suiss/ui for React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.

React Native
Text demo in React Native, light modeText demo in React Native, dark mode
import { Text } from "@/components/ui/text"

export default function TextDemo() {
  return <Text>The quick brown fox jumps over the lazy dog.</Text>
}
import SwiftUI

struct TextExample: View {
  var body: some View {
    Text("The quick brown fox jumps over the lazy dog.")
      .textVariant(.default)
  }
}
import androidx.compose.runtime.Composable
import com.esuiss.ui.components.Text

@Composable
fun TextExample() {
    Text("The quick brown fox jumps over the lazy dog.")
}

Text renders a React Native Text with one of twelve typography variants: default, h1–h4, p, blockquote, code, lead, large, small and muted. Heading variants also set the heading role.

It reads TextClassContext, so components such as Button can pass a text color and size down to any Text inside them.

Installation

$ pnpm dlx shadcn@latest add @esuiss/text

See Installation for the components.json setup. Or use the suiss/ui CLI:

$ pnpm dlx @esuiss/ui@latest add text
$ pnpm dlx shadcn@latest add @esuiss/text

See Installation for the components.json setup. Or use the suiss/ui CLI:

$ pnpm dlx @esuiss/ui@latest add text --platform swift
$ pnpm dlx shadcn@latest add @esuiss/text

See Installation for the components.json setup. Or use the suiss/ui CLI:

$ pnpm dlx @esuiss/ui@latest add text --platform kotlin
  1. Install the following dependencies:
npx expo install class-variance-authority cn
  1. Copy the primitives it uses into components/primitives:
uniwind/components/primitives/font.ts
type Fonts = { sans?: string; heading?: string }

const fonts: Fonts = {}

function fontFamily(heading = false) {
  const family = heading ? (fonts.heading ?? fonts.sans) : fonts.sans
  return family ? { fontFamily: family } : undefined
}

export { fontFamily, fonts }
uniwind/components/primitives/hooks.ts
import * as React from "react"
import { BackHandler } from "react-native"

function useEffectEvent<TArgs extends readonly unknown[], TResult>(
  callback: (...args: TArgs) => TResult
): (...args: TArgs) => TResult {
  const callbackRef = React.useRef(callback)

  React.useLayoutEffect(() => {
    callbackRef.current = callback
  })

  return React.useCallback(
    (...args: TArgs): TResult => callbackRef.current(...args),
    []
  )
uniwind/components/primitives/merge-props.ts
type AnyProps = Record<string, unknown>

type PropsGetter = (previous: AnyProps) => object

type MergePropsInput = object | PropsGetter | null | undefined

type Handler = (...args: unknown[]) => unknown

type StyleCallback = (state: never) => unknown

const EMPTY_PROPS: AnyProps = {}

function isEventHandler(key: string, value: unknown) {
  const code0 = key.charCodeAt(0)
  const code1 = key.charCodeAt(1)
  const code2 = key.charCodeAt(2)
uniwind/components/primitives/types.ts
import type * as React from "react"
import type {
  GestureResponderEvent,
  HostInstance,
  NativeSyntheticEvent,
  StyleProp,
  ViewStyle,
} from "react-native"

type Side = "top" | "bottom" | "left" | "right"
type Align = "start" | "center" | "end"
type Orientation = "horizontal" | "vertical"

type ComponentRenderFn<Props, State> = (
  props: Props,
  state: State
uniwind/components/primitives/use-render.tsx
import * as React from "react"
import { useComposedRefs } from "./hooks"
import { mergeClassNames, mergeProps, mergeStyles } from "./merge-props"
import type { ClassNameProp, RenderProp, StyleValue } from "./types"

type AnyProps = Record<string, unknown>

type RefInput<T> = React.Ref<T> | undefined

interface UseRenderParameters<State, RefType = unknown, Props = AnyProps> {
  defaultComponent?: React.ElementType | undefined
  render?: RenderProp<Props, State> | undefined
  props?: object | readonly (object | null | undefined)[] | undefined
  state?: State | undefined
  ref?: RefInput<RefType> | readonly RefInput<RefType>[] | undefined
  className?: ClassNameProp<State>
  1. Copy and paste the following code into components/ui/text.tsx:
uniwind/components/ui/text.tsx
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
import * as React from "react"
import { Text as RNText, type Role } from "react-native"
import { fontFamily } from "@/components/primitives/font"
import type { RenderProp } from "@/components/primitives/types"
import { useRender } from "@/components/primitives/use-render"

const textVariants = cva("text-base text-foreground", {
  variants: {
    variant: {
      default: "",
      h1: "text-3xl font-bold",
      h2: "text-2xl font-bold",
      h3: "text-xl font-semibold",
      h4: "text-lg font-semibold",
  1. Update the import paths to match your project setup.
  1. Install the following dependencies:
npx expo install class-variance-authority cn
  1. Copy the primitives it uses into components/primitives:
nativewind/components/primitives/font.ts
type Fonts = { sans?: string; heading?: string }

const fonts: Fonts = {}

function fontFamily(heading = false) {
  const family = heading ? (fonts.heading ?? fonts.sans) : fonts.sans
  return family ? { fontFamily: family } : undefined
}

export { fontFamily, fonts }
nativewind/components/primitives/hooks.ts
import * as React from "react"
import { BackHandler } from "react-native"

function useEffectEvent<TArgs extends readonly unknown[], TResult>(
  callback: (...args: TArgs) => TResult
): (...args: TArgs) => TResult {
  const callbackRef = React.useRef(callback)

  React.useLayoutEffect(() => {
    callbackRef.current = callback
  })

  return React.useCallback(
    (...args: TArgs): TResult => callbackRef.current(...args),
    []
  )
nativewind/components/primitives/merge-props.ts
type AnyProps = Record<string, unknown>

type PropsGetter = (previous: AnyProps) => object

type MergePropsInput = object | PropsGetter | null | undefined

type Handler = (...args: unknown[]) => unknown

type StyleCallback = (state: never) => unknown

const EMPTY_PROPS: AnyProps = {}

function isEventHandler(key: string, value: unknown) {
  const code0 = key.charCodeAt(0)
  const code1 = key.charCodeAt(1)
  const code2 = key.charCodeAt(2)
nativewind/components/primitives/types.ts
import type * as React from "react"
import type {
  GestureResponderEvent,
  HostInstance,
  NativeSyntheticEvent,
  StyleProp,
  ViewStyle,
} from "react-native"

type Side = "top" | "bottom" | "left" | "right"
type Align = "start" | "center" | "end"
type Orientation = "horizontal" | "vertical"

type ComponentRenderFn<Props, State> = (
  props: Props,
  state: State
nativewind/components/primitives/use-render.tsx
import * as React from "react"
import { useComposedRefs } from "./hooks"
import { mergeClassNames, mergeProps, mergeStyles } from "./merge-props"
import type { ClassNameProp, RenderProp, StyleValue } from "./types"

type AnyProps = Record<string, unknown>

type RefInput<T> = React.Ref<T> | undefined

interface UseRenderParameters<State, RefType = unknown, Props = AnyProps> {
  defaultComponent?: React.ElementType | undefined
  render?: RenderProp<Props, State> | undefined
  props?: object | readonly (object | null | undefined)[] | undefined
  state?: State | undefined
  ref?: RefInput<RefType> | readonly RefInput<RefType>[] | undefined
  className?: ClassNameProp<State>
  1. Copy and paste the following code into components/ui/text.tsx:
nativewind/components/ui/text.tsx
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"
import * as React from "react"
import { Text as RNText, type Role } from "react-native"
import { fontFamily } from "@/components/primitives/font"
import type { RenderProp } from "@/components/primitives/types"
import { useRender } from "@/components/primitives/use-render"

const textVariants = cva("text-base text-foreground", {
  variants: {
    variant: {
      default: "",
      h1: "text-3xl font-bold",
      h2: "text-2xl font-bold",
      h3: "text-xl font-semibold",
      h4: "text-lg font-semibold",
  1. Update the import paths to match your project setup.
  1. Copy the primitives it uses into components/primitives:
stylesheet/components/primitives/font.ts
type Fonts = { sans?: string; heading?: string }

const fonts: Fonts = {}

function fontFamily(heading = false) {
  const family = heading ? (fonts.heading ?? fonts.sans) : fonts.sans
  return family ? { fontFamily: family } : undefined
}

export { fontFamily, fonts }
stylesheet/components/primitives/hooks.ts
import * as React from "react"
import { BackHandler } from "react-native"

function useEffectEvent<TArgs extends readonly unknown[], TResult>(
  callback: (...args: TArgs) => TResult
): (...args: TArgs) => TResult {
  const callbackRef = React.useRef(callback)

  React.useLayoutEffect(() => {
    callbackRef.current = callback
  })

  return React.useCallback(
    (...args: TArgs): TResult => callbackRef.current(...args),
    []
  )
stylesheet/components/primitives/merge-props.ts
type AnyProps = Record<string, unknown>

type PropsGetter = (previous: AnyProps) => object

type MergePropsInput = object | PropsGetter | null | undefined

type Handler = (...args: unknown[]) => unknown

type StyleCallback = (state: never) => unknown

const EMPTY_PROPS: AnyProps = {}

function isEventHandler(key: string, value: unknown) {
  const code0 = key.charCodeAt(0)
  const code1 = key.charCodeAt(1)
  const code2 = key.charCodeAt(2)
stylesheet/components/primitives/types.ts
import type * as React from "react"
import type {
  GestureResponderEvent,
  HostInstance,
  NativeSyntheticEvent,
  StyleProp,
  ViewStyle,
} from "react-native"

type Side = "top" | "bottom" | "left" | "right"
type Align = "start" | "center" | "end"
type Orientation = "horizontal" | "vertical"

type ComponentRenderFn<Props, State> = (
  props: Props,
  state: State
stylesheet/components/primitives/use-render.tsx
import * as React from "react"
import { useComposedRefs } from "./hooks"
import { mergeClassNames, mergeProps, mergeStyles } from "./merge-props"
import type { ClassNameProp, RenderProp, StyleValue } from "./types"

type AnyProps = Record<string, unknown>

type RefInput<T> = React.Ref<T> | undefined

interface UseRenderParameters<State, RefType = unknown, Props = AnyProps> {
  defaultComponent?: React.ElementType | undefined
  render?: RenderProp<Props, State> | undefined
  props?: object | readonly (object | null | undefined)[] | undefined
  state?: State | undefined
  ref?: RefInput<RefType> | readonly RefInput<RefType>[] | undefined
  className?: ClassNameProp<State>
  1. Copy and paste the following code into components/ui/text.tsx:
stylesheet/components/ui/text.tsx
import * as React from "react"
import {
  Platform,
  Text as RNText,
  type Role,
  StyleSheet,
  type TextStyle,
} from "react-native"
import { fontFamily } from "@/components/primitives/font"
import type { RenderProp } from "@/components/primitives/types"
import { useRender } from "@/components/primitives/use-render"
import {
  fontSize,
  radius,
  type ThemeColors,
  useTheme,
  1. Update the import paths to match your project setup.
  1. Target iOS 17 or later.

  2. Copy the theme files every view uses:

swift/Theme/Theme.swift
import CoreText
import SwiftUI
import UIKit

struct RGBA: Sendable {
  let red: CGFloat
  let green: CGFloat
  let blue: CGFloat
  let alpha: CGFloat

  init(_ hex: UInt32, _ alpha: CGFloat = 1) {
    red = CGFloat((hex >> 16) & 0xFF) / 255
    green = CGFloat((hex >> 8) & 0xFF) / 255
    blue = CGFloat(hex & 0xFF) / 255
    self.alpha = alpha
  }
swift/Theme/Tokens.swift
import SwiftUI

public enum EsuissColor {
  public static let background = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x000000))
  public static let foreground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let card = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x1D1D1F))
  public static let cardForeground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let popover = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x1D1D1F))
  public static let popoverForeground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let primary = Color.adaptive(light: .init(0x0071E3), dark: .init(0x0A84FF))
  public static let primaryForeground = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0xFFFFFF))
  public static let secondary = Color.adaptive(light: .init(0x000000, 0.04), dark: .init(0xFFFFFF, 0.1))
  public static let secondaryForeground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let muted = Color.adaptive(light: .init(0xF5F5F7), dark: .init(0x161617))
  public static let mutedForeground = Color.adaptive(light: .init(0x6E6E73), dark: .init(0x86868B))
  public static let accent = Color.adaptive(light: .init(0x000000, 0.06), dark: .init(0xFFFFFF, 0.1))
  1. Copy the source:
swift/Components/TextVariant.swift
import SwiftUI

public enum TextVariant: CaseIterable, Sendable {
  case `default`, h1, h2, h3, h4, p, blockquote, code, lead, large, small, muted

  var style: TextStyle {
    switch self {
    case .h1: .xl3
    case .h2: .xl2
    case .h3: .xl
    case .h4, .lead, .large: .lg
    case .code, .small, .muted: .sm
    default: .base
    }
  }
  1. Add the files to your app target.
  1. Apply the Compose compiler plugin, enable Compose, set compileSdk to 37 or higher and minSdk to 24 or higher, and add the dependencies:
build.gradle.kts
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
  1. Copy the theme files every view uses:
kotlin/theme/Theme.kt
package com.esuiss.ui.theme

import android.content.res.AssetManager
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.dropShadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.shadow.Shadow as DropShadow
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
kotlin/theme/Tokens.kt
package com.esuiss.ui.theme

import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp

@Immutable
data class Colors(
    val background: Color,
    val foreground: Color,
    val card: Color,
    val cardForeground: Color,
    val popover: Color,
    val popoverForeground: Color,
    val primary: Color,
  1. Copy the source and every file it uses:
kotlin/components/Text.kt
package com.esuiss.ui.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.AnnotatedString
kotlin/components/Content.kt
package com.esuiss.ui.components

import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

val LocalContentStyle = compositionLocalOf { TextStyle.Default }

val LocalContentColor = compositionLocalOf { Color.Unspecified }

val LocalIconSize = compositionLocalOf { 20.dp }
  1. Update the com.esuiss.ui package names to match your project.

Usage

import { Text } from "@/components/ui/text"
<Text>The quick brown fox jumps over the lazy dog.</Text>
import SwiftUI

struct TextExample: View {
  var body: some View {
    Text("The quick brown fox jumps over the lazy dog.")
      .textVariant(.default)
  }
}
import androidx.compose.runtime.Composable
import com.esuiss.ui.components.Text

@Composable
fun TextExample() {
    Text("The quick brown fox jumps over the lazy dog.")
}

Examples

Typography

Every variant in a sample article.

React Native
Text typography in React Native, light modeText typography in React Native, dark mode
import { View } from "react-native"
import { Text } from "@/components/ui/text"

export default function TextTypography() {
  return (
    <View className="gap-4">
      <Text variant="h1">Taxing Laughter</Text>
      <Text variant="h2">The People of the Kingdom</Text>
      <Text variant="h3">The Joke Tax</Text>
      <Text variant="h4">People stopped telling jokes</Text>
      <Text variant="p">
        The king, seeing how much happier his subjects were, realized the error
        of his ways and repealed the joke tax.
      </Text>
      <Text variant="blockquote">
        &quot;After all,&quot; he said, &quot;everyone enjoys a good joke, so
import { View } from "react-native"
import { Text } from "@/components/ui/text"

export default function TextTypography() {
  return (
    <View style={{ gap: 16 }}>
      <Text variant="h1">Taxing Laughter</Text>
      <Text variant="h2">The People of the Kingdom</Text>
      <Text variant="h3">The Joke Tax</Text>
      <Text variant="h4">People stopped telling jokes</Text>
      <Text variant="p">
        The king, seeing how much happier his subjects were, realized the error
        of his ways and repealed the joke tax.
      </Text>
      <Text variant="blockquote">
        &quot;After all,&quot; he said, &quot;everyone enjoys a good joke, so
import SwiftUI

struct TextTypographyExample: View {
  var body: some View {
    VStack(alignment: .leading, spacing: 16) {
      Text("Taxing Laughter").textVariant(.h1)
      Text("The People of the Kingdom").textVariant(.h2)
      Text("The Joke Tax").textVariant(.h3)
      Text("People stopped telling jokes").textVariant(.h4)
      Text("The king, seeing how much happier his subjects were, realized the error of his ways and repealed the joke tax.")
        .textVariant(.p)
      Text("\"After all,\" he said, \"everyone enjoys a good joke, so it's only fair that they should pay for the privilege.\"")
        .textVariant(.blockquote)
      Text(verbatim: "npx @esuiss/ui add text").textVariant(.code)
      Text("A modal dialog that interrupts the user with important content.").textVariant(.lead)
      Text("Are you absolutely sure?").textVariant(.large)
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun TextTypography() {
    Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
        Text("Taxing Laughter", variant = TextVariant.H1)
        Text("The People of the Kingdom", variant = TextVariant.H2)
        Text("The Joke Tax", variant = TextVariant.H3)
        Text("People stopped telling jokes", variant = TextVariant.H4)
        Text(

Headings

The four heading levels.

React Native
Text headings in React Native, light modeText headings in React Native, dark mode
import { View } from "react-native"
import { Text } from "@/components/ui/text"

export default function TextHeadings() {
  return (
    <View className="gap-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>
    </View>
  )
}
import { View } from "react-native"
import { Text } from "@/components/ui/text"

export default function TextHeadings() {
  return (
    <View style={{ gap: 16 }}>
      <Text variant="h1">Heading 1</Text>
      <Text variant="h2">Heading 2</Text>
      <Text variant="h3">Heading 3</Text>
      <Text variant="h4">Heading 4</Text>
    </View>
  )
}
import SwiftUI

struct TextHeadingsExample: View {
  var body: some View {
    VStack(alignment: .leading, spacing: 16) {
      Text("Heading 1").textVariant(.h1)
      Text("Heading 2").textVariant(.h2)
      Text("Heading 3").textVariant(.h3)
      Text("Heading 4").textVariant(.h4)
    }
    .frame(maxWidth: .infinity, alignment: .leading)
  }
}
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun TextHeadings() {
    Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
        Text("Heading 1", variant = TextVariant.H1)
        Text("Heading 2", variant = TextVariant.H2)
        Text("Heading 3", variant = TextVariant.H3)
        Text("Heading 4", variant = TextVariant.H4)
    }
}

Accessibility

  • h1 to h4 set role="heading", so VoiceOver and TalkBack can navigate by heading.
  • Text scales with the system font size.

API Reference

Text

The text element with typography variants.

PropTypeDefault
renderRenderProp<Record<string, unknown>, Record<string, never>>-
variant"default" | "h1" | "h2" | "h3" | "h4" | "p" | "blockquote" | "code" | "lead" | "large" | "small" | "muted""default"

Also accepts the props of TextProps.

Pick a variant for the role of the text, and add classes through className for one-off changes. Use render to render another component in place of the default Text, with the same props and classes. TextClassContext is exported so your own components can style nested Text the same way.

TextVariant

Values: .default, .h1, .h2, .h3, .h4, .p, .blockquote, .code, .lead, .large, .small, .muted.

.textVariant

ParameterTypeDefault
_ variantTextVariant: .default | .h1 | .h2 | .h3 | .h4 | .p | .blockquote | .code | .lead | .large | .small | .muted-

TextVariant

Values: Default, H1, H2, H3, H4, P, Blockquote, Code, Lead, Large, Small, Muted.

Text

The text element with typography variants.

ParameterTypeDefault
textString-
modifierModifierModifier
variantTextVariant: Default | H1 | H2 | H3 | H4 | P | Blockquote | Code | Lead | Large | Small | MutedTextVariant.Default
colorColorColor.Unspecified
textAlignTextAlignTextAlign.Unspecified
overflowTextOverflowTextOverflow.Clip
softWrapBooleantrue
maxLinesIntInt.MAX_VALUE
minLinesInt1
styleTextStyleTextStyle.Default
NextTextareaPreviousTabs

On this page

  1. 01Installation
  2. 02Usage
  3. 03Examples
    • Typography
    • Headings
  4. 04Accessibility
  5. 05API Reference
    • Text
    • TextVariant
    • .textVariant
    • TextVariant
    • Text