Disclosure
Expand supporting content or FAQ answers with native keyboard-accessible controls.
Independent or grouped questions
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let disclosureExample =
div {
fveDisclosure { _label "Can I change the content?"; _name "disclosure-example"; p { "Yes. Supply any semantic HTML as the disclosure body." } }
fveDisclosure { _label "Does this need JavaScript?"; _name "disclosure-example"; _open true; p { "No. Native details and summary own keyboard interaction and expanded state." } }
}On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add disclosure --config src/Acme.Components/fve.jsonNo additional JavaScript import is required.
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 disclosureExample =
div {
fveDisclosure { _label "Can I change the content?"; _name "disclosure-example"; p { "Yes. Supply any semantic HTML as the disclosure body." } }
fveDisclosure { _label "Does this need JavaScript?"; _name "disclosure-example"; _open true; p { "No. Native details and summary own keyboard interaction and expanded state." } }
}API reference
module DisclosureDsl =
val fveDisclosure : ComponentElementBuilder