Toggle button
Toggle a pressed action with typed presentation, size, and availability states.
Default
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let compactRows =
fveToggleButton {
_id "components-compact-rows"
"Compact rows"
}On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add toggle-button --config src/Acme.Components/fve.jsonAdd to src/Acme.Web/js/app.js once, alongside your other component imports:
import '../../Acme.Components/Components/Assets/toggle-button.js';The CLI resolves dependencies and preserves consumer-authored files. See Installation for project initialization, Tailwind, the shared runtime, and building/loading your app entry.
Usage
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let compactRows =
fveToggleButton {
_id "components-compact-rows"
"Compact rows"
}API reference
type ToggleButtonVariant =
| Soft
| Outline
| Ghost
module ToggleButtonDsl =
val fveToggleButton : ComponentElementBuilder
module ToggleButtonAttributes =
val Html._variant.Static : value:ToggleButtonVariant -> HtmlAttribute