Text
Primer의 타이포그래피 스타일을 추상화해서 쓰는 컴포넌트입니다. 기본 요소(as)와 크기(size), 굵기(weight), 공백 처리(whiteSpace)를 지정해 Primer 디자인 토큰 기반의 타이포그래피를 손쉽게 적용할 수 있어요.
출처: 문서
본문
Text는 Primer의 타이포그래피 스타일을 사용하기 위한 추상화입니다.
예시 — 크기와 굵기 바꾸기 (Example - changing size and weight)
이 예시는 @primer/react가 size와 weight props를 지원하는 버전으로 업그레이드될 때까지는 동작하지 않습니다.
<span>
This example will not work until we have upgrade `@primer/react` to a version that supports the `size` and `weight`
props
</span>
Props
Text
| Name | Default | Description |
|---|---|---|
| as | 'span' |
React.ElementType — 렌더링할 요소 타입입니다. |
| size | — | 'large' | 'medium' | 'small' — 텍스트 크기입니다. |
| weight | — | 'light' | 'normal' | 'medium' | 'semibold' — 텍스트 굵기입니다. |
| whiteSpace | — | 'pre' | 'normal' | 'nowrap' | 'pre-wrap' | 'pre-line' — 공백 처리 방식입니다. |