Reference
Paragraph
Block of text with paragraph spacing.
Paragraph(_ content: String or Number or Bool, tone: Enum, size: Enum, align: Enum, …)
Before 5.0
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
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
| Prop | Type | Unset | Meaning |
|---|---|---|---|
content | String or Number or Bool (positional) | none | The text, a |
tone: | one of its cases | none: the text's colour | Its colour, a tone of the theme. Written as a flag,
|
size: | one of its cases |
| Its font size. Written as a flag,
|
align: | one of its cases | none: the start, as inherited | Where its lines sit. Written as a flag,
|
transform: | one of its cases | none | The case its letters are drawn in. Written as a flag,
|
kind: | one of its cases | none | A typographic role. Written as a flag,
|
bold: | Bool | false | Bold. Written as a flag, |
italic: | Bool | false | Italic. Written as a flag, |
underline: | Bool | false | Underlined. Written as a flag, |
muted: | Bool | false | In |
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.
Codes this can raise
These controls list the props' cases; the example below shows them written.