m3e/snackbar

Snackbar is presents short updates about application processes at the bottom of the screen.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Config is a public record for configuring this component.

pub type Config {
  Config(
    action: String,
    close_label: String,
    dismissible: Dismissible,
    duration: Float,
  )
}

Constructors

  • Config(
      action: String,
      close_label: String,
      dismissible: Dismissible,
      duration: Float,
    )

Dismissible is whether a button is presented that can be used to close the snackbar.

pub type Dismissible {
  IsDismissible
  IsNotDismissible
}

Constructors

  • IsDismissible
  • IsNotDismissible

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

pub type Slot {
  CloseIcon
}

Constructors

  • CloseIcon

Snackbar is a View Model for this component

Fields:

  • action: The label of the snackbar’s action.
  • close_label: The accessible label given to the button used to dismiss the snackbar.
  • dismissible: Whether a button is presented that can be used to close the snackbar.
  • duration: The length of time, in milliseconds, to wait before automatically dismissing the snackbar.
pub opaque type Snackbar

Values

pub fn action(record: Snackbar, action: String) -> Snackbar

action sets the value of action for this Snackbar.

pub fn close_label(
  record: Snackbar,
  close_label: String,
) -> Snackbar

close_label sets the value of close_label for this Snackbar.

pub const default_action: String
pub const default_close_label: String
pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_dismissible: Dismissible
pub const default_duration: Float
pub fn dismissible(
  record: Snackbar,
  dismissible: Dismissible,
) -> Snackbar

dismissible sets the value of dismissible for this Snackbar.

pub fn duration(record: Snackbar, duration: Float) -> Snackbar

duration sets the value of duration for this Snackbar.

pub fn from_config(config: Config) -> Snackbar

from_config creates a new Snackbar from the given configuration.

pub fn new() -> Snackbar

new creates a new Snackbar with the default configuration.

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

render creates a Lustre Element for a Snackbar

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

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

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

Search Document