View Source Bonfire.UI.Common.ReusableModalLive (Bonfire v0.9.11-social-beta.6)

The classic modal

Properties

  • id :string, required: true - The id of the live component (required by LiveView for stateful components).

  • source_inspector_attrs :map, default: %{}

  • title_text :string, default: nil - The title of the modal. Only used if no title slot is passed.

  • image_preview :boolean, default: false - If the modal is a preview of an image, set this to true.

  • title_class :css_class, default: nil - The classes of the title of the modal

  • modal_class :css_class, default: "" - The classes of the modal.

  • wrapper_class :css_class, default: nil - The classes of the modal wrapper.

  • action_btns_wrapper_class :css_class, default: nil - The classes around the action/submit button(s) on the modal

  • cancel_btn_class :css_class, default: nil - The classes of the close/cancel button on the modal. Only used if no close_btn slot is passed.

  • cancel_label :string, default: nil

  • show :boolean, default: false - Force modal to be open

  • form_opts :map, default: %{}

  • no_actions :boolean, default: false - Optional prop to hide the actions at the bottom of the modal

  • no_header :boolean, default: false - Optional prop to hide the header at the top of the modal

  • no_backdrop :boolean, default: false

  • overflow :boolean, default: false

  • modal_assigns :any, default: [] - Additional assigns to pass on to the optional modal sub-component

  • opts :keyword, default: [] - Additional attributes to add onto the modal wrapper

  • autocomplete :list, default: []

  • xl :boolean, default: false - Optional prop to make the modal wider

Slots

  • open_btn, arg: [autocomplete: :list, value: :any] - Slots for the contents of the modal, title, buttons...

  • action_btns

  • cancel_btn

  • title

  • default, arg: [autocomplete: :list, value: :any]

Summary

Functions

default_assigns()

handle_event(event, attrs, socket)

Callback implementation for Phoenix.LiveComponent.handle_event/3.

mount(socket)

Callback implementation for Phoenix.LiveComponent.mount/1.

render(assigns)

Callback implementation for Phoenix.LiveComponent.render/1.

set(assigns, reusable_modal_id \\ nil, opts \\ [])

sigil_p(route, extra)

(macro)

update(assigns, socket)

Callback implementation for Phoenix.LiveComponent.update/2.