V Vaylan UI
Overlay

Modal

Focus a task in an accessible native dialog.

Preview

Open and close the example with its native disclosure controls.

Example

<.modal id="invite" title="Invite teammate"><:trigger>Invite</:trigger>Invitation form</.modal>

API contract

modal/1 uses declared Phoenix attributes and slots. This table is generated from the compiled component metadata.

AttributeTypeRequiredDefault Accepted values
id :string Yes — Any value matching the declared type
title :string Yes — Any value matching the declared type
description :string No nil Any value matching the declared type
placement :atom No :middle [:top, :middle, :bottom, :start, :end]
trigger_class :any No nil Any value matching the declared type
class :any No nil Any value matching the declared type
SlotRequiredSlot attributes
trigger Yes No slot attributes
inner_block Yes No slot attributes
actions No No slot attributes

States and behavior

Closed and open states use a native dialog. The trigger, explicit Close action, Escape key, and backdrop form all close predictably.

Keyboard and accessibility

Behavioral tests

These automated checks are applied to this component by the package and documentation test suites.

  • ExUnit

    Native dialog semantics

    Renders a labelled dialog, explicit dialog-closing form, trigger, title, description, and placement variants.

    test/vaylan_ui/components_test.exs
  • Browser

    Rendered interaction

    Opens and closes the native dialog through the documented controls.

    examples/docs/assets/test/browser-smoke.mjs
  • Docs

    Preview behavior contract

    Classified as disclosure. Open and close the example with its native disclosure controls.

    examples/docs/test/vaylan_ui_docs_web/controllers/page_controller_test.exs
  • Docs

    Stable public component page

    Renders the component name, example, API contract, accepted values, and keyboard and accessibility guidance at its stable URL.

    examples/docs/test/vaylan_ui_docs_web/controllers/page_controller_test.exs