Reference
Callout
A note set apart from the text around it — .note, .tip, .important, .warning, .caution — with an icon and a title, as GitHub's alerts are. Its text is the positional, in Markdown (code, **bold**, a link), or its block.
Callout(_ text: String, kind: Enum, title: String) { … }
Since 6.2.0
text
kind
title
Run wf check before you push: every finding has a code, and a page that says how to fix it.
Example
Callout("Run `wf check` before you push: every finding has a **code**, and [a page](/errors) that says how to fix it.", title: "Before you push").tip
A block below its text
Callout("Every finding has a code.").note {
Link("Read about the checks", to: "/errors")
}
Every kind
Stack(gap: .sm) {
Callout("Drafts are kept for 30 days.").note
Callout("Press mod+k to search.").tip
Callout("A route change drops a route store.").important
Callout("The key is shown only once.").warning
Callout("Deleting a project deletes its builds.").caution
}
A title of your own
Callout.warning {
Callout.Title { Text("Rotating keys") Badge("Beta").info }
Text("The old key keeps working for an hour.")
}
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
text | String (positional) | none | What it says, as Markdown: a |
kind: | one of its cases |
| What kind of note it is: its colour, its icon and its title's word. Written as a flag,
|
title: | String | the kind's word: | The words of its title row, after the kind's icon; a |
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.
.note
.tip
.important
.warning
.caution
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Parts
The parts of Callout are written under its name, inside it. Each is described here, with what it takes.
Callout.Title
Its title row: the icon and the words. Drawn for it; written by hand to draw something else there.
Callout.Title { … }
Renders with the class wf-callout, stable across releases, so a stylesheet may target it.