Mega Menu
v0.0.10
mix mishka.ui.gen.component mega_menu
Clickable prop
The clickable mode of the mega_menu component allows you to trigger the display of Mega menu by clicking on a specific element. To achieve this, you need to assign a unique ID to the mega_menu. This connection ensures that when the trigger element is clicked, the corresponding Mega menu is displayed. By using the clickable prop, you create an interactive and intuitive experience for users.
Clickable prop
<.mega_menu id="unique_id" clickable></.mega_menu>Trigger slot
The trigger slot in the mega menu component serves as a versatile entry point for users to open the menu. You can place any HTML element within this slot, such as buttons, links, or icons, making it adaptable to your design needs. This flexibility allows for a seamless integration of the mega menu into various layouts, whether you prefer a simple button or a more complex interactive element. By utilizing the trigger slot, you can enhance user engagement, as it invites interaction through intuitive controls that align with your application's aesthetic.
Trigger slot
<.mega_menu>
<:trigger>
<button>Trigger button</button>
</:trigger>
</.mega_menu>
<.mega_menu>
<:trigger>
<.button>Trigger button</.button>
</:trigger>
</.mega_menu>Attributes
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
id
|
string
| — | — | No | A unique identifier is used to manage state and interaction |
clickable
|
boolean
|
false
| — | No | Determines if the element can be activated on click |
variant
|
string
|
base
|
defaultoutlineborderedshadowgradientbase
| No | Determines the style |
color
|
string
|
natural
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfosilvermiscdawn
| No | Determines color theme |
rounded
|
string
| — |
extra_smallsmallmediumlargeextra_largenone
| No | Determines the border radius |
size
|
string
| — |
extra_smallsmallmediumlargeextra_large
| No | Determines the overall size of the elements, including padding, font size, and other items |
space
|
string
| — |
extra_smallsmallmediumlargeextra_large
| No | Space between items |
width
|
string
|
full
| — | No | Determines the element width |
font_weight
|
string
|
font-normal
| — | No | Determines custom class for the font weight |
padding
|
string
| — |
extra_smallsmallmediumlargeextra_large
| No | Determines padding for items |
icon
|
string
| — | — | No | Icon displayed alongside of an item |
icon_class
|
string
| — | — | No | Determines custom class for the icon |
title
|
string
| — | — | No | Specifies the title of the element |
title_class
|
string
| — | — | No | Determines custom class for the title |
content_class
|
string
| — | — | No | Determines custom class for the content |
border
|
string
|
extra_small
| — | No | Determines border style |
top_gap
|
string
|
extra_small
| — | No | Determines top gap of the element |
class
|
any
| — | — | No | Custom CSS class for additional styling |
rest
|
global
| — | — | No | Global attributes can define defaults which are merged with attributes provided by the caller |
Slots
| Name | Required | Description |
|---|---|---|
inner_block
| No | Inner block that renders HEEx content |
trigger
| No | — |
Attributes of the trigger slot
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
class
|
any
| — | — | No | Custom CSS class for additional styling |
Options
Each option takes one or more of its values, separated by commas.
| Option | Values |
|---|---|
--variant
|
defaultoutlineborderedshadowgradientbase
|
--color
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfosilvermiscdawn
|
--size
|
extra_smallsmallmediumlargeextra_large
|
--space
|
extra_smallsmallmediumlargeextra_large
|
--padding
|
extra_smallsmallmediumlargeextra_large
|
--rounded
|
extra_smallsmallmediumlargeextra_largenone
|
--module
| A module name of your own |
What it generates
mix mishka.ui.gen.component mega_menu
