Skip to main content

Menu Component

warning

Components is not ready yet.

Figma

The glu-menu component is a flexible navigation component that supports multiple layouts and responsive behavior. It provides three main layout types and adapts to mobile views automatically when is-responsive is enabled.


Basic Usage

Example 1: Logo-Left Layout

Result
Loading...
Live Editor
<glu-menu type="logo-left" is-sticky>
  <img src="https://placehold.jp/120x40.png" slot="logo" alt="Logo" width="120" />

  <div slot="menu-items">
    <glu-menu-item href="#" type="label">Home</glu-menu-item>
    <glu-menu-item href="#" type="label">About</glu-menu-item>
    <glu-menu-item href="#" type="label">Contact</glu-menu-item>
  </div>

  <div slot="right-actions">
    <glu-menu-item href="#" type="button">Login</glu-menu-item>
  </div>
</glu-menu>

Layout Types

Logo-Center Layout

Result
Loading...
Live Editor
<glu-menu type="logo-center">
  <img src="https://placehold.jp/150x50.png" slot="logo" alt="Logo" width="150" />

  <div slot="menu-items">
    <glu-menu-item type="label">Products</glu-menu-item>
    <glu-menu-item type="label">Solutions</glu-menu-item>
  </div>

  <div slot="right-actions">
    <glu-menu-item type="button">Contact</glu-menu-item>
  </div>
</glu-menu>
Result
Loading...
Live Editor
<glu-menu type="menu-center" is-sticky>
  <img src="https://placehold.jp/100x40.png" slot="logo" alt="Logo" width="100" />

  <div slot="menu-items">
    <glu-menu-item type="label">Home</glu-menu-item>
    <glu-menu-item type="label">Resources</glu-menu-item>
  </div>

  <div slot="right-actions">
    <glu-menu-item type="button">Search</glu-menu-item>
  </div>
</glu-menu>

Responsive Behavior

Result
Loading...
Live Editor
<glu-menu type="logo-left" is-responsive>
  <img src="https://placehold.jp/120x40.png" slot="logo" alt="Logo" width="120" />

  <div slot="menu-items">
    <glu-menu-item type="label">Home</glu-menu-item>
    <glu-menu-item type="label">About</glu-menu-item>
    <glu-menu-item type="label">Contact</glu-menu-item>
  </div>

  <div slot="right-actions">
    <glu-menu-item type="button">Login</glu-menu-item>
  </div>
</glu-menu>

Props

PropTypeDefaultDescription
type`'logo-left''logo-center''menu-center'`
logostring-URL for the logo image (overrides logo slot)
is-stickybooleanfalseMakes the menu stick to the top of the viewport
is-responsivebooleanfalseEnables mobile-responsive behavior

Slots

NameDescription
logoContent for the logo section (overridden by logo prop if set)
menu-itemsMain navigation items for the menu
right-actionsAdditional actions or buttons displayed on the right side

Examples

Using Logo Prop

Result
Loading...
Live Editor
<glu-menu type="logo-left" logo="https://placehold.jp/120x40.png" is-responsive>
  <div slot="menu-items">
    <glu-menu-item type="label">Home</glu-menu-item>
    <glu-menu-item type="label">About</glu-menu-item>
  </div>

  <div slot="right-actions">
    <glu-menu-item type="button">Sign In</glu-menu-item>
  </div>
</glu-menu>

Complex Navigation

Result
Loading...
Live Editor
<glu-menu type="logo-center" is-sticky is-responsive>
  <img src="https://placehold.jp/150x50.png" slot="logo" alt="Logo" width="150" />

  <div slot="menu-items">
    <glu-menu-item type="dropdown">
      Products
      <div slot="dropdown-content">
        <glu-menu-item type="label">Hardware</glu-menu-item>
        <glu-menu-item type="label">Software</glu-menu-item>
      </div>
    </glu-menu-item>
    <glu-menu-item type="label">Solutions</glu-menu-item>
  </div>

  <div slot="right-actions">
    <glu-menu-item type="button">Contact Sales</glu-menu-item>
    <glu-menu-item type="button">Support</glu-menu-item>
  </div>
</glu-menu>

Properties

PropertyAttributeDescriptionTypeDefault
isResponsiveis-responsiveIf true, the menu adapts for smaller screens by enabling mobile-friendly behavior.booleanfalse
isStickyis-stickyIf true, the menu will be fixed at the top of the viewport.booleanfalse
logologoURL for the logo image. If set, it takes precedence over the logo slot.stringundefined
typetypeDefines the menu layout type. - logo-left: Logo on the left, menu items in the center, right actions on the right. - logo-center: Menu items on the left, logo in the center, right actions on the right. - menu-center: Logo on the left, menu items in the center, right actions on the right."logo-center" | "logo-left" | "menu-center"'logo-left'

Slots

SlotDescription
"logo"Slot for custom logo content (used when logo prop is not set).
"menu-items"Slot for the menu items to be displayed.
"right-actions"Slot for additional actions or buttons aligned to the right.

CSS Custom Properties

NameDescription
--glu-menu-backgroundBackground color of the menu.
--glu-menu-border-colorBorder color for the menu.
--glu-menu-logo-max-heightMaximum height for the logo.
--glu-menu-logo-max-widthMaximum width for the logo.
--glu-menu-min-heightMinimum height of the menu (desktop).
--glu-menu-mobile-breakpointBreakpoint for mobile view.
--glu-menu-mobile-heightHeight of the menu on mobile devices.
--glu-menu-mobile-menu-bgBackground color for the mobile menu.
--glu-menu-paddingPadding inside the menu.
--glu-menu-shadowShadow effect for the menu.
--glu-menu-toggle-colorColor for the mobile menu toggle icon.
--glu-menu-transitionTransition timing for animations.
--glu-menu-z-indexZ-index for the menu to ensure it stays on top.

Built with StencilJS