View Source PetalComponents.Dropdown (petal_components v0.19.6)
Link to this section Summary
Functions
<.dropdown label="Dropdown" js_lib="alpine_js|live_view_js">
Attributes
to
(:string
) - link path. Defaults tonil
.label
(:string
) - link label.class
(:string
) - any additional CSS classes. Defaults to""
.link_type
(:string
) - Defaults to"button"
.rest
(:global
) - Supports all globals plus:["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type"]
.
Slots
inner_block
Link to this section Functions
<.dropdown label="Dropdown" js_lib="alpine_js|live_view_js">
<.dropdown_menu_item link_type="button">
<Heroicons.home class="w-5 h-5 text-gray-500" />
Button item with icon
</.dropdown_menu_item>
<.dropdown_menu_item link_type="a" to="/" label="a item" />
<.dropdown_menu_item link_type="live_patch" to="/" label="Live Patch item" />
<.dropdown_menu_item link_type="live_redirect" to="/" label="Live Redirect item" />
</.dropdown>
attributes
Attributes
options_container_id
(:string
)label
(:string
) - labels your dropdown option. Defaults tonil
.class
(:string
) - any extra CSS class for the parent container. Defaults to""
.menu_items_wrapper_class
(:string
) - any extra CSS class for menu item wrapper container. Defaults to""
.js_lib
(:string
) - javascript library used for toggling. Defaults to"alpine_js"
.placement
(:string
) - Defaults to"left"
.rest
(:global
)
slots
Slots
trigger_element
inner_block