# m3e/toc

Toc is a table of contents that provides in-page scroll navigation.

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(for: option.Option(String), max_depth: Float)
    }

### Constructors

-     Config(for: option.Option(String), max_depth: Float)

## Slot

</>

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

    pub type Slot {
      Overline
      Title
    }

### Constructors

-     Overline

-     Title

## Toc

opaque </>

Toc is a View Model for this component

## Fields:

- for: The identifier of the interactive control to which this element is attached.
- max_depth: The maximum depth of the table of contents.

    pub opaque type Toc

# Values

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_for

</>

    pub const default_for: option.Option(String)

## default_max_depth

</>

    pub const default_max_depth: Float

## for

</>

    pub fn for(record: Toc, for: option.Option(String)) -> Toc

for sets the value of for for this Toc.

## from_config

</>

    pub fn from_config(config: Config) -> Toc

from_config creates a new Toc from the given configuration.

## max_depth

</>

    pub fn max_depth(record: Toc, max_depth: Float) -> Toc

max_depth sets the value of max_depth for this Toc.

## new

</>

    pub fn new() -> Toc

new creates a new Toc with the default configuration.

## render

</>

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

render creates a Lustre Element for a Toc

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

## slot

</>

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

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

✨