nili/ui
همه‌ی کامپوننت‌ها

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>
    </>
  )
}