Attr Module
Builder functions (`Attr`) for constructing the typed `Attr<'msg>` values that configure a control — covering content, layout, state, style, theme, and event attributes.
Functions and values
| Function or value |
Description
|
Full Usage:
accessibility metadata
Parameters:
AccessibilityMetadata
Returns: Attr<'msg>
Type parameters: 'msg |
Accessibility builder (`accessibility`) attaching explicit `AccessibilityMetadata` (role, name source, keyboard contract, contrast/navigation data) to override the control's inferred semantics.
|
|
|
|
|
Full Usage:
create name category value
Parameters:
string
category : AttrCategory
value : AttrValue<'msg>
Returns: Attr<'msg>
Type parameters: 'msg |
Low-level escape hatch (`create`) building an `Attr<'msg>` from an explicit `name`, `AttrCategory`, and `AttrValue<'msg>`; the foundation the typed builders below wrap.
|
Full Usage:
customAttribute name value
Parameters:
string
value : obj
Returns: Attr<'msg>
Type parameters: 'msg |
Builder (`customAttribute`) for a consumer-defined attribute outside the standard set: a free-form `name` carrying an untyped `obj` value, lowered under the `Data` category.
|
Full Usage:
customEvent eventKind msg
Parameters:
string
msg : 'msg
Returns: Attr<'msg>
Type parameters: 'msg |
Event builder (`customEvent`) wiring a free-form `eventKind` string to dispatch a fixed `msg`, for events outside the `StandardEventKind` set.
|
|
State builder (`enabled`): when `false` the control is disabled (non-interactive, rendered in its `Disabled` visual state); omitted defaults to enabled.
|
|
Layout builder (`height`) requesting a fixed control height in device-independent pixels; omitted lets the control size to its content/container.
|
|
Data builder (`items`) supplying the ordered string entries of a list-like control as the `Items` attribute.
|
|
State builder (`loading`): when `true` the control shows its busy/`Loading` visual state; omitted defaults to not loading.
|
|
Layout builder (`margin`) setting uniform outer spacing in pixels around the control within its parent; omitted defaults to no margin.
|
Full Usage:
on eventKind msg
Parameters:
string
msg : 'msg
Returns: Attr<'msg>
Type parameters: 'msg |
Event builder (`on`) subscribing to an event by `eventKind` string and dispatching a fixed `msg` when it fires, ignoring the event payload.
|
Full Usage:
onWith eventKind map
Parameters:
string
map : ControlEvent -> 'msg
Returns: Attr<'msg>
Type parameters: 'msg |
Event builder (`onWith`) subscribing to an event by `eventKind` string and computing the dispatched message from the `ControlEvent` via `map`, giving access to the payload.
|
|
Layout builder (`padding`) setting uniform inner spacing in pixels between the control's edge and its content; omitted defaults to no padding.
|
|
State builder (`readOnly`): when `true` an input control such as a text-box displays its value but rejects edits; omitted defaults to editable.
|
|
State builder (`selected`): when `true` marks the control as selected (e.g. a toggle, radio, or list item in its `Selected` visual state); omitted defaults to unselected.
|
Full Usage:
standardAttribute name value
Parameters:
StandardAttributeName
value : StandardAttributeValue<'msg>
Returns: Attr<'msg>
Type parameters: 'msg |
Schema-checked builder (`standardAttribute`) producing an `Attr<'msg>` from a typed `StandardAttributeName` and `StandardAttributeValue<'msg>`, keeping the attribute within the recognised contract surface.
|
Full Usage:
standardEvent eventKind msg
Parameters:
StandardEventKind
msg : 'msg
Returns: Attr<'msg>
Type parameters: 'msg |
Event builder (`standardEvent`) wiring a typed `StandardEventKind` to dispatch a fixed `msg` when that built-in event fires on the control.
|
|
Style builder (`style`) attaching a single named style class by string — the free-form counterpart to the typed `styleClasses` builder.
|
Full Usage:
styleClasses classes
Parameters:
StyleClass list
Returns: Attr<'msg>
Type parameters: 'msg |
Feature 093 (E3): attach an ordered list of style classes (list order = attach order). Lowers to a single `Style`-category attribute carrying `StyleClassesValue`. Absent ≡ `[]` ≡ the behaviour-preserving base case (FR-005). The last `styleClasses` attribute on a control wins (the codebase's last-writer attribute convention).
|
|
Content builder (`text`) setting the control's display text — the label of a button or text-block, or the caption shown by content-bearing kinds.
|
|
|
Full Usage:
validation state
Parameters:
ValidationState
Returns: Attr<'msg>
Type parameters: 'msg |
Validation builder (`validation`) attaching a `ValidationState` (`Valid`/`Invalid`/`Pending`) to an input control, surfacing its validity in the resolved visual state.
|
|
Content builder (`value`) setting the current value of an input control such as a text-box, carried as the `Value` attribute.
|
|
State builder (`visible`): when `false` the control is hidden from layout and paint; omitted defaults to visible.
|
Full Usage:
visualState state
Parameters:
VisualState
Returns: Attr<'msg>
Type parameters: 'msg |
Feature 093 (E3): set the control's current `VisualState` for the resolver. A host wires its `ControlRuntime` Hover/Press/Focus state into this each frame; it rides the control through the keyed reconciler so a state-driven look survives a sibling shift (FR-006, SC-005). Absent ≡ `Normal` ≡ the behaviour-preserving base case.
|
|
Layout builder (`width`) requesting a fixed control width in device-independent pixels; omitted lets the control size to its content/container.
|