Typography
عرض شاملimport { Typography, TypographyGroup, TypographySpec, TypographyVariant } from '@nili/ui';هذه صفحة العرض الشامل الخاصة بالمكتبة، معروضة حيّة. غيّر اللغة أو السمة من الأعلى وسَتتبعك.
Inter Display · العناوين
6 تنويعة. يُختار العنصر من التنويعة نفسها — فـh1 يرسم <h1> وparagraph-* يرسم <p> — فيبقى مخطّط المستند سليمًا دون سؤال.
الثعلب البنّي السريع يقفز
- التنويعة
- h1
- الحجم
- 56/64
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- h2
- الحجم
- 48/56
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- h3
- الحجم
- 40/48
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- h4
- الحجم
- 32/40
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- h5
- الحجم
- 24/32
- الوزن
- 500
- تباعد الأحرف
- 0px
الثعلب البنّي السريع يقفز
- التنويعة
- h6
- الحجم
- 20/28
- الوزن
- 500
- تباعد الأحرف
- 0px
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
<Typography variant="h1">The quick brown fox</Typography>
<Typography variant="h2">The quick brown fox</Typography>
<Typography variant="h3">The quick brown fox</Typography>
<Typography variant="h4">The quick brown fox</Typography>
<Typography variant="h5">The quick brown fox</Typography>
<Typography variant="h6">The quick brown fox</Typography>
</>
)
}Inter · التسميات
5 تنويعة. يُختار العنصر من التنويعة نفسها — فـh1 يرسم <h1> وparagraph-* يرسم <p> — فيبقى مخطّط المستند سليمًا دون سؤال.
الثعلب البنّي السريع يقفز
- التنويعة
- label-xlarge
- الحجم
- 24/32
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- label-large
- الحجم
- 18/28
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- label-medium
- الحجم
- 16/24
- الوزن
- 500
- تباعد الأحرف
- 0px
الثعلب البنّي السريع يقفز
- التنويعة
- label-small
- الحجم
- 14/20
- الوزن
- 500
- تباعد الأحرف
- 0px
الثعلب البنّي السريع يقفز
- التنويعة
- label-xsmall
- الحجم
- 12/16
- الوزن
- 500
- تباعد الأحرف
- 0px
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
<Typography variant="label-xlarge">The quick brown fox</Typography>
<Typography variant="label-large">The quick brown fox</Typography>
<Typography variant="label-medium">The quick brown fox</Typography>
<Typography variant="label-small">The quick brown fox</Typography>
<Typography variant="label-xsmall">The quick brown fox</Typography>
</>
)
}Inter · الفقرات
5 تنويعة. يُختار العنصر من التنويعة نفسها — فـh1 يرسم <h1> وparagraph-* يرسم <p> — فيبقى مخطّط المستند سليمًا دون سؤال.
الثعلب البنّي السريع يقفز
- التنويعة
- paragraph-xlarge
- الحجم
- 24/32
- الوزن
- 400
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- paragraph-large
- الحجم
- 18/28
- الوزن
- 400
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- paragraph-medium
- الحجم
- 16/24
- الوزن
- 400
- تباعد الأحرف
- 0px
الثعلب البنّي السريع يقفز
- التنويعة
- paragraph-small
- الحجم
- 14/20
- الوزن
- 400
- تباعد الأحرف
- 0px
الثعلب البنّي السريع يقفز
- التنويعة
- paragraph-xsmall
- الحجم
- 12/16
- الوزن
- 400
- تباعد الأحرف
- 0px
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
<Typography variant="paragraph-xlarge">The quick brown fox</Typography>
<Typography variant="paragraph-large">The quick brown fox</Typography>
<Typography variant="paragraph-medium">The quick brown fox</Typography>
<Typography variant="paragraph-small">The quick brown fox</Typography>
<Typography variant="paragraph-xsmall">The quick brown fox</Typography>
</>
)
}Inter · العناوين الفرعية
4 تنويعة. يُختار العنصر من التنويعة نفسها — فـh1 يرسم <h1> وparagraph-* يرسم <p> — فيبقى مخطّط المستند سليمًا دون سؤال.
الثعلب البنّي السريع
- التنويعة
- subheading-medium
- الحجم
- 16/24
- الوزن
- 500
- تباعد الأحرف
- 0.8px
الثعلب البنّي السريع
- التنويعة
- subheading-small
- الحجم
- 14/20
- الوزن
- 500
- تباعد الأحرف
- 0.8px
الثعلب البنّي السريع
- التنويعة
- subheading-xsmall
- الحجم
- 12/16
- الوزن
- 500
- تباعد الأحرف
- 0.4px
الثعلب البنّي السريع
- التنويعة
- subheading-2xsmall
- الحجم
- 11/12
- الوزن
- 500
- تباعد الأحرف
- 0.4px
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
<Typography variant="subheading-medium">The quick brown fox</Typography>
<Typography variant="subheading-small">The quick brown fox</Typography>
<Typography variant="subheading-xsmall">The quick brown fox</Typography>
<Typography variant="subheading-2xsmall">The quick brown fox</Typography>
</>
)
}Inter · المتن
3 تنويعة. يُختار العنصر من التنويعة نفسها — فـh1 يرسم <h1> وparagraph-* يرسم <p> — فيبقى مخطّط المستند سليمًا دون سؤال.
الثعلب البنّي السريع يقفز
- التنويعة
- body-large
- الحجم
- 18/32
- الوزن
- 400
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- body-medium
- الحجم
- 16/28
- الوزن
- 400
- تباعد الأحرف
- 0px
الثعلب البنّي السريع يقفز
- التنويعة
- body-small
- الحجم
- 14/24
- الوزن
- 400
- تباعد الأحرف
- 0px
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
<Typography variant="body-large">The quick brown fox</Typography>
<Typography variant="body-medium">The quick brown fox</Typography>
<Typography variant="body-small">The quick brown fox</Typography>
</>
)
}Inter · التوثيق
2 تنويعة. يُختار العنصر من التنويعة نفسها — فـh1 يرسم <h1> وparagraph-* يرسم <p> — فيبقى مخطّط المستند سليمًا دون سؤال.
الثعلب البنّي السريع يقفز
- التنويعة
- docs-label
- الحجم
- 18/32
- الوزن
- 500
- تباعد الأحرف
- -0.4px
الثعلب البنّي السريع يقفز
- التنويعة
- docs-paragraph
- الحجم
- 18/32
- الوزن
- 400
- تباعد الأحرف
- -0.4px
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
<Typography variant="docs-label">The quick brown fox</Typography>
<Typography variant="docs-paragraph">The quick brown fox</Typography>
</>
)
}تغيير العنصر
استخدم as حين يختلف الوزن البصري عن المعنى الدلالي — عنوان قسم يجب ألا يكون <h1>، أو تسمية تُرسم على <span>.
import { Typography } from "@nili/ui"
export function Example() {
return (
<>
{/* Looks like H3, but is a section heading */}
<Typography variant="h3" as="h2">Section title</Typography>
{/* Label styling on an inline element */}
<Typography variant="label-small" as="span">Inline label</Typography>
{/* Any element, including a link */}
<Typography variant="paragraph-small" as="a" href="#">
Read the guidelines
</Typography>
</>
)
}Typography
extends TypographyVariantProps
محاور التنويع — من تعريف cva للمكوّن
| الخاصيّة | النوع | الافتراضي | ملاحظات |
|---|---|---|---|
| variant | h1 | h2 | h3 | h4 | h5 | h6 | label-xlarge | label-large | label-medium | label-small | label-xsmall | paragraph-xlarge | paragraph-large | paragraph-medium | paragraph-small | paragraph-xsmall | subheading-medium | subheading-small | subheading-xsmall | subheading-2xsmall | body-large | body-medium | body-small | docs-label | docs-paragraph | paragraph-medium |
باقي الخصائص
| الخاصيّة | النوع | الافتراضي | ملاحظات |
|---|---|---|---|
| children | ReactNode | — | |
| as | ElementType | — | Override the rendered element. Defaults to a semantically sensible tag for the variant (`h1` renders `<h1>`, `paragraph-*` renders `<p>`) so document outline and screen-reader navigation stay correct by default. |
| className | string | — |