Skip to content
Andrew Sutton edited this page Jan 26, 2024 · 3 revisions

image

[<ReactComponent>]
let SwitchTest() =
    let checked', setChecked = React.useState false

    Fui.switch [
        switch.checked' checked'
        switch.label (if checked' then "With label above and checked" else "With label above and unchecked")
        switch.labelPosition.above
        switch.onChange (fun (d: SwitchOnChangeData) -> setChecked d.``checked``)
    ]
Clone this wiki locally