EssenceUI.Utilities.Slot (Essence UI v0.2.0)

Copy Markdown View Source

A component for prop composition.

Composable slot for merging props onto a child element. In Elixir/Phoenix, this is implemented as a wrapper around dynamic_tag to allow for tag-based composition.

Examples

<.slot as="button" class="my-btn">
  Click me
</.slot>

Summary

Functions

Renders a slot with the specified tag and merged props.

Functions

slot(assigns)

Renders a slot with the specified tag and merged props.

Props

  • as - The HTML tag to render (default: "div")
  • class - Additional CSS classes
  • style - Additional inline styles
  • rest - Additional HTML attributes

Attributes

  • as (:string) - Defaults to "div".
  • class (:string) - Defaults to nil.
  • style (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)