Text

Text with paired font sizes and line heights.

Deployment completeYour changes are live on arene.style.Updated just now
import { Text } from "@/components/ui/text"
import { VStack } from "@/components/ui/stack"

export default function TextDemo() {
  return (
    <VStack gap={3}>
      <Text weight="medium">Deployment complete</Text>
      <Text tone="muted">Your changes are live on arene.style.</Text>
      <Text size="xs" tone="muted">
        Updated just now
      </Text>
    </VStack>
  )
}

Installation

pnpm dlx shadcn@latest add @arene/text

Needs the arene setup first.

Usage

import { Text } from "@/components/ui/text"
<Text tone="muted">Changes are saved automatically.</Text>

Unset size, tone and weight inherit. textStyles exports sizes, tones and weights for use in another element's stylex.props() call.

Size

Each size includes its line height. Leave size unset to inherit.

Updated just nowChanges are saved automatically.Read the project overview.Build something useful.Your next projectStart buildingMade for the web
import { Text } from "@/components/ui/text"
import { VStack } from "@/components/ui/stack"

export default function TextSize() {
  return (
    <VStack gap={3}>
      <Text size="xs">Updated just now</Text>
      <Text size="sm">Changes are saved automatically.</Text>
      <Text size="base">Read the project overview.</Text>
      <Text size="lg">Build something useful.</Text>
      <Text size="xl2">Your next project</Text>
      <Text size="xl3">Start building</Text>
      <Text size="xl4">Made for the web</Text>
    </VStack>
  )
}

Tone

Leave tone unset to inherit the surrounding color.

Deployment completeLast updated just now
import { Text } from "@/components/ui/text"
import { VStack } from "@/components/ui/stack"

export default function TextTone() {
  return (
    <VStack gap={3}>
      <Text>Deployment complete</Text>
      <Text tone="muted">Last updated just now</Text>
    </VStack>
  )
}

Weight

Leave weight unset to inherit the surrounding weight.

Normal textMedium textSemibold textBold text
import { Text } from "@/components/ui/text"
import { VStack } from "@/components/ui/stack"

export default function TextWeight() {
  return (
    <VStack gap={3}>
      <Text weight="normal">Normal text</Text>
      <Text weight="medium">Medium text</Text>
      <Text weight="semibold">Semibold text</Text>
      <Text weight="bold">Bold text</Text>
    </VStack>
  )
}

Composition

Pass render to choose a semantic element. Put its props on that element.

Changes are saved automatically.

import { Text } from "@/components/ui/text"

export default function TextRender() {
  return (
    <Text render={<p />} tone="muted">
      Changes are saved automatically.
    </Text>
  )
}

API reference

See Base UI's useRender reference for composition props. Native element props are forwarded.

PropTypeDefault
sizekeyof typeof textStyles.sizesNone
tone"muted"None
weight"normal" | "medium" | "semibold" | "bold"None
renderuseRender.RenderPropNative element
xstyleStyleXStylesNone
classNamestringNone
styleCSSPropertiesNone

Data attributes

AttributeOnEffect
data-slot="text"rootIdentifies the component
data-sizerootMirrors size