Page header
Compose a page title, description, metadata, and responsive actions.
Default
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let defaultPageHeader = fvePageHeader { _label "Project overview" }On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add page-header --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 defaultPageHeader = fvePageHeader { _label "Project overview" }Title and page actions
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let refreshIcon =
fveIcon { _name IconName.ArrowPath; _variant IconVariant.Micro }
let pageHeaderLayoutExample =
div {
_dataSignals "{itemRefreshes: 0}"
fvePageHeader {
_label "Project notes"
_description "Updated moments ago"
fvePageHeaderActions {
fveButton {
_ariaLabel "Refresh"
_dataOn ("click", "$itemRefreshes++")
span {
_ariaHidden true
_class "inline-flex shrink-0"
refreshIcon
}
}
}
}
output {
_role "status"
_class "sr-only"
_dataText "'Refreshes: ' + $itemRefreshes"
"Refreshes: 0"
}
}
// Supply ordinary HTML for your table, filter controls, and actions.This example also uses Button, Icon. See their Installation sections for any additional setup.
API reference
module PageHeaderDsl =
val fvePageHeader : ComponentElementBuilder
val fvePageHeaderActions : ComponentElementBuilder