Skip to main content

Dropdown

A versatile dropdown component that helps organize navigation and actions.

Example

Component Preview

Props

PropTypeDescription
childrenReactNodeContent related to the dropdown, often MenuGrid.
titlestringTitle text displayed on the dropdown trigger.
iconstringOptional Iconify icon name.
iconPosition'left' | 'right'Position of the icon relative to text. Default: 'left'.
iconSizestringCSS size string for the icon. Default: '1.2rem'.
iconColorstringCSS color string for the icon. Default: 'currentColor'.
hrefstringOptional URL. If provided, the title becomes a link.
idstringUnique identifier for the dropdown. Defaults to title/icon or 'dropdown'.
targetstringLink target attribute. Default: '_self'.
classNamestringOptional CSS class for the trigger button/link.
itemGroupClassNamestringOptional CSS class for the dropdown container.
itemClassNamestringOptional CSS class for items (if applicable).

JSON Data Example

{
"type": "Dropdown",
"data": {
"id": "dropdown-default",
"title": "Products",
"className": "bg-primary hover:bg-primary-200 text-primary-950 rounded-sm px-4 py-2",
"itemGroupClassName": "bg-primary text-primary-950 p-4",
"icon": "mdi:apps",
"iconPosition": "left",
"iconSize": "1.2rem",
"iconColor": "currentColor",
"href": "#products",
"target": "_self",
"children": [
{
"type": "MenuGrid",
"data": {
"id": "menugrid-default",
"columns": 3,
"className": "rounded-sm shadow-md",
"gridClassName": "gap-6 bg-primary text-primary-950 rounded-sm px-4 py-2 shadow-md"
},
"children": [
{
"type": "MenuGridItem",
"data": {
"id": "menugrid-item-1",
"title": "Web Development",
"description": "Build modern web applications",
"href": "#web",
"icon": "mdi:web",
"badge": "Popular"
}
},
{
"type": "MenuGridItem",
"data": {
"id": "menugrid-item-2",
"title": "Mobile Apps",
"description": "iOS and Android applications",
"href": "#mobile",
"icon": "mdi:cellphone"
}
},
{
"type": "MenuGridItem",
"data": {
"id": "menugrid-item-3",
"title": "Cloud Services",
"description": "Scalable cloud infrastructure",
"href": "#cloud",
"icon": "mdi:cloud",
"badge": "New"
}
}
]
}
]
}
}