Skip to main content

Interactive examples

Source-first examples and interactive product states for implementation and review.

On this page

docsExample

Pair arbitrary rendered HTML with its source using independent, keyboard-accessible Code and Preview tabs.

docsExample
let noticePreview =
    docsExample
        "notice-example"
        "Notice"
        "fsharp"
        "div { _class \"notice\"; \"Saved\" }"
        (div { _class "docs-notice-preview"; strong { "Saved" }; span { "The customer was updated." } })

docsStateTabs

Review empty, ready, validation, loading, or other meaningful states without duplicating the surrounding page.

docsStateTabs
let readyView = productScreen "ready"
let validationView = productScreen "validation"
let states =
    docsStateTabs "component-workflow-states" "Workflow states" [
        { id = "ready"; label = "Ready"; content = readyView }
        { id = "validation"; label = "Validation"; content = validationView } ]

docsBrowserFrame

Place product UI in a browser-like frame with an explicit canonical URL.

docsBrowserFrame
let productUi = productView "ready"
let browserFramePreview =
    docsBrowserFrame
        "https://example.test/views/new"
        productUi