The Dropdown displays a list of options, triggered by an icon, button, or action. It is also used to filter or sort contents on a page. Below we are presenting dynamic examples of the Dropdown component that you can use in your project based on Taco.
Below you can find the code for the Dropdown component.
<x-dropdown :menu="$menu" class="button-blue" button="dropdown" />
Below you can find a sample code for the $menu
array.
public $menu = [
[
'label' => 'Item 1',
'url' => '#',
'items' => [
[
'label' => 'Item 1.1',
'url' => '#',
],
[
'label' => 'Item 1.2',
'url' => '#',
],
],
],
[
'label' => 'Item 2',
'url' => '#',
'items' => [
[
'label' => 'Item 2.1',
'url' => '#',
],
[
'label' => 'Item 2.2',
'url' => '#',
],
[
'label' => 'Item 2.3',
'url' => '#',
],
[
'label' => 'Item 2.4',
'url' => '#',
],
],
],
[
'label' => 'Item 3',
'url' => '#',
],
];