Slide
Compose a 16:9 HTML canvas with reusable title, subtitle, content, footer and numbering regions.
Content slide
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let defaultSlide =
fveSlide {
fveSlideHeader {
fveSlideTitle { "One frame. Your content." }
fveSlideSubtitle { "A consistent title, content region and footer for every slide." }
}
fveSlideContent {
div {
_class "grid grid-cols-2 gap-[2cqw]"
div { h3 { _class "m-0 text-[length:2cqw] font-semibold"; "Structure" }; p { "Compose ordinary F# HTML inside the content region." } }
div { h3 { _class "m-0 text-[length:2cqw] font-semibold"; "Consistency" }; p { "Keep spacing and typography in the shared frame." } }
}
}
fveSlideFooter { "Prepared for discussion" }
}Build a presentation and print or save it as PDF.
On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add slide --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 defaultSlide =
fveSlide {
fveSlideHeader {
fveSlideTitle { "One frame. Your content." }
fveSlideSubtitle { "A consistent title, content region and footer for every slide." }
}
fveSlideContent {
div {
_class "grid grid-cols-2 gap-[2cqw]"
div { h3 { _class "m-0 text-[length:2cqw] font-semibold"; "Structure" }; p { "Compose ordinary F# HTML inside the content region." } }
div { h3 { _class "m-0 text-[length:2cqw] font-semibold"; "Consistency" }; p { "Keep spacing and typography in the shared frame." } }
}
}
fveSlideFooter { "Prepared for discussion" }
}Cover
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let coverSlide =
fveSlide {
_variant SlideVariant.Cover
fveSlideHeader {
fveSlideTitle { "Make the next decision clear." }
fveSlideSubtitle { "A cover uses the same canvas, header and footer regions." }
}
fveSlideContent {
p { _class "max-w-[50cqw] text-[length:2.5cqw]"; "Use the space for one idea, not a smaller font." }
}
}SlideHeader owns the title/subtitle composition. SlideFooter supplies footer copy; SlideBranding supplies the slide’s logo or wordmark. Numbering is automatic inside Presentation. To style the number, place fveSlideNumber as a direct slide child. A standalone slide is numbered 01.
API reference
type SlideVariant =
| Standard
| Cover
module SlideDsl =
val fveSlide : ComponentElementBuilder
val fveSlideHeader : ComponentElementBuilder
val fveSlideTitle : ComponentElementBuilder
val fveSlideSubtitle : ComponentElementBuilder
val fveSlideContent : ComponentElementBuilder
val fveSlideFooter : ComponentElementBuilder
val fveSlideBranding : ComponentElementBuilder
val fveSlideNumber : ComponentElementBuilder
module SlideAttributes =
val Html._variant.Static : value:SlideVariant -> HtmlAttribute