m3e/carousel_item
CarouselItem is an actionable item in a Material 3 carousel or grid.
This file was generated by m3e/generator
DO NOT EDIT
Types
CarouselItem is a View Model for this component
Fields:
- href: The destination URL. When omitted, the item has a button action.
- target: The browsing context in which to open the link.
- rel: The relationship between the linked resource and the current document.
- download: Whether to download the link, optionally specifying a filename.
- disabled: Whether the item’s action is disabled.
- label: An accessible label for the primary action, overriding the slotted content.
pub opaque type CarouselItem
Config is a public record for configuring this component.
pub type Config {
Config(
href: String,
target: option.Option(link_target.LinkTarget),
rel: String,
download: option.Option(String),
disabled: Disabled,
label: option.Option(String),
)
}
Constructors
-
Config( href: String, target: option.Option(link_target.LinkTarget), rel: String, download: option.Option(String), disabled: Disabled, label: option.Option(String), )
Disabled is whether the item’s action is disabled.
pub type Disabled {
IsDisabled
IsNotDisabled
}
Constructors
-
IsDisabled -
IsNotDisabled
Values
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_disabled: Disabled
pub const default_download: option.Option(String)
pub const default_href: String
pub const default_label: option.Option(String)
pub const default_rel: String
pub const default_target: option.Option(link_target.LinkTarget)
pub fn disabled(
record: CarouselItem,
disabled: Disabled,
) -> CarouselItem
disabled sets the value of disabled for this CarouselItem.
pub fn download(
record: CarouselItem,
download: option.Option(String),
) -> CarouselItem
download sets the value of download for this CarouselItem.
pub fn from_config(config: Config) -> CarouselItem
from_config creates a new CarouselItem from the given configuration.
pub fn href(record: CarouselItem, href: String) -> CarouselItem
href sets the value of href for this CarouselItem.
pub fn label(
record: CarouselItem,
label: option.Option(String),
) -> CarouselItem
label sets the value of label for this CarouselItem.
pub fn rel(record: CarouselItem, rel: String) -> CarouselItem
rel sets the value of rel for this CarouselItem.
pub fn render(
model: CarouselItem,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a CarouselItem
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 CarouselItem Config
pub fn slot(s: Slot) -> attribute.Attribute(msg)
slot returns a Lustre Attribute(msg) for the given slot name
pub fn target(
record: CarouselItem,
target: option.Option(link_target.LinkTarget),
) -> CarouselItem
target sets the value of target for this CarouselItem.