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
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
targetof the link button and the document. - download: A value indicating whether the
targetof 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
valueas 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
-
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, )
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
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_orientation: card_orientation.CardOrientation
pub const default_rel: String
pub const default_target: option.Option(link_target.LinkTarget)
pub const default_type_: form_submitter_type.FormSubmitterType
pub const default_value: String
pub const default_variant: card_variant.CardVariant
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 orientation(
record: Card,
orientation: card_orientation.CardOrientation,
) -> Card
orientation sets the value of orientation 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 variant(
record: Card,
variant: card_variant.CardVariant,
) -> Card
variant sets the value of variant for this Card.