Section
Compose borderless sections with consistent heading, action and content spacing.
Default
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let defaultSection =
fveSection {
_label "Details"
fveSectionActions { fveLink { _href "/components/section-header"; "Header reference" } }
p { "A section keeps its heading and content aligned." }
}On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add section --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 defaultSection =
fveSection {
_label "Details"
fveSectionActions { fveLink { _href "/components/section-header"; "Header reference" } }
p { "A section keeps its heading and content aligned." }
}Section spacing
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let sectionStackExample =
fveSectionStack {
fveSection { _label "Details"; _headingLevel SectionHeadingLevel.H3; p { "Description and properties." } }
fveSection { _label "History"; _headingLevel SectionHeadingLevel.H3; p { "Related activity." } }
}fveSection uses 16px between its header and content. fveSectionStack uses 48px between sections, increasing to 64px inside a wide fve-shell container. Actions belong in fveSectionActions; use SectionHeadingLevel.H3 when nesting sections.
API reference
module SectionDsl =
val fveSection : ComponentElementBuilder
val fveSectionActions : ComponentElementBuilder
val fveSectionStack : ComponentElementBuilder