# m3e/snackbar

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

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

         DO NOT EDIT

# Types

## Config

</>

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

</>

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

    pub type Dismissible {
      IsDismissible
      IsNotDismissible
    }

### Constructors

-     IsDismissible

-     IsNotDismissible

## Slot

</>

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

    pub type Slot {
      CloseIcon
    }

### Constructors

-     CloseIcon

## Snackbar

opaque </>

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

## action

</>

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

action sets the value of action for this Snackbar.

## close_label

</>

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

close_label sets the value of close_label for this Snackbar.

## default_action

</>

    pub const default_action: String

## default_close_label

</>

    pub const default_close_label: String

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_dismissible

</>

    pub const default_dismissible: Dismissible

## default_duration

</>

    pub const default_duration: Float

## dismissible

</>

    pub fn dismissible(
      record: Snackbar,
      dismissible: Dismissible,
    ) -> Snackbar

dismissible sets the value of dismissible for this Snackbar.

## duration

</>

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

duration sets the value of duration for this Snackbar.

## from_config

</>

    pub fn from_config(config: Config) -> Snackbar

from_config creates a new Snackbar from the given configuration.

## new

</>

    pub fn new() -> Snackbar

new creates a new Snackbar with the default configuration.

## render

</>

    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

## render_config

</>

    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

## slot

</>

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

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

✨