Floating panel
Keep dismissible supporting content available beside the primary workflow.
Open non-modal panel
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let floatingPanelContent =
div {
_class "grid gap-3 text-sm"
p { "Use this space for contextual guidance that should not block the primary task." }
a {
_href "/components/page-examples/operations-dashboard"
_class "font-semibold text-[var(--fve-brand-text)] underline-offset-2 hover:underline"
"Open operations"
}
}
let floatingPanelExample =
fveFloatingPanel {
_id "workspace-guide"
_label "Workspace guide"
_description "Helpful context remains available beside the application."
_boundary FloatingPanelBoundary.Container
floatingPanelContent
}On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add floating-panel --config src/Acme.Components/fve.jsonAdd to src/Acme.Web/js/app.js once, alongside your other component imports:
import '../../Acme.Components/Components/Assets/floating-panel.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 floatingPanelContent =
div {
_class "grid gap-3 text-sm"
p { "Use this space for contextual guidance that should not block the primary task." }
a {
_href "/components/page-examples/operations-dashboard"
_class "font-semibold text-[var(--fve-brand-text)] underline-offset-2 hover:underline"
"Open operations"
}
}
let floatingPanelExample =
fveFloatingPanel {
_id "workspace-guide"
_label "Workspace guide"
_description "Helpful context remains available beside the application."
_boundary FloatingPanelBoundary.Container
floatingPanelContent
}Minimized with restore
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let floatingPanelContent =
div {
_class "grid gap-3 text-sm"
p { "Use this space for contextual guidance that should not block the primary task." }
a {
_href "/components/page-examples/operations-dashboard"
_class "font-semibold text-[var(--fve-brand-text)] underline-offset-2 hover:underline"
"Open operations"
}
}
let minimizedFloatingPanelExample =
fveFloatingPanel {
_id "minimized-workspace-guide"
_label "Workspace guide"
_boundary FloatingPanelBoundary.Container
_state FloatingPanelState.Minimized
floatingPanelContent
}Checklist
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let floatingPanelChecklistContent =
ol {
_class "m-0 grid list-none gap-4 p-0 text-sm"
li {
p {
_class "font-medium"
"1. Review the examples"
}
a {
_href "/examples"
_class "font-semibold text-[var(--fve-brand-text)] underline underline-offset-2"
"Open examples"
}
}
li {
p {
_class "font-medium"
"2. Choose your components"
}
p {
_class "text-[var(--fve-muted-text)]"
"Complete"
}
}
}
let floatingPanelChecklistExample =
fveFloatingPanel {
_id "component-checklist"
_label "Setup checklist"
_description "Two steps to get started."
_boundary FloatingPanelBoundary.Container
floatingPanelChecklistContent
}API reference
type FloatingPanelState =
| Open
| Minimized
| Dismissed
type FloatingPanelBoundary =
| Viewport
| Container
module FloatingPanelDsl =
val fveFloatingPanel : ComponentElementBuilder
val fveFloatingPanelFooter : ComponentElementBuilder
module FloatingPanelAttributes =
val Html._state.Static : value:FloatingPanelState -> HtmlAttribute
val Html._boundary.Static : value:FloatingPanelBoundary -> HtmlAttribute