View Source ZoonkWeb.Components.Dropdown (Zoonk v0.2.0-alpha)
Dropdown components.
Link to this section Summary
Functions
Returns a button triggered dropdown with aria keyboard and focus supporrt. Accepts the follow slots
Link to this section Functions
Returns a button triggered dropdown with aria keyboard and focus supporrt. Accepts the follow slots:
:id
- The id to uniquely identify this dropdown:img
- The optional img to show beside the button title:title
- The button title:subtitle
- The button subtitle
examples
Examples
<.user_dropdown id={@id}>
<:img src={@current_user.avatar_url}/>
<:title><%= @current_user.name %></:title>
<:subtitle>@<%= @current_user.username %></:subtitle>
<:link navigate={profile_path(@current_user)}>View Profile</:link>
<:link navigate={~p"/profile/settings"}Settings</:link>
</.dropdown>
attributes
Attributes
id
(:string
) (required) - the dropdown id.
slots
Slots
img
- Accepts attributes:src
(:string
)alt
(:string
)
title
- the title displayed on the clickable dropdown button.subtitle
- the subtitle displayed on the clickable dropdown button.link
- list of links to be displayed when the dropdown is open. Accepts attributes:navigate
(:string
)href
(:string
)method
(:any
)color
(:atom
) - Must be one of:black
, or:alert
.