Перейти до вмісту

Типографіка

Універсальні шаблони для заголовків, основного тексту, списків, таблиць та вбудованого коду — оформлені у стилі «необруталізм» з масивним виглядом.

Ми не постачаємо жодних типографічних стилів за замовчуванням. Ця сторінка — приклад того, як за допомогою службових класів оформити текст.

Окремого компонента typography для встановлення немає — за замовчуванням нічого не постачається. Кожен розділ нижче — copy-paste рецепт utility-класів для звичайного HTML-елемента (h1h4, p, blockquote, table, списки, inline code), що спирається на токени теми, тож заголовки виходять важкими, а рамки — товстими.

Коли це стане в пригоді:

  • Блог-пости та docs — мапіть MDX або CMS-вивід на ці класи для узгодженої довгої верстки.
  • Маркетингові сторінкиh1, Lead і Large покривають hero-текст без окремої display-системи.
  • Коли @tailwindcss/typography — overkill — скопіюйте лише потрібні елементи замість prose-плагіна.

h1

Taxing Laughter: The Joke Tax Chronicles

export function TypographyH1() {
  return (
    <h1 className="scroll-m-20 text-center text-4xl font-extrabold tracking-tight text-balance">

h2

The People of the Kingdom

export function TypographyH2() {
  return (
    <h2 className="scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0">

h3

The Joke Tax

export function TypographyH3() {
  return (
    <h3 className="scroll-m-20 text-2xl font-semibold tracking-tight">

h4

People stopped telling jokes

export function TypographyH4() {
  return (
    <h4 className="scroll-m-20 text-xl font-semibold tracking-tight">

p

The king, seeing how much happier his subjects were, realized the error of his ways and repealed the joke tax.

export function TypographyP() {
  return (
    <p className="leading-7 [&:not(:first-child)]:mt-6">

blockquote

"After all," he said, "everyone enjoys a good joke, so it's only fair that they should pay for the privilege."
export function TypographyBlockquote() {
  return (
    <blockquote className="mt-6 border-l-2 pl-6 italic">

table

export function TypographyTable() {
  return (
    <div className="my-6 w-full overflow-y-auto">

list

  • 1st level of puns: 5 gold coins
  • 2nd level of jokes: 10 gold coins
  • 3rd level of one-liners : 20 gold coins
export function TypographyList() {
  return (
    <ul className="my-6 ml-6 list-disc [&>li]:mt-2">

Рядковий код

@radix-ui/react-alert-dialog
export function TypographyInlineCode() {
  return (
    <code className="relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold">

Лід

A modal dialog that interrupts the user with important content and expects a response.

export function TypographyLead() {
  return (
    <p className="text-xl text-muted-foreground">

Великий

Are you absolutely sure?
export function TypographyLarge() {
  return <div className="text-lg font-semibold">Are you absolutely sure?</div>
}

Малий

Email address
export function TypographySmall() {
  return (
    <small className="text-sm leading-none font-medium">Email address</small>

Приглушений

Enter your email address.

export function TypographyMuted() {
  return (
    <p className="text-sm text-muted-foreground">Enter your email address.</p>

RTL

Щоб увімкнути підтримку RTL у Neobrutalism, перегляньте посібник із налаштування RTL.

"use client"

import * as React from "react"

Доступність

Ці рецепти стилізують нативні елементи, тож семантика вже коректна — так і лишайте. Рівні заголовків обирайте за структурою документа, а не за розміром: програми зчитування з екрана навігують за рівнем, тож якщо h2 виглядає завеликим, перестилізуйте його, а не беріть h4. Давайте таблицям даних рядок заголовків <th>, щоб клітинки лишалися пов’язаними з колонками, а blockquote резервуйте для справжніх цитат.