Skip to content

Dropdown

A versatile and customizable dropdown component that supports both button and icon triggers, ideal for displaying contextual actions or navigation options.

Props

PropTypeDefaultDescription
labelString''Text label displayed on the dropdown trigger (used when type is 'button').
typeString'button'Defines the trigger style — either a button or an icon.
sizeString'md'Controls the size of the dropdown trigger (sm and md).
openBoolean'false'Controls the visibility of the dropdown menu.
disabledBoolean'false'Disables interaction with the trigger element.
userObjectnullOptional user data object, used for personalized dropdown content (e.g., avatar, name).
optionsArray[]List of dropdown items, each containing label, icon, and value keys.
iconString''Optional icon for the trigger when type is 'icon'.

Button Dropdown

A dropdown triggered by a button, ideal for menus, filters, and contextual actions in the UI.

html
<div class="flex justify-center mt-10">
  <DropdownMenu
    type="button"
    :size="'sm'"
    :open="false"
    :user="user"
    :options="options"
    @select="(opt) => console.log('Selected:', opt)"
  />
</div>

Icon Dropdown

A compact dropdown triggered by an icon, perfect for quick actions and minimalist UI layouts.

html
<div class="flex justify-center mt-10">
  <DropdownMenu
    type="icon"
    :size="'sm'"
    :open="false"
    :user="user"
    :options="options"
    @select="(opt) => console.log('Selected:', opt)"
  />
</div>

Avtar Dropdown

A user menu dropdown triggered by an avatar, ideal for profile and account-related actions.

profile
html
<div class="flex justify-center mt-10">
  <DropdownMenu
    type="avtar"
    :size="'sm'"
    :open="false"
    :user="user"
    :options="options"
    @select="(opt) => console.log('Selected:', opt)"
  />
</div>