V Vaylan UI
Layout

Drawer

Bring navigation into view when it is needed.

Preview

Open and close the example with its native disclosure controls.

A little more room

Keep navigation nearby and let the page content take the lead.

Example

<.drawer id="app-drawer"><:content>Page</:content><:sidebar>Navigation</:sidebar></.drawer>

API contract

drawer/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
label :string No "Open navigation" Any value matching the declared type
placement :atom No :start [:start, :end]
open :boolean No false Any value matching the declared type
responsive :boolean No false Any value matching the declared type
class :any No nil Any value matching the declared type
rest :global No — Any value matching the declared type
SlotRequiredSlot attributes
content Yes No slot attributes
sidebar Yes No slot attributes

States and behavior

Default and caller-supplied variants preserve semantic daisyUI colors and additive classes.

Keyboard and accessibility

Behavioral tests

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

  • ExUnit

    Drawer control relationships

    Matches toggle and label identifiers and exposes the sidebar as a named complementary region.

    test/vaylan_ui/primereact_adapted_contracts_test.exs
  • Adapted

    PrimeReact scenario adaptation

    Applies independently written Phoenix assertions derived from the documented PrimeReact 10.9.9 behavior group.

    test/vaylan_ui/primereact_adapted_contracts_test.exs
  • Browser

    Rendered interaction

    Opens the drawer through its matching label and verifies the native checkbox state changes.

    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