m3e/card

Card is a content container for text, images (or other media), and actions in the context of a single subject.

This file was generated: By: m3e/generator version 0.1.0 At: 2026-05-05T14:38:23+10:00

     DO NOT EDIT

Types

Actionable is whether the card is “actionable” and will respond to use interaction.

pub type Actionable {
  IsActionable
  IsNotActionable
}

Constructors

  • IsActionable
  • IsNotActionable

Card is a View Model for this component

Fields:

  • actionable: Whether the card is “actionable” and will respond to use interaction.
  • inline: Whether to present the card inline with surrounding content.
  • orientation: The orientation of the card.
  • variant: The appearance variant of the card.
  • href: The URL to which the link button points.
  • target: The target of the link button.
  • rel: The relationship between the target of the link button and the document.
  • download: A value indicating whether the target of the link button will be downloaded, optionally specifying the new name of the file.
  • name: The name of the element, submitted as a pair with the element’s value as part of form data, when the element is used to submit a form.
  • value: The value associated with the element’s name when it’s submitted with form data.
  • type_: The type of the element.
  • disabled_interactive: Whether the element is disabled and interactive.
  • disabled: Whether the element is disabled.
pub opaque type Card

Config is a public record for configuring this component.

pub type Config {
  Config(
    actionable: Actionable,
    inline: Inline,
    orientation: card_orientation.CardOrientation,
    variant: card_variant.CardVariant,
    href: String,
    target: option.Option(link_target.LinkTarget),
    rel: String,
    download: option.Option(String),
    name: String,
    value: String,
    type_: form_submitter_type.FormSubmitterType,
    disabled_interactive: DisabledInteractive,
    disabled: Disabled,
  )
}

Constructors

Disabled is whether the element is disabled.

pub type Disabled {
  IsDisabled
  IsNotDisabled
}

Constructors

  • IsDisabled
  • IsNotDisabled

DisabledInteractive is whether the element is disabled and interactive.

pub type DisabledInteractive {
  IsDisabledInteractive
  IsNotDisabledInteractive
}

Constructors

  • IsDisabledInteractive
  • IsNotDisabledInteractive

Inline is whether to present the card inline with surrounding content.

pub type Inline {
  IsInline
  IsNotInline
}

Constructors

  • IsInline
  • IsNotInline

Slots are used in child elements to insert content into this component

pub type Slot {
  Header
  Content
  Actions
  Footer
}

Constructors

  • Header
  • Content
  • Actions
  • Footer

Values

pub fn actionable(record: Card, actionable: Actionable) -> Card

actionable sets the value of actionable for this Card.

pub const default_actionable: Actionable
pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_disabled: Disabled
pub const default_disabled_interactive: DisabledInteractive
pub const default_download: option.Option(String)
pub const default_href: String
pub const default_inline: Inline
pub const default_name: String
pub const default_rel: String
pub const default_value: String
pub fn disabled(record: Card, disabled: Disabled) -> Card

disabled sets the value of disabled for this Card.

pub fn disabled_interactive(
  record: Card,
  disabled_interactive: DisabledInteractive,
) -> Card

disabled_interactive sets the value of disabled_interactive for this Card.

pub fn download(
  record: Card,
  download: option.Option(String),
) -> Card

download sets the value of download for this Card.

pub fn from_config(config: Config) -> Card

from_config creates a new Card from the given configuration.

pub fn href(record: Card, href: String) -> Card

href sets the value of href for this Card.

pub fn inline(record: Card, inline: Inline) -> Card

inline sets the value of inline for this Card.

pub fn name(record: Card, name: String) -> Card

name sets the value of name for this Card.

pub fn new() -> Card

new creates a new Card with the default configuration.

pub fn orientation(
  record: Card,
  orientation: card_orientation.CardOrientation,
) -> Card

orientation sets the value of orientation for this Card.

pub fn rel(record: Card, rel: String) -> Card

rel sets the value of rel for this Card.

pub fn render(
  model: Card,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render creates a Lustre Element for a Card

pub fn render_config(
  c: Config,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render_config creates a Lustre Element from a Card Config

pub fn slot(s: Slot) -> attribute.Attribute(msg)

slot returns a Lustre Attribute(msg) for the given slot name

pub fn target(
  record: Card,
  target: option.Option(link_target.LinkTarget),
) -> Card

target sets the value of target for this Card.

pub fn type_(
  record: Card,
  type_: form_submitter_type.FormSubmitterType,
) -> Card

type_ sets the value of type_ for this Card.

pub fn value(record: Card, value: String) -> Card

value sets the value of value for this Card.

pub fn variant(
  record: Card,
  variant: card_variant.CardVariant,
) -> Card

variant sets the value of variant for this Card.

Search Document