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 { Paragraph } from "@neshel-ui/typography";Usage
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.
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
| Prop | Type | Default | Description |
|---|---|---|---|
| align | Responsive<TextAlign> | — | Text alignment (logical: start/end). |
| as | E | — | — |
| asChild(required) | boolean | — | — |
| family | FontRole | — | Font role (Heading "display", Paragraph and Caption "body"; Text inherits). |
| leading | Responsive<TextLeading> | — | Unitless line height; defaults to the size's leading. Drives Capsize trimming. |
| measure | TextMeasure | — | Maximum line length: narrow 45ch, comfortable 65ch, wide 80ch. |
| ref | Ref<HTMLElement> | — | — |
| size | Responsive<TextSize> | — | Size token; font-size = token × the font role's cap-height scale. |
| tone | TextTone | — | Colour role paired with the background for contrast (Caption defaults to "muted"). |
| tracking | TextTracking | — | Letter spacing. |
| trim | boolean | true | Capsize trimming of the space above the cap height and below the baseline (default true). |
| truncate | boolean | — | One line with an ellipsis (clips overflow, so trimming is removed). |
| weight | Responsive<TextWeight> | — | Font weight; Heading defaults to "semibold". |
| wrap | TextWrap | — | 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
divor list inside<Paragraph>(ap): useas="div". - Setting
line-heightwith a utility class: useleadingso trimming stays exact.