Build a presentation
Compose a slide deck from ordinary F# HTML, present it in the browser, and print or save it as a PDF.
On this page
Create a deck
For a standalone deck, complete the SDK, Node.js and local CLI setup in Standalone F# scripts first. In a new directory, initialize a script and install Presentation with its dependencies:
dotnet fve init deck.fsx
dotnet fve add presentationKeep the generated managed block at the top of deck.fsx. It pins Core, loads the editable component source, and opens the filename-derived namespace (deck here). The optional --namespace override is only needed for a different source namespace. For an application project, install the same components into its components project and return the deck through your normal Giraffe handler. Neither Slide nor Presentation requires a particular web framework.
Compose slides with ordinary F#
Replace the starter document below the managed block with the following. Each slide owns its branding and footer; an ordinary function shares those choices without a second configuration API:
open System.IO
open FSharp.ViewEngine
open type Html
let reviewSlide (attributes:HtmlAttribute list) (children:HtmlElement list) =
fveSlide {
yield! attributes
fveSlideBranding { strong { "Treasury team" } }
fveSlideFooter { "Internal · Prepared for discussion" }
yield! children
}
let deck =
fvePresentation {
_label "Quarterly treasury review"
reviewSlide [_variant SlideVariant.Cover] [
fveSlideHeader {
fveSlideTitle { "A clearer cash position." }
fveSlideSubtitle { "One account model. One set of decisions." }
}
fveSlideContent { p { "Author the message, not the slide frame." } }
]
reviewSlide [] [
fveSlideHeader { fveSlideTitle { "Review the next decision" } }
fveSlideContent {
ul {
li { "Understand the current position." }
li { "Compare the available choices." }
li { "Agree the next action." }
}
}
]
}
let document =
html {
_lang "en"
head {
meta { _charset "utf-8" }
meta { _name "viewport"; _content "width=device-width, initial-scale=1" }
title { "Quarterly treasury review" }
link { _rel "stylesheet"; _href "deck.css" }
}
body {
_class (ComponentsTheme.className ComponentsTheme.sky + " m-0 bg-[var(--fve-background)] p-4")
main {
h1 { _class "sr-only"; "Quarterly treasury review" }
deck
}
script { _src "deck.js" }
}
}
File.WriteAllText(Path.Combine(__SOURCE_DIRECTORY__, "deck.html"), Render.toHtmlDocString document)SlideHeader groups the title and subtitle, SlideContent owns the body, and SlideFooter and SlideBranding provide slide-local metadata. Presentation numbers slides in source order. Use any ordinary F# composition, encoded HTML, images or components inside those regions. The Slide reference documents the parts and variants.
Build and open
dotnet fve build --openThe CLI renders deck.fsx, compiles input.css and bundles the installed browser modules into deck.html, deck.css and deck.js. The generated script stylesheet already scans the local F# and component source; see script build setup for shared source directories and build configuration. No server, separate npm project or per-deck viewer JavaScript is needed. Use relative paths for local fonts and images, and keep the generated assets beside the HTML when sharing it.
Present in the browser
The normal view is a separated stack with only an Expand action. Each canvas keeps its 16:9 composition between 48rem and 80rem wide; narrow screens pan horizontally rather than shrinking the text. Expand fits one existing slide to the viewport without rebuilding its content. The expanded toolbar provides Previous/Next, position and Restore.
- Use Left/Right to move between slides, or Home/End for the first/last slide.
- Use Escape or Restore to return to the stack at the current slide.
- Inputs and nested components keep their state while expanding or restoring.
- Without JavaScript, the separated stack and source-order numbering remain readable.
Set --fve-slide-cover-background, --fve-slide-cover-text and --fve-slide-cover-muted on the owning region to customize the cover palette. Standard slides inherit the component theme. See Theming for shared palettes, size and appearance choices. The Presentation reference covers the focused viewer contract.
Print or save as PDF
- Open the finished HTML in your browser and check every slide in the intended theme.
- Choose Print (Cmd+P on macOS or Ctrl+P on Windows/Linux).
- Choose Save as PDF or your printer. Keep browser headers and footers off, and enable background graphics if your browser offers that setting.
- Check the preview: one slide per page, with complete titles, content, branding, footers and numbering. Then save or print.
The components supply full-bleed 16:9 pages at 1280×720 CSS pixels (960×540 PDF points). Viewer controls, the stack backdrop and surrounding host chrome are omitted; slide colors and the active theme are preserved. A physical printer can fit the pages to its printable paper area. No PowerPoint or separate PDF converter is required.
Printing from the expanded viewer temporarily returns the content to normal document flow and restores the same slide and focus afterward. Print layout also works without JavaScript. Scrolling is only a screen behavior: split overflowing content across slides before printing rather than relying on a scrollable body.
Explore the complete example
The Geldos product overview uses captures of the Geldos application to show its transactions, account hierarchy and balance chart. Its editable source in sln/src/Example/Presentation shows how a web-hosted page and a standalone script share the same F# deck.