mbr/elm-chadcn/1.0.0

ChadCn.Attachment

Provides attachment components.

The implementation follows the shadcn Base UI structure and Nova defaults.

type Config msg

Describes an attachment and its presentation.

= Horizontal
| Vertical

Describes an attachment's spatial arrangement.

type Size
= Default
| Small
| ExtraSmall

Describes an attachment's density.

type State
= Idle
| Uploading
| Processing
| Error
| Done

Describes an attachment's lifecycle presentation.

new : List (Html msg) -> Config msg

Creates a completed horizontal attachment with caller-owned content.

withAttributes : List (Attribute msg) -> Config msg -> Config msg

Adds native attributes to the attachment root.

Sets the attachment's spatial arrangement.

withSize : Size -> Config msg -> Config msg

Sets the attachment density.

withState : State -> Config msg -> Config msg

Sets the attachment lifecycle presentation.

view : Config msg -> Html msg

Renders a configured attachment.

title : List (Attribute msg) -> List (Html msg) -> Html msg

Renders an attachment title.

description : List (Attribute msg) -> List (Html msg) -> Html msg

Renders attachment metadata or status text.

content : List (Attribute msg) -> List (Html msg) -> Html msg

Renders the attachment metadata column.

media : List (Attribute msg) -> List (Html msg) -> Html msg

Renders an icon attachment preview.

imageMedia : List (Attribute msg) -> List (Html msg) -> Html msg

Renders an image attachment preview.

action : List (Attribute msg) -> List (Html msg) -> Html msg

Renders a default icon action.

actionUsing : Config msg -> Html msg

Renders a caller-configured button as an attachment action.

actions : List (Attribute msg) -> List (Html msg) -> Html msg

Renders attachment action controls.

group : List (Attribute msg) -> List (Html msg) -> Html msg

Renders a horizontally scrollable attachment collection.

trigger : List (Attribute msg) -> List (Html msg) -> Html msg

Renders a full-card button trigger.

(List (Attribute msg) -> List (Html msg) -> Html msg)
-> List (Attribute msg)
-> List (Html msg)
-> Html msg

Renders a full-card trigger with a caller-selected element.