Menu

v0.0.10

v0.0.10StableComponentStatelessApache-2.0
Installation mix mishka.ui.gen.component menu
Source View Source

Overview of the Phoenix and LiveView Menu Component

The Mishka Chelekom Menu component is a Phoenix LiveView component designed to help developers create dynamic, hierarchical menu structures. This component acts as a wrapper for menu items and supports both simple navigation menus and more complex, multi-level systems with nested sub-menus.

Overview of the Phoenix and LiveView Menu Component

This Phoenix LiveView component allows developers to customize the appearance and layout of their menus, including padding, spacing, and nested accordions. With flexible configuration options, developers can easily build responsive and visually appealing navigation systems for their Phoenix applications.

Padding prop of Phoenix LiveView menu component

The padding prop in the menu component allows developers to adjust the spacing around items within the menu. Available options include extra_small, small, medium, large, and extra_large. There's also a none option for removing padding entirely. These options provide flexibility in menu design and layout.

Padding prop of Phoenix LiveView menu component

heex
<.menu padding="extra_small"></.menu>
<.menu padding="small"></.menu>
<.menu padding="medium"></.menu>
<.menu padding="large"></.menu>
<.menu padding="extra_large"></.menu>

space prop of Phoenix LiveView menu component

The space prop in the menu component controls the spacing between menu items. Available options include extra_small, small, medium, large, and extra_large. This prop allows developers to define how much vertical space is applied between the items, enhancing the layout flexibility within the menu.

space prop of Phoenix LiveView menu component

heex
<.menu space="extra_small"></.menu>
<.menu space="small"></.menu>
<.menu space="medium"></.menu>
<.menu space="large"></.menu>
<.menu space="extra_large"></.menu>

How to create collapsible menu

If you're looking to create a collapsible menu, you can utilize the Mishka Chelekom accordion component. This versatile tool allows you to organize menu items into expandable sections, providing a cleaner and more structured navigation experience. By integrating the accordion into your menu, you can present content in a space-efficient way, allowing users to expand and collapse sections as needed. This is especially useful for handling multiple levels of nested content or when displaying complex information hierarchies.

How to create collapsible menu

heex
<!--Choose any color for buttons and accordion as -->
<.menu space="small">
  <li>
    <.button_link variant="transparent" navigate="/path">Dashboard</.button_link>
  </li>

  <li>
    <.button_link variant="transparent" navigate="/path">Footer</.button_link>
  </li>

  <li>
    <.accordion id="unique_id" variant="transparent" padding="small">
      <:item title="Settings">
      <.button_link variant="transparent" navigate="/path">Account</.button_link>
      </:item>
    </.accordion>
  </li>

  <li>
    <.button_link variant="transparent" navigate="/path">Modal</.button_link>
  </li>

  <li>
    <.button_link variant="transparent" navigate="/path">List</.button_link>
  </li>
</.menu>