# m3e/floating_panel

FloatingPanel is a lightweight, generic floating surface used to present content above the page.

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(
        scroll_strategy: floating_panel_scroll_strategy.FloatingPanelScrollStrategy,
        fit_anchor_width: FitAnchorWidth,
        anchor_offset: Float,
      )
    }

### Constructors

-     Config(
        scroll_strategy: floating_panel_scroll_strategy.FloatingPanelScrollStrategy,
        fit_anchor_width: FitAnchorWidth,
        anchor_offset: Float,
      )

## FitAnchorWidth

</>

FitAnchorWidth is whether the panel’s width should match its anchor’s width.

    pub type FitAnchorWidth {
      IsFitAnchorWidth
      IsNotFitAnchorWidth
    }

### Constructors

-     IsFitAnchorWidth

-     IsNotFitAnchorWidth

## FloatingPanel

opaque </>

FloatingPanel is a View Model for this component

## Fields:

- scroll_strategy: The strategy that controls how the panel behaves when its trigger scrolls.
- fit_anchor_width: Whether the panel’s width should match its anchor’s width.
- anchor_offset: The logical margin, in pixels, between the panel and its anchor.

    pub opaque type FloatingPanel

# Values

## anchor_offset

</>

    pub fn anchor_offset(
      record: FloatingPanel,
      anchor_offset: Float,
    ) -> FloatingPanel

anchor_offset sets the value of anchor_offset for this FloatingPanel.

## default_anchor_offset

</>

    pub const default_anchor_offset: Float

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_fit_anchor_width

</>

    pub const default_fit_anchor_width: FitAnchorWidth

## default_scroll_strategy

</>

    pub const default_scroll_strategy: floating_panel_scroll_strategy.FloatingPanelScrollStrategy

## fit_anchor_width

</>

    pub fn fit_anchor_width(
      record: FloatingPanel,
      fit_anchor_width: FitAnchorWidth,
    ) -> FloatingPanel

fit_anchor_width sets the value of fit_anchor_width for this FloatingPanel.

## from_config

</>

    pub fn from_config(config: Config) -> FloatingPanel

from_config creates a new FloatingPanel from the given configuration.

## new

</>

    pub fn new() -> FloatingPanel

new creates a new FloatingPanel with the default configuration.

## render

</>

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

render creates a Lustre Element for a FloatingPanel

## 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 FloatingPanel Config

## scroll_strategy

</>

    pub fn scroll_strategy(
      record: FloatingPanel,
      scroll_strategy: floating_panel_scroll_strategy.FloatingPanelScrollStrategy,
    ) -> FloatingPanel

scroll_strategy sets the value of scroll_strategy for this FloatingPanel.

✨