Logo FS-Skia-UI

Switch Module

Builders for the `Switch` control — a sliding on/off toggle (the track-and-thumb form of a boolean).

Functions and values

Function or value Description

checked' arg1

Full Usage: checked' arg1

Parameters:
    arg0 : bool

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

Set the on/off position of a `Switch` (`Attr.checked'`; `true` slides the thumb on). A controlled value driven from model state and reconciled via `onChanged`.

arg0 : bool
Returns: Attr<'msg>

create arg1

Full Usage: create arg1

Parameters:
    arg0 : Attr<'msg> list

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

Build a `Switch` from its attributes; pair with `Switch.checked'` and `onChanged`. The typed `Props` front door (`FS.Skia.UI.Controls.Typed`) is the recommended authoring path.

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

onChanged arg1

Full Usage: onChanged arg1

Parameters:
    arg0 : bool -> 'msg

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

Emit a `'msg` carrying the new `bool` when a `Switch` is flipped (`Attr.onChanged`).

arg0 : bool -> 'msg
Returns: Attr<'msg>

Type something to start searching.