Skip to main content

Message

Compose sender identity, message content, metadata, and contextual actions.

Default

Can you review the September close?

On this page

Installation

Copy this component and its required dependencies into the consumer-owned Components project.

dotnet fve add message --config src/Acme.Components/fve.json

The 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 defaultMessage =
    Message.create "Jordan Lee" (p { "Can you review the September close?" })
    |> Message.render

Sender and receiver

Can you review the September close before lunch?

09:12

Yes. I’ll add notes to the two entries that need attention.

09:14Delivered

Metadata and actions without an avatar

The export is ready. It contains 184 account records.

Just now

API reference

type MessageSide =
    | Sender
    | Receiver

type MessageConfig

module Message =
    val create : sender:string -> content:HtmlElement -> MessageConfig
    val withSide : side:MessageSide -> config:MessageConfig -> MessageConfig
    val withAvatar : avatar:HtmlElement -> config:MessageConfig -> MessageConfig
    val withMetadata : metadata:string -> config:MessageConfig -> MessageConfig
    val withStatus : status:string -> config:MessageConfig -> MessageConfig
    val withActions : actions:HtmlElement -> config:MessageConfig -> MessageConfig
    val withAttributes : attributes:HtmlAttribute list -> config:MessageConfig -> MessageConfig
    val render : config:MessageConfig -> HtmlElement