Reference

Editable

Text that turns into a field when pressed: Enter or leaving keeps what was typed, Escape puts it back; bind: holds the text.

Editable(bind: State, label: String, placeholder: String)

Since 6.2.0

label

placeholder

Saved as “Quarterly report”

Example

wf

state project = "Quarterly report" Editable(bind: project, label: "Project name", placeholder: "Name the project") Text("Saved as “{project}”").muted

Props

Props of Editable
PropTypeUnsetMeaning

bind:

State (required)

—

The String state it shows and writes; Enter or leaving the field writes what was typed, Escape leaves it as it was

label:

String (required)

—

What the text is: the field's name, and the button's (Name: Ada, edit) for a screen reader

placeholder:

String

— while empty

Shown in place of the text while it is empty, and in the field while editing

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.

No flags of its own.

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-editable, stable across releases, so a stylesheet may target it.