Logo FS-Skia-UI

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

accessibility metadata

Full Usage: accessibility metadata

Parameters:
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.

metadata : AccessibilityMetadata
Returns: Attr<'msg>

child control

Full Usage: child control

Parameters:
Returns: Attr<'msg>
Type parameters: 'msg

Children builder (`child`) attaching a single nested `Control<'msg>` to a container.

control : Control<'msg>
Returns: Attr<'msg>

children controls

Full Usage: children controls

Parameters:
Returns: Attr<'msg>
Type parameters: 'msg

Children builder (`children`) attaching an ordered list of nested `Control<'msg>` to a container such as a stack, grid, or panel.

controls : Control<'msg> list
Returns: Attr<'msg>

create name category value

Full Usage: create name category value

Parameters:
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.

name : string
category : AttrCategory
value : AttrValue<'msg>
Returns: Attr<'msg>

customAttribute name value

Full Usage: customAttribute name value

Parameters:
    name : 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.

name : string
value : obj
Returns: Attr<'msg>

customEvent eventKind msg

Full Usage: customEvent eventKind msg

Parameters:
    eventKind : 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.

eventKind : string
msg : 'msg
Returns: Attr<'msg>

enabled value

Full Usage: enabled value

Parameters:
    value : bool

Returns: Attr<'msg>
Type parameters: 'msg

State builder (`enabled`): when `false` the control is disabled (non-interactive, rendered in its `Disabled` visual state); omitted defaults to enabled.

value : bool
Returns: Attr<'msg>

height value

Full Usage: height value

Parameters:
    value : float

Returns: Attr<'msg>
Type parameters: 'msg

Layout builder (`height`) requesting a fixed control height in device-independent pixels; omitted lets the control size to its content/container.

value : float
Returns: Attr<'msg>

items values

Full Usage: items values

Parameters:
    values : string list

Returns: Attr<'msg>
Type parameters: 'msg

Data builder (`items`) supplying the ordered string entries of a list-like control as the `Items` attribute.

values : string list
Returns: Attr<'msg>

loading value

Full Usage: loading value

Parameters:
    value : bool

Returns: Attr<'msg>
Type parameters: 'msg

State builder (`loading`): when `true` the control shows its busy/`Loading` visual state; omitted defaults to not loading.

value : bool
Returns: Attr<'msg>

margin value

Full Usage: margin value

Parameters:
    value : float

Returns: Attr<'msg>
Type parameters: 'msg

Layout builder (`margin`) setting uniform outer spacing in pixels around the control within its parent; omitted defaults to no margin.

value : float
Returns: Attr<'msg>

on eventKind msg

Full Usage: on eventKind msg

Parameters:
    eventKind : 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.

eventKind : string
msg : 'msg
Returns: Attr<'msg>

onWith eventKind map

Full Usage: onWith eventKind map

Parameters:
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.

eventKind : string
map : ControlEvent -> 'msg
Returns: Attr<'msg>

padding value

Full Usage: padding value

Parameters:
    value : float

Returns: Attr<'msg>
Type parameters: 'msg

Layout builder (`padding`) setting uniform inner spacing in pixels between the control's edge and its content; omitted defaults to no padding.

value : float
Returns: Attr<'msg>

readOnly value

Full Usage: readOnly value

Parameters:
    value : bool

Returns: Attr<'msg>
Type parameters: 'msg

State builder (`readOnly`): when `true` an input control such as a text-box displays its value but rejects edits; omitted defaults to editable.

value : bool
Returns: Attr<'msg>

selected value

Full Usage: selected value

Parameters:
    value : bool

Returns: Attr<'msg>
Type parameters: 'msg

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.

value : bool
Returns: Attr<'msg>

standardAttribute name value

Full Usage: standardAttribute name value

Parameters:
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.

name : StandardAttributeName
value : StandardAttributeValue<'msg>
Returns: Attr<'msg>

standardEvent eventKind msg

Full Usage: standardEvent eventKind msg

Parameters:
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.

eventKind : StandardEventKind
msg : 'msg
Returns: Attr<'msg>

style name

Full Usage: style name

Parameters:
    name : string

Returns: Attr<'msg>
Type parameters: 'msg

Style builder (`style`) attaching a single named style class by string — the free-form counterpart to the typed `styleClasses` builder.

name : string
Returns: Attr<'msg>

styleClasses classes

Full Usage: styleClasses classes

Parameters:
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).

classes : StyleClass list
Returns: Attr<'msg>

text value

Full Usage: text value

Parameters:
    value : string

Returns: Attr<'msg>
Type parameters: 'msg

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.

value : string
Returns: Attr<'msg>

theme theme

Full Usage: theme theme

Parameters:
Returns: Attr<'msg>
Type parameters: 'msg

Theme builder (`theme`) attaching a `Theme` palette/metrics to the control subtree, overriding the inherited theme for it and its descendants.

theme : Theme
Returns: Attr<'msg>

validation state

Full Usage: validation state

Parameters:
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.

state : ValidationState
Returns: Attr<'msg>

value value

Full Usage: value value

Parameters:
    value : string

Returns: Attr<'msg>
Type parameters: 'msg

Content builder (`value`) setting the current value of an input control such as a text-box, carried as the `Value` attribute.

value : string
Returns: Attr<'msg>

visible value

Full Usage: visible value

Parameters:
    value : bool

Returns: Attr<'msg>
Type parameters: 'msg

State builder (`visible`): when `false` the control is hidden from layout and paint; omitted defaults to visible.

value : bool
Returns: Attr<'msg>

visualState state

Full Usage: visualState state

Parameters:
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.

state : VisualState
Returns: Attr<'msg>

width value

Full Usage: width value

Parameters:
    value : float

Returns: Attr<'msg>
Type parameters: 'msg

Layout builder (`width`) requesting a fixed control width in device-independent pixels; omitted lets the control size to its content/container.

value : float
Returns: Attr<'msg>

Type something to start searching.