m3e/carousel

Carousel is arranges items in responsive, scrollable Material 3 carousel layouts.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Carousel is a View Model for this component

Fields:

  • selected_index: The zero-based index of the current item.
  • variant: The appearance variant of the carousel.
pub opaque type Carousel

Config is a public record for configuring this component.

pub type Config {
  Config(
    selected_index: Float,
    variant: carousel_variant.CarouselVariant,
  )
}

Constructors

Values

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_selected_index: Float
pub fn from_config(config: Config) -> Carousel

from_config creates a new Carousel from the given configuration.

pub fn new() -> Carousel

new creates a new Carousel with the default configuration.

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

render creates a Lustre Element for a Carousel

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 Carousel Config

pub fn selected_index(
  record: Carousel,
  selected_index: Float,
) -> Carousel

selected_index sets the value of selected_index for this Carousel.

pub fn variant(
  record: Carousel,
  variant: carousel_variant.CarouselVariant,
) -> Carousel

variant sets the value of variant for this Carousel.

✨ Search Document