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

Before you push

Run wf check before you push: every finding has a code, and a page that says how to fix it.

Example

wf

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

wf

Callout("Every finding has a code.").note { Link("Read about the checks", to: "/errors") }

Every kind

wf

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

wf

Callout.warning { Callout.Title { Text("Rotating keys") Badge("Beta").info } Text("The old key keeps working for an hour.") }

Props

Props of Callout
PropTypeUnsetMeaning

text

String (positional)

none

What it says, as Markdown: a code span, bold and a link show as such; markup in it is shown, not run. Its block follows

kind:

one of its cases

note

What kind of note it is: its colour, its icon and its title's word. Written as a flag, .note, or by name, kind: .note.

  • .note (the default): Context worth having: blue, an info icon, Note (the default)
  • .tip: A way to do it better or sooner: green, Tip
  • .important: Something to know before going on: the primary colour, Important
  • .warning: A way to lose work or ship a bug: amber, Warning
  • .caution: A way to lose data or expose a secret: red, Caution

title:

String

the kind's word: Note, Tip …

The words of its title row, after the kind's icon; a Callout.Title block written by hand draws the row instead

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.