Typography
Typography 컴포넌트는 애플리케이션 전체에 표준화된 텍스트 스타일을 제공합니다.
사용 시기
- 기사/블로그/노트에서 제목이나 단락 내용을 표시해야 할 때.
- 복사 가능/편집 가능/줄임말 텍스트가 필요할 때.
사용 예
타이틀 컴포넌트
다른 레벨의 타이틀을 표시합니다.
H1 Heading
H2 Heading
H3 Heading
---
import Typography from '@/components/general/Typography.astro';
---
<Typography as="h1" variant="h1">H1 Heading</Typography>
<Typography as="h2" variant="h2">H2 Heading</Typography>
<Typography as="h3" variant="h3">H3 Heading</Typography> 텍스트 컴포넌트
다양한 유형의 텍스트를 제공합니다.
Most fonts have a particular weight which corresponds to one of the numbers in Common weight name mapping. However some fonts, called variable fonts, can support a range of weights with a more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight.
Most fonts have a particular weight which corresponds to one of the numbers in Common weight name mapping. However some fonts, called variable fonts, can support a range of weights with a more or less fine granularity.
Most fonts have a particular weight which corresponds to one of the numbers in Common weight name mapping.
Most fonts have a particular weight which corresponds to one of the numbers in Common weight name mapping.
---
import Typography from '@/components/general/Typography.astro';
---
<Typography as="p" variant="body">Body text...</Typography>
<Typography as="p" variant="body-heavy">Bold body text...</Typography>
<Typography as="p" variant="body-small">Small body text...</Typography>
<Typography as="p" variant="body-small-heavy">Small bold body text...</Typography> 다형성
as의 시각적 스타일을 유지하면서 유효한 HTML 요소로 컴포넌트를 렌더링하기 위해 variant 속성을 사용할 수 있습니다.
---
import Typography from '@/components/general/Typography.astro';
---
<Typography as="span" variant="h1">Span looking like H1</Typography> API
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| as | 렌더링할 HTML 요소 또는 컴포넌트. | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'a' | 'div' | 'p' |
| variant | 타이포그래피의 시각적 스타일 변형. | 'h1' | 'h2' | 'h3' | 'body' | 'body-heavy' | 'body-small' | 'body-small-heavy' | 'body' |
| class | 적용할 추가 CSS 클래스. | string | - |