PetalComponents.Dropdown (petal_components v3.0.1)
View SourceSummary
Functions
<.dropdown label="Dropdown" js_lib="alpine_js|live_view_js">
Attributes
to(:string) - link path. Defaults tonil.label(:string) - link label.class(:any) - any additional CSS classes. Defaults tonil.disabled(:boolean) - Defaults tofalse.link_type(:string) - Defaults to"button".- Global attributes are accepted. Supports all globals plus:
["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type"].
Slots
inner_block
Functions
<.dropdown label="Dropdown" js_lib="alpine_js|live_view_js">
<.dropdown_menu_item link_type="button">
<.icon name="hero-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="a" to="/" disabled label="disabled 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
options_container_id(:string)label(:string) - labels your dropdown option. Defaults tonil.class(:any) - any extra CSS class for the parent container. Defaults tonil.trigger_class(:string) - additional classes for the trigger button. Defaults tonil.menu_items_wrapper_class(:any) - any extra CSS class for menu item wrapper container. Defaults tonil.js_lib(:string) - javascript library used for toggling. Defaults to"alpine_js".placement(:string) - Defaults to"left".- Global attributes are accepted.
Slots
trigger_elementinner_block