Item
Compose structured list rows with media, content, metadata, links, and actions.
Default
On this page
Installation
Copy this component and its required dependencies into the consumer-owned Components project.
dotnet fve add item --config src/Acme.Components/fve.jsonThe CLI resolves dependencies and preserves consumer-authored files. See Installation for project initialization and Tailwind source detection.
Usage
open System
open FSharp.ViewEngine
open Acme.Components
open type Html
open type Svg
open type Datastar
let defaultItem =
ul { Item.create "Quarterly close" |> Item.render }Links and action rows
Linked row with metadata action
API reference
type ItemVariant =
| Plain
| Outlined
| Muted
type ItemConfig
/// withLink stretches the title link without wrapping media, descriptions or metadata in an anchor.
/// Supplied slot interactions remain independent. An explicit action cluster keeps the Item plain.
module Item =
val create : title:string -> ItemConfig
val withDescription : description:HtmlElement -> config:ItemConfig -> ItemConfig
val withMedia : media:HtmlElement -> config:ItemConfig -> ItemConfig
val withMetadata : metadata:HtmlElement -> config:ItemConfig -> ItemConfig
val withActions : actions:HtmlElement -> config:ItemConfig -> ItemConfig
val withLink : href:string -> config:ItemConfig -> ItemConfig
val withVariant : variant:ItemVariant -> config:ItemConfig -> ItemConfig
val withAttributes : attributes:HtmlAttribute list -> config:ItemConfig -> ItemConfig
val render : config:ItemConfig -> HtmlElement