Skip to Content
Neshel-UI
Typography

Paragraph

Body text with readable measure, leading and wrapping, trimmed with Capsize.

Purpose

Paragraph renders body text (p, or div when the content contains block elements) with the body font at size base.

Import

import.tsx
import { Paragraph } from "@neshel-ui/typography";

Usage

Preview: paragraph-measure
Preview theme

narrow (45ch) — Beautiful typography begins with precision: a readable line length, generous leading and a type scale that keeps its rhythm across breakpoints.

comfortable (65ch), relaxed leading, pretty wrapping — Beautiful typography begins with precision: a readable line length, generous leading and a type scale that keeps its rhythm across breakpoints.

truncate — Beautiful typography begins with precision: a readable line length, generous leading and a type scale that keeps its rhythm across breakpoints.

paragraph-measure.tsx
import { Stack } from "@neshel-ui/layout";
import { Paragraph } from "@neshel-ui/typography";

const text =
  "Beautiful typography begins with precision: a readable line length, generous leading and a type scale that keeps its rhythm across breakpoints.";

export default function ParagraphMeasure() {
  return (
    <Stack space="5">
      <Paragraph measure="narrow">narrow (45ch) — {text}</Paragraph>
      <Paragraph measure="comfortable" leading="relaxed" wrap="pretty">
        comfortable (65ch), relaxed leading, pretty wrapping — {text}
      </Paragraph>
      <Paragraph truncate className="max-w-sm" tone="muted">
        truncate — {text}
      </Paragraph>
    </Stack>
  );
}

API

ParagraphProps

ParagraphProps
PropTypeDefaultDescription
alignResponsive<TextAlign>—Text alignment (logical: start/end).
asE——
asChild(required)boolean——
familyFontRole—Font role (Heading "display", Paragraph and Caption "body"; Text inherits).
leadingResponsive<TextLeading>—Unitless line height; defaults to the size's leading. Drives Capsize trimming.
measureTextMeasure—Maximum line length: narrow 45ch, comfortable 65ch, wide 80ch.
refRef<HTMLElement>——
sizeResponsive<TextSize>—Size token; font-size = token × the font role's cap-height scale.
toneTextTone—Colour role paired with the background for contrast (Caption defaults to "muted").
trackingTextTracking—Letter spacing.
trimbooleantrueCapsize trimming of the space above the cap height and below the baseline (default true).
truncateboolean—One line with an ellipsis (clips overflow, so trimming is removed).
weightResponsive<TextWeight>—Font weight; Heading defaults to "semibold".
wrapTextWrap—Line wrapping strategy (balance suits headings, pretty paragraphs).

Also accepts the props of: React DOM attributes.

ParagraphElement

type ParagraphElement = "p" | "div"

Accessibility

Use measure (comfortable ≈ 65 characters) for long text; long lines are harder to read. Avoid truncate on essential information — truncated text is only fully available to sighted users through other means.

Common mistakes

  • Putting a div or list inside <Paragraph> (a p): use as="div".
  • Setting line-height with a utility class: use leading so trimming stays exact.
Edit on GitHub

On this page