View Source SaladUI.Collapsible (SaladUI v0.13.1)

Implementation of Collapsible components.

## Examples:

  <.collapsible id="collapsible-1" open let={builder}>
    <.collapsible_trigger builder={builder}>
      <.button variant="outline">Show content</.button>
    </.collapsible_trigger>
    <.collapsible_content>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
      </p>
    </.collapsible_content>
  </.collapsible>

Summary

Functions

Attributes

  • id (:string) (required) - Id to identify collapsible component, collapsible_trigger uses this id to toggle content visibility.
  • open (:boolean) - Initial state of collapsible content. Defaults to false.
  • class (:string) - Defaults to nil.

Slots

  • inner_block (required)

Render content for collapsible component.

Render trigger for collapsible component.

Show collapsible content.

Functions

Attributes

  • id (:string) (required) - Id to identify collapsible component, collapsible_trigger uses this id to toggle content visibility.
  • open (:boolean) - Initial state of collapsible content. Defaults to false.
  • class (:string) - Defaults to nil.

Slots

  • inner_block (required)
Link to this function

collapsible_content(assigns)

View Source

Render content for collapsible component.

Attributes

  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)
Link to this function

collapsible_trigger(assigns)

View Source

Render trigger for collapsible component.

Attributes

  • builder (:map) (required) - Builder instance for collapsible component.
  • class (:string) - Defaults to nil.

Slots

  • inner_block (required)
Link to this function

toggle_collapsible(js \\ %JS{}, builder)

View Source

Show collapsible content.