Lynx

Text

Text component is a component that renders text by applying Crispy typography tokens in Lynx.

Installation

npm install @seed-design/lynx-react @seed-design/lynx-css

Usage

import { Text } from "@seed-design/lynx-react";

export function App() {
  return (
    <Text textStyle="t5Regular" color="fg.neutral">
      Default text
    </Text>
  );
}

Text renders Lynx native <text>. textStyle applies the Crispy typography token corresponding to Figma Text Style at once.

In Lynx, text must always be inside a <text> element. Text does not hide this constraint and renders the native text element directly suited for Lynx.

Props

Prop

Type

color?ScopedColorFg | ScopedColorPalette | (string & {}) | undefined
fontSize?(string & {}) | "t1" | "t2" | "t3" | "t4" | "t5" | "t6" | "t7" | "t8" | "t9" | "t10" | "t11" | "t12" | "t13" | "t14" | "t1Static" | "t2Static" | "t3Static" | "t4Static" | "t5Static" | "t6Static" | "t7Static" | "t8Static" | "t9Static" | "t10Static" | "t11Static" | "t12Static" | "t13Static" | "t14Static" | undefined
lineHeight?(string & {}) | "t1" | "t2" | "t3" | "t4" | "t5" | "t6" | "t7" | "t8" | "t9" | "t10" | "t11" | "t12" | "t13" | "t14" | "t1Static" | "t2Static" | "t3Static" | "t4Static" | "t5Static" | "t6Static" | "t7Static" | "t8Static" | "t9Static" | "t10Static" | "t11Static" | "t12Static" | "t13Static" | "t14Static" | undefined
fontWeight?"regular" | "medium" | "bold" | undefined
textStyle?TextStyle | undefined
align?"left" | "center" | "right" | undefined
style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

Text Styles

<Text textStyle="screenTitle" color="fg.neutral">
  screenTitle
</Text>

<Text textStyle="t5Bold" color="fg.critical">
  t5Bold
</Text>

If more specific adjustment is needed, you can use fontSize, lineHeight, fontWeight, and align.

<Text fontSize="t7" lineHeight="t7" fontWeight="bold" align="center">
  Directly specified typography values
</Text>

If you specify only fontSize and omit lineHeight, the line-height token of the same level is also used.

Differences from Web Version

Lynx Text has the following differences from React Text:

  • Does not support as or asChild. Always renders Lynx native <text>.
  • maxLines, whiteSpace, userSelect, and textDecorationLine are not yet provided.
  • Does not use the web .seed-text pattern that relies on CSS inherit. Instead, applies color, fontSize, lineHeight, fontWeight, and textAlign directly as object styles.

Table of contents