UI components

Dropdown

Basics

Using the moonshine::dropdown component you can create drop-down blocks.

<x-moonshine::dropdown>
<div class="m-4">
{{ fake()->text() }}
</div>
<x-slot:toggler>Click me</x-slot:toggler>
</x-moonshine::dropdown>

Heading

<x-moonshine::dropdown title="Dropdown title">
<div class="m-4">
{{ fake()->text() }}
</div>
<x-slot:toggler>Click me</x-slot:toggler>
</x-moonshine::dropdown>
<x-moonshine::dropdown>
<div class="m-4">
{{ fake()->text() }}
</div>
<x-slot:toggler>Click me</x-slot:toggler>
<x-slot:footer>Dropdown footer</x-slot:footer>
</x-moonshine::dropdown>

Location

Available locations:

  • bottom
  • top
  • left
  • right
<x-moonshine::dropdown placement="left">
<div class="m-4">
{{ fake()->text() }}
</div>
<x-slot:toggler>Click me</x-slot:toggler>
</x-moonshine::dropdown>

[NOTE] Additional location options can be found in the official documentation tippy.js.