Skip to content

feat(component-library): implement mt-nav component - #1386

Merged
Alastair Fraser (alastair-simon) merged 58 commits into
mainfrom
feat/implement-mt-nav-component
Oct 9, 2026
Merged

Alastair Fraser (alastair-simon) merged 58 commits into
mainfrom
feat/implement-mt-nav-component

Conversation

@alastair-simon

@alastair-simon Alastair Fraser (alastair-simon) commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds mt-nav, a sidebar navigation component for Shopware apps.

Why

Every Shopware app built its own nav menu, each slightly different. A shared component:

  • makes the menu look and behave the same everywhere
  • solves the fiddly parts once (which branch opens, hidden active rows, keyboard focus)
  • is accessible by default
  • does not depend on a specific router

How

Structure

The app passes the menu as data through the sections prop. mt-nav is the only public component; it renders two internal parts:

  • mt-nav-section: a group of rows below an optional header
  • mt-nav-item: one row, which nests through children (up to three levels)

What a row renders depends on its fields:

  • to: a link through linkComponent (router-link by default)
  • href: a plain anchor, with an external-link icon and a screen reader hint when it opens in a new tab
  • children and no to: a folder button that opens and closes its rows

Props, events and slots

  • sections: the menu data (NavSection[])
  • linkComponent: the component used for to links
  • label: accessible name of the landmark, defaults to a translated "Main navigation"
  • isActive: a function that decides which row is the current page, so sections can stay static. Setting active on a row also works.
  • navigate event: emitted on link clicks, not on folder toggles
  • suffix slot: rendered after each row label, e.g. for a badge or counter

Behaviour

  • Active page: the active row is highlighted, the branch holding it opens and the others close
  • Hidden active rows: a closed folder takes over the highlight of an active row inside it
  • Open branches: only one top-level branch is open at a time; nested folders remember their own open state
  • Keyboard: arrow keys move focus between visible links, Home and End jump to the first and last, no wrapping
  • Layout: fills its container, scrolls internally and fades at the top and bottom edges; there is no collapsed mode
  • Translations: English and German

Rows are told apart by an optional id, falling back to the label.

@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
meteor-docs Ready Ready Preview Oct 9, 2026 2:42pm UTC
meteor-storybook Ready Ready Preview Oct 9, 2026 2:42pm UTC

Request Review

fabianhueske

This comment was marked as resolved.

Comment thread packages/component-library/src/components/mt-nav/_internal/mt-nav-context.ts Outdated
Comment thread packages/component-library/src/components/mt-nav/_internal/mt-nav-item.vue Outdated
Comment thread packages/component-library/src/components/mt-nav/mt-nav.vue
Comment thread packages/component-library/src/components/mt-nav/mt-nav.vue
Comment thread packages/component-library/src/components/mt-nav/_internal/mt-nav-item.vue Outdated
Comment thread packages/component-library/src/components/mt-nav/_internal/mt-nav-item.vue Outdated
Comment thread packages/component-library/src/components/mt-nav/_internal/mt-nav-item.vue Outdated
Comment thread packages/component-library/src/components/mt-nav/mt-nav.interactive.stories.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@shopware-ag/meteor-admin-sdk

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-admin-sdk@1386

@shopware-ag/meteor-component-library

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-component-library@1386

@shopware-ag/create-meteor-extension

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/create-meteor-extension@1386

@shopware-ag/meteor-icon-kit

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-icon-kit@1386

@shopware-ag/meteor-prettier-config

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-prettier-config@1386

@shopware-ag/stylelint-plugin-meteor

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/stylelint-plugin-meteor@1386

@shopware-ag/meteor-tokens

npm i https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-tokens@1386

commit: 834526a

@alastair-simon
Alastair Fraser (alastair-simon) merged commit 8ec5a71 into main Oct 9, 2026
11 checks passed
@alastair-simon
Alastair Fraser (alastair-simon) deleted the feat/implement-mt-nav-component branch October 9, 2026 15:03

This branch was successfully deployed

2 active deployments
Preview – meteor-docs — 3f2c4cdd Deployed Oct 9, 2026 by vercel[bot]
Preview – meteor-storybook — 3f2c4cdd Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants