Reference

Paragraph

Block of text with paragraph spacing.

Paragraph(_ content: String or Number or Bool, tone: Enum, size: Enum, align: Enum, …)

Before 5.0

PDF

tone

primary

secondary

success

danger

warning

size

sm

md

lg

align

left

center

right

transform

uppercase

lowercase

kind

heading

subtitle

bold

No preview for this one: the example below shows how it is written.

Example

wf

Document(title: "Q3 report") { Heading("Summary").h1 Paragraph("Revenue grew 15% on the quarter, led by the new self-serve plan.") Paragraph("Churn held at 2.1%; support response times halved.").muted Paragraph("Figures are unaudited.").sm.italic }

Props

Props of Paragraph
PropTypeUnsetMeaning

content

String or Number or Bool (positional)

none

The text, a <p>: a string, a number or a boolean

tone:

one of its cases

none: the text's colour

Its colour, a tone of the theme. Written as a flag, .primary, or by name, tone: .primary.

  • .primary: The theme's primary colour
  • .secondary: The theme's secondary colour
  • .success: Green: done, healthy
  • .danger: Red: destructive, failed
  • .warning: Amber: needs attention
  • .info: Blue: a neutral notice

size:

one of its cases

md

Its font size. Written as a flag, .sm, or by name, size: .sm.

  • .sm: font-size-sm, 0.875rem
  • .md (the default): The size it inherits (the default)
  • .lg: font-size-lg, about 1.125–1.25rem

align:

one of its cases

none: the start, as inherited

Where its lines sit. Written as a flag, .left, or by name, align: .left.

  • .left: To the start of the line (text-align: start; the right in a right-to-left page)
  • .center: Centred
  • .right: To the end of the line (text-align: end; the left in a right-to-left page)

transform:

one of its cases

none

The case its letters are drawn in. Written as a flag, .uppercase, or by name, transform: .uppercase.

  • .uppercase: ALL CAPS
  • .lowercase: all lower case

kind:

one of its cases

none

A typographic role. Written as a flag, .heading, or by name, kind: .heading.

  • .heading: Bold, at font-size-lg
  • .subtitle: Small (font-size-sm) and muted

bold:

Bool

false

Bold. Written as a flag, .bold, or bold: true.

italic:

Bool

false

Italic. Written as a flag, .italic, or italic: true.

underline:

Bool

false

Underlined. Written as a flag, .underline, or underline: true.

muted:

Bool

false

In color-text-muted. Written as a flag, .muted, or muted: true.

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

.primary

.secondary

.success

.danger

.warning

.info

.sm

.md

.lg

.left

.center

.right

.uppercase

.lowercase

.heading

.subtitle

.bold

.italic

.underline

.muted

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

It takes no slots.

Renders with the class wf-text, stable across releases, so a stylesheet may target it.

These controls list the props' cases; the example below shows them written.