Skip to content

Flyout

A flyout displays content in an overlay, triggered by a button.

Demo

flyout.html
<div x-init x-flyout.hoverable>
<button x-flyout:trigger>Open</button>
<div x-flyout:content x-cloak>
<p>Flyouts can be used for menus or dropdowns.</p>
<a href="#anatomy">Anatomy</a>
<a href="#directives">Directives</a>
</div>
</div>

Features

  • Can open flyout on hover

Anatomy

<div x-init x-flyout>
<button x-flyout:trigger></button>
<div x-flyout:content></div>
</div>

Directives

x-flyout

Required

The root element for the flyout.

ModifierDescription
.hoverableOpens flyout on hover. Flyout automatically closes when cursor moves outside.
EventDescriptiondetail
flyout:changeWhether the flyout is open or closed.{ open: boolean }
Data AttributeValues
[data-state]open | closed

x-flyout:trigger

Required

Trigger button that opens or closes the flyout content.

EventDescriptiondetail
flyout:changeWhether the flyout is open or closed.{ open: boolean }
Data AttributeValues
[data-state]open | closed

x-flyout:content

Required

The content that will be shown or hidden.

EventDescriptiondetail
flyout:changeWhether the flyout is open or closed.{ open: boolean }
Data AttributeValues
[data-state]open | closed