@maz-ui/mcp 5.0.1-beta.0 → 5.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -228
- package/bin/maz-ui-mcp.mjs +2 -5
- package/dist/cli.d.mts +7 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.mjs +14 -0
- package/dist/index.d.mts +340 -0
- package/dist/index.d.ts +340 -0
- package/dist/index.mjs +14 -0
- package/dist/shared/mcp.DzqVbCaL.mjs +2346 -0
- package/docs/README.md +207 -0
- package/docs/agents/agents-md.md +52 -0
- package/docs/agents/claude-rule.md +52 -0
- package/docs/components/maz-accordion.md +76 -0
- package/docs/{src/components → components}/maz-alert.md +31 -164
- package/docs/components/maz-animated-counter.md +87 -0
- package/docs/components/maz-animated-element.md +46 -0
- package/docs/components/maz-animated-text.md +53 -0
- package/docs/components/maz-avatar.md +193 -0
- package/docs/components/maz-backdrop.md +178 -0
- package/docs/{src/components → components}/maz-badge.md +26 -67
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/{src/components → components}/maz-btn-group.md +26 -189
- package/docs/{src/components → components}/maz-btn.md +60 -245
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/{src/components → components}/maz-card.md +67 -192
- package/docs/components/maz-carousel.md +153 -0
- package/docs/{src/components → components}/maz-chart.md +17 -161
- package/docs/components/maz-checkbox.md +138 -0
- package/docs/components/maz-checklist.md +251 -0
- package/docs/components/maz-circular-progress-bar.md +109 -0
- package/docs/{src/components → components}/maz-code-highlight.md +15 -93
- package/docs/components/maz-container.md +241 -0
- package/docs/{src/components → components}/maz-date-picker.md +85 -454
- package/docs/components/maz-dialog-confirm.md +215 -0
- package/docs/components/maz-dialog.md +143 -0
- package/docs/components/maz-drawer.md +106 -0
- package/docs/components/maz-dropdown.md +419 -0
- package/docs/{src/components → components}/maz-dropzone.md +80 -221
- package/docs/components/maz-expand-animation.md +82 -0
- package/docs/components/maz-fullscreen-loader.md +58 -0
- package/docs/components/maz-gallery.md +79 -0
- package/docs/{src/components → components}/maz-icon.md +32 -83
- package/docs/components/maz-input-code.md +73 -0
- package/docs/components/maz-input-number.md +79 -0
- package/docs/components/maz-input-phone-number.md +536 -0
- package/docs/components/maz-input-price.md +68 -0
- package/docs/components/maz-input-tags.md +112 -0
- package/docs/{src/components → components}/maz-input.md +74 -221
- package/docs/components/maz-lazy-img.md +113 -0
- package/docs/components/maz-link.md +146 -0
- package/docs/components/maz-loading-bar.md +38 -0
- package/docs/{src/components → components}/maz-markdown-editor.md +72 -125
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/{src/components → components}/maz-pull-to-refresh.md +59 -45
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/{src/components → components}/maz-read-more.md +31 -122
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/{src/components → components}/maz-select-country.md +80 -340
- package/docs/{src/components → components}/maz-select.md +76 -206
- package/docs/components/maz-sidebar-content.md +25 -0
- package/docs/components/maz-sidebar-footer.md +25 -0
- package/docs/components/maz-sidebar-group.md +27 -0
- package/docs/components/maz-sidebar-header.md +25 -0
- package/docs/components/maz-sidebar-menu-button.md +41 -0
- package/docs/components/maz-sidebar-menu-item.md +25 -0
- package/docs/components/maz-sidebar-menu-sub.md +32 -0
- package/docs/components/maz-sidebar-menu.md +25 -0
- package/docs/components/maz-sidebar-separator.md +21 -0
- package/docs/components/maz-sidebar-trigger.md +25 -0
- package/docs/{src/components → components}/maz-sidebar.md +117 -329
- package/docs/{src/components → components}/maz-skeleton.md +27 -156
- package/docs/{src/components → components}/maz-slider.md +33 -66
- package/docs/components/maz-spinner.md +84 -0
- package/docs/{src/components → components}/maz-stepper.md +43 -185
- package/docs/components/maz-switch.md +86 -0
- package/docs/components/maz-table-cell.md +27 -0
- package/docs/components/maz-table-row.md +28 -0
- package/docs/components/maz-table-title.md +27 -0
- package/docs/components/maz-table-virtualizer.md +31 -0
- package/docs/components/maz-table.md +426 -0
- package/docs/components/maz-tabs-bar.md +43 -0
- package/docs/components/maz-tabs-content-item.md +27 -0
- package/docs/components/maz-tabs-content.md +27 -0
- package/docs/{src/components → components}/maz-tabs.md +89 -126
- package/docs/components/maz-textarea.md +255 -0
- package/docs/components/maz-ticker.md +427 -0
- package/docs/components/maz-timeline.md +304 -0
- package/docs/components/maz-ui-provider.md +26 -0
- package/docs/{src/components → components}/maz-window-mockup.md +38 -105
- package/docs/composables/use-aos.md +41 -0
- package/docs/composables/use-breakpoints.md +42 -0
- package/docs/composables/use-dialog.md +58 -0
- package/docs/{src/composables → composables}/use-display-names.md +12 -59
- package/docs/{src/composables → composables}/use-drag.md +14 -68
- package/docs/{src/composables → composables}/use-form-validator.md +22 -696
- package/docs/{src/composables → composables}/use-idle-timeout.md +13 -97
- package/docs/{src/composables → composables}/use-pull-to-refresh.md +14 -7
- package/docs/{src/composables → composables}/use-reading-time.md +20 -56
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/{src/composables → composables}/use-swipe.md +14 -81
- package/docs/{src/composables → composables}/use-timer.md +12 -38
- package/docs/composables/use-toast.md +50 -0
- package/docs/{src/composables → composables}/use-user-visibility.md +14 -56
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/{src/directives → directives}/click-outside.md +13 -99
- package/docs/{src/directives → directives}/fullscreen-img.md +10 -28
- package/docs/{src/directives → directives}/lazy-img.md +14 -49
- package/docs/{src/directives → directives}/tooltip.md +12 -217
- package/docs/{src/directives → directives}/zoom-img.md +11 -38
- package/docs/{src/ecosystem → ecosystem}/eslint-config.md +37 -29
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/{src/ecosystem → ecosystem}/icons/index.md +22 -16
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/{src/ecosystem → ecosystem}/node/exec-promise.md +12 -6
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/{src/ecosystem → ecosystem}/node/logger.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/node/print-banner.md +12 -4
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/{src/ecosystem → ecosystem}/nuxt.md +46 -19
- package/docs/{src/ecosystem → ecosystem}/stylelint-config.md +33 -25
- package/docs/{src/ecosystem → ecosystem}/themes.md +72 -235
- package/docs/{src/ecosystem → ecosystem}/translations.md +25 -23
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/check-availability.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/cookie.md +18 -12
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/{src/ecosystem → ecosystem}/utils/currency.md +12 -26
- package/docs/{src/ecosystem → ecosystem}/utils/date.md +10 -24
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/{src/ecosystem → ecosystem}/utils/debounce-id.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/debounce.md +14 -8
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/{src/ecosystem → ecosystem}/utils/format-json.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/format-phone-number.md +12 -6
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/{src/ecosystem → ecosystem}/utils/get-error-message.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/idle-timeout.md +15 -9
- package/docs/{src/ecosystem → ecosystem}/utils/index.md +10 -13
- package/docs/{src/ecosystem → ecosystem}/utils/is-client.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/is-equal.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/is-ios.md +12 -6
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/{src/ecosystem → ecosystem}/utils/kebab-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/normalize-string.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/number.md +10 -24
- package/docs/{src/ecosystem → ecosystem}/utils/pascal-case.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/prevent-ios-input-zoom.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/script-loader.md +16 -8
- package/docs/{src/ecosystem → ecosystem}/utils/sleep.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/snake-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/swipe-handler.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/textarea-autogrow.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/utils/throttle-id.md +13 -7
- package/docs/{src/ecosystem → ecosystem}/utils/throttle.md +14 -8
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-key-of.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-partial.md +10 -4
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/generic-instance-type.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/types/infer-maybe-ref.md +10 -4
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/{src/ecosystem → ecosystem}/utils/user-visibility.md +12 -6
- package/docs/guide/ai-agents.md +237 -0
- package/docs/{src/guide → guide}/browser-support.md +22 -15
- package/docs/{src/guide → guide}/getting-started.md +34 -139
- package/docs/{src/guide → guide}/global-defaults.md +12 -11
- package/docs/{src/guide → guide}/maz-ui-provider.md +17 -16
- package/docs/{src/guide → guide}/migration-v5.md +95 -88
- package/docs/{src/guide → guide}/resolvers.md +33 -100
- package/docs/guide/tailwind.md +483 -0
- package/docs/{src/guide → guide}/vue.md +33 -39
- package/docs/manifest.json +1 -0
- package/docs/{src/plugins → plugins}/aos.md +20 -55
- package/docs/{src/plugins → plugins}/dialog.md +14 -161
- package/docs/plugins/toast.md +221 -0
- package/docs/plugins/wait.md +78 -0
- package/docs/reference/icons.md +46 -0
- package/docs/reference/tailwind-tokens.md +191 -0
- package/docs/rules.md +57 -0
- package/package.json +84 -22
- package/dist/mcp.d.mts +0 -153
- package/dist/mcp.d.ts +0 -153
- package/dist/mcp.mjs +0 -1511
- package/docs/generated-docs/maz-accordion.doc.md +0 -21
- package/docs/generated-docs/maz-alert.doc.md +0 -20
- package/docs/generated-docs/maz-animated-counter.doc.md +0 -17
- package/docs/generated-docs/maz-animated-element.doc.md +0 -14
- package/docs/generated-docs/maz-animated-text.doc.md +0 -17
- package/docs/generated-docs/maz-avatar.doc.md +0 -45
- package/docs/generated-docs/maz-backdrop.doc.md +0 -55
- package/docs/generated-docs/maz-badge.doc.md +0 -16
- package/docs/generated-docs/maz-bottom-sheet.doc.md +0 -24
- package/docs/generated-docs/maz-btn-group.doc.md +0 -20
- package/docs/generated-docs/maz-btn.doc.md +0 -33
- package/docs/generated-docs/maz-card-spotlight.doc.md +0 -16
- package/docs/generated-docs/maz-card.doc.md +0 -39
- package/docs/generated-docs/maz-carousel.doc.md +0 -17
- package/docs/generated-docs/maz-chart.doc.md +0 -10
- package/docs/generated-docs/maz-checkbox.doc.md +0 -33
- package/docs/generated-docs/maz-checklist.doc.md +0 -30
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +0 -27
- package/docs/generated-docs/maz-code-highlight.doc.md +0 -11
- package/docs/generated-docs/maz-container.doc.md +0 -26
- package/docs/generated-docs/maz-date-picker.doc.md +0 -56
- package/docs/generated-docs/maz-dialog-confirm.doc.md +0 -24
- package/docs/generated-docs/maz-dialog.doc.md +0 -22
- package/docs/generated-docs/maz-drawer.doc.md +0 -25
- package/docs/generated-docs/maz-dropdown.doc.md +0 -45
- package/docs/generated-docs/maz-dropzone.doc.md +0 -82
- package/docs/generated-docs/maz-expand-animation.doc.md +0 -12
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +0 -13
- package/docs/generated-docs/maz-gallery.doc.md +0 -17
- package/docs/generated-docs/maz-icon.doc.md +0 -16
- package/docs/generated-docs/maz-input-code.doc.md +0 -25
- package/docs/generated-docs/maz-input-number.doc.md +0 -33
- package/docs/generated-docs/maz-input-phone-number.doc.md +0 -62
- package/docs/generated-docs/maz-input-price.doc.md +0 -26
- package/docs/generated-docs/maz-input-tags.doc.md +0 -24
- package/docs/generated-docs/maz-input.doc.md +0 -54
- package/docs/generated-docs/maz-lazy-img.doc.md +0 -49
- package/docs/generated-docs/maz-link.doc.md +0 -31
- package/docs/generated-docs/maz-loading-bar.doc.md +0 -6
- package/docs/generated-docs/maz-markdown-editor.doc.md +0 -65
- package/docs/generated-docs/maz-pagination.doc.md +0 -21
- package/docs/generated-docs/maz-popover.doc.md +0 -79
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +0 -50
- package/docs/generated-docs/maz-radio-buttons.doc.md +0 -34
- package/docs/generated-docs/maz-radio.doc.md +0 -33
- package/docs/generated-docs/maz-read-more.doc.md +0 -18
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +0 -18
- package/docs/generated-docs/maz-select-country.doc.md +0 -45
- package/docs/generated-docs/maz-select.doc.md +0 -32
- package/docs/generated-docs/maz-sidebar-content.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-footer.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-group.doc.md +0 -11
- package/docs/generated-docs/maz-sidebar-header.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +0 -27
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +0 -16
- package/docs/generated-docs/maz-sidebar-menu.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar.doc.md +0 -36
- package/docs/generated-docs/maz-skeleton.doc.md +0 -12
- package/docs/generated-docs/maz-slider.doc.md +0 -20
- package/docs/generated-docs/maz-spinner.doc.md +0 -6
- package/docs/generated-docs/maz-stepper.doc.md +0 -30
- package/docs/generated-docs/maz-switch.doc.md +0 -31
- package/docs/generated-docs/maz-table-cell.doc.md +0 -5
- package/docs/generated-docs/maz-table-row.doc.md +0 -12
- package/docs/generated-docs/maz-table-title.doc.md +0 -5
- package/docs/generated-docs/maz-table-virtualizer.doc.md +0 -20
- package/docs/generated-docs/maz-table.doc.md +0 -72
- package/docs/generated-docs/maz-tabs-bar.doc.md +0 -29
- package/docs/generated-docs/maz-tabs-content-item.doc.md +0 -11
- package/docs/generated-docs/maz-tabs-content.doc.md +0 -5
- package/docs/generated-docs/maz-tabs.doc.md +0 -20
- package/docs/generated-docs/maz-textarea.doc.md +0 -46
- package/docs/generated-docs/maz-ticker.doc.md +0 -25
- package/docs/generated-docs/maz-timeline.doc.md +0 -32
- package/docs/generated-docs/maz-ui-provider.doc.md +0 -12
- package/docs/generated-docs/maz-window-mockup.doc.md +0 -23
- package/docs/src/blog/v4.md +0 -276
- package/docs/src/blog/v5.md +0 -184
- package/docs/src/changelog.md +0 -7
- package/docs/src/components/index.md +0 -8
- package/docs/src/components/maz-accordion.md +0 -80
- package/docs/src/components/maz-animated-counter.md +0 -124
- package/docs/src/components/maz-animated-element.md +0 -36
- package/docs/src/components/maz-animated-text.md +0 -36
- package/docs/src/components/maz-avatar.md +0 -227
- package/docs/src/components/maz-backdrop.md +0 -250
- package/docs/src/components/maz-bottom-sheet.md +0 -533
- package/docs/src/components/maz-card-spotlight.md +0 -163
- package/docs/src/components/maz-carousel.md +0 -231
- package/docs/src/components/maz-checkbox.md +0 -168
- package/docs/src/components/maz-checklist.md +0 -414
- package/docs/src/components/maz-circular-progress-bar.md +0 -145
- package/docs/src/components/maz-container.md +0 -363
- package/docs/src/components/maz-dialog-confirm.md +0 -240
- package/docs/src/components/maz-dialog.md +0 -164
- package/docs/src/components/maz-drawer.md +0 -181
- package/docs/src/components/maz-dropdown.md +0 -691
- package/docs/src/components/maz-expand-animation.md +0 -99
- package/docs/src/components/maz-fullscreen-loader.md +0 -58
- package/docs/src/components/maz-gallery.md +0 -85
- package/docs/src/components/maz-input-code.md +0 -61
- package/docs/src/components/maz-input-number.md +0 -81
- package/docs/src/components/maz-input-phone-number.md +0 -942
- package/docs/src/components/maz-input-price.md +0 -67
- package/docs/src/components/maz-input-tags.md +0 -114
- package/docs/src/components/maz-lazy-img.md +0 -88
- package/docs/src/components/maz-link.md +0 -178
- package/docs/src/components/maz-loading-bar.md +0 -26
- package/docs/src/components/maz-pagination.md +0 -79
- package/docs/src/components/maz-popover.md +0 -1416
- package/docs/src/components/maz-radio-buttons.md +0 -462
- package/docs/src/components/maz-radio.md +0 -142
- package/docs/src/components/maz-reading-progress-bar.md +0 -74
- package/docs/src/components/maz-spinner.md +0 -93
- package/docs/src/components/maz-switch.md +0 -92
- package/docs/src/components/maz-table.md +0 -732
- package/docs/src/components/maz-textarea.md +0 -400
- package/docs/src/components/maz-ticker.md +0 -692
- package/docs/src/components/maz-timeline.md +0 -478
- package/docs/src/composables/use-aos.md +0 -34
- package/docs/src/composables/use-breakpoints.md +0 -35
- package/docs/src/composables/use-dialog.md +0 -88
- package/docs/src/composables/use-string-matching.md +0 -63
- package/docs/src/composables/use-toast.md +0 -71
- package/docs/src/composables/use-wait.md +0 -62
- package/docs/src/composables/use-window-size.md +0 -18
- package/docs/src/ecosystem/icons/icon-set.md +0 -123
- package/docs/src/ecosystem/mcp.md +0 -210
- package/docs/src/ecosystem/node/index.md +0 -53
- package/docs/src/ecosystem/utils/camel-case.md +0 -31
- package/docs/src/ecosystem/utils/capitalize.md +0 -50
- package/docs/src/ecosystem/utils/country-code-to-unicode-flag.md +0 -213
- package/docs/src/ecosystem/utils/debounce-callback.md +0 -38
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +0 -33
- package/docs/src/ecosystem/utils/get-browser-locale.md +0 -29
- package/docs/src/ecosystem/utils/get-country-flag-url.md +0 -156
- package/docs/src/ecosystem/utils/is-server.md +0 -31
- package/docs/src/ecosystem/utils/is-standalone-mode.md +0 -43
- package/docs/src/ecosystem/utils/truthy-filter.md +0 -31
- package/docs/src/ecosystem/utils/types/deep-required.md +0 -39
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +0 -44
- package/docs/src/ecosystem/utils/upper-first.md +0 -32
- package/docs/src/guide/cli.md +0 -144
- package/docs/src/guide/migration-v4.md +0 -925
- package/docs/src/guide/tailwind.md +0 -158
- package/docs/src/index.md +0 -603
- package/docs/src/made-with-maz-ui.md +0 -58
- package/docs/src/plugins/toast.md +0 -349
- package/docs/src/plugins/wait.md +0 -109
- package/docs/src/theme-editor.md +0 -21
|
@@ -1,30 +1,37 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: MazSidebar
|
|
3
|
-
description: MazSidebar is a composable sidebar system for dashboard, admin, and SaaS applications. It provides a fully accessible, collapsible navigation with multiple display modes.
|
|
2
|
+
title: "MazSidebar"
|
|
3
|
+
description: "MazSidebar is a composable sidebar system for dashboard, admin, and SaaS applications. It provides a fully accessible, collapsible navigation with multiple display modes."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-sidebar"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# MazSidebar
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
> MazSidebar is a composable sidebar system for dashboard, admin, and SaaS applications. It provides a fully accessible, collapsible navigation with multiple display modes.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazSidebar from 'maz-ui/components/MazSidebar'` or `import MazSidebarMenuButton from 'maz-ui/components/MazSidebarMenuButton'` or `import MazSidebarMenuSub from 'maz-ui/components/MazSidebarMenuSub'` or `import MazSidebarGroup from 'maz-ui/components/MazSidebarGroup'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-sidebar
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
**Tip:**
|
|
11
20
|
|
|
12
|
-
::: tip
|
|
13
21
|
`MazSidebar` shares its state with all sub-components via Vue's `provide`/`inject`. No separate Provider component is needed. All sub-components must be descendants of `MazSidebar`.
|
|
14
|
-
:::
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
**Warning: Deferred features (v1.1)**
|
|
24
|
+
|
|
17
25
|
The following features are planned for a future release and are **not yet available**:
|
|
18
26
|
- `localStorage` state persistence
|
|
19
27
|
- `Cmd/Ctrl+B` keyboard shortcut
|
|
20
28
|
- Automatic mobile drawer under a breakpoint
|
|
21
|
-
:::
|
|
22
29
|
|
|
23
30
|
## Sub-components
|
|
24
31
|
|
|
25
32
|
| Component | Role |
|
|
26
33
|
| ---------------------- | --------------------------------------------------------------------- |
|
|
27
|
-
| `MazSidebar` | Root container
|
|
34
|
+
| `MazSidebar` | Root container - provides state context |
|
|
28
35
|
| `MazSidebarHeader` | Fixed top area |
|
|
29
36
|
| `MazSidebarContent` | Scrollable central area |
|
|
30
37
|
| `MazSidebarFooter` | Fixed bottom area |
|
|
@@ -38,36 +45,11 @@ The following features are planned for a future release and are **not yet availa
|
|
|
38
45
|
|
|
39
46
|
## Basic usage
|
|
40
47
|
|
|
41
|
-
<ComponentDemo>
|
|
42
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[25rem] maz:flex">
|
|
43
|
-
<MazSidebar v-model:open="basicOpen" class="maz:h-full">
|
|
44
|
-
<MazSidebarHeader>
|
|
45
|
-
<div class="maz:p-4 maz:font-bold">My App</div>
|
|
46
|
-
</MazSidebarHeader>
|
|
47
|
-
<MazSidebarContent>
|
|
48
|
-
<MazSidebarMenu>
|
|
49
|
-
<MazSidebarMenuItem>
|
|
50
|
-
<MazSidebarMenuButton label="Dashboard" :active="true" />
|
|
51
|
-
</MazSidebarMenuItem>
|
|
52
|
-
<MazSidebarMenuItem>
|
|
53
|
-
<MazSidebarMenuButton label="Settings" />
|
|
54
|
-
</MazSidebarMenuItem>
|
|
55
|
-
</MazSidebarMenu>
|
|
56
|
-
</MazSidebarContent>
|
|
57
|
-
<MazSidebarFooter>
|
|
58
|
-
<div class="maz:p-4">Footer</div>
|
|
59
|
-
</MazSidebarFooter>
|
|
60
|
-
</MazSidebar>
|
|
61
|
-
<main class="maz:flex-1 maz:p-4">Main content</main>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<template #code>
|
|
65
|
-
|
|
66
48
|
```html
|
|
67
|
-
<div class="
|
|
49
|
+
<div class="flex h-screen">
|
|
68
50
|
<MazSidebar v-model:open="isOpen">
|
|
69
51
|
<MazSidebarHeader>
|
|
70
|
-
<div class="
|
|
52
|
+
<div class="p-4 font-bold">My App</div>
|
|
71
53
|
</MazSidebarHeader>
|
|
72
54
|
<MazSidebarContent>
|
|
73
55
|
<MazSidebarMenu>
|
|
@@ -80,10 +62,10 @@ The following features are planned for a future release and are **not yet availa
|
|
|
80
62
|
</MazSidebarMenu>
|
|
81
63
|
</MazSidebarContent>
|
|
82
64
|
<MazSidebarFooter>
|
|
83
|
-
<div class="
|
|
65
|
+
<div class="p-4">Footer</div>
|
|
84
66
|
</MazSidebarFooter>
|
|
85
67
|
</MazSidebar>
|
|
86
|
-
<main class="
|
|
68
|
+
<main class="flex-1 p-4">Main content</main>
|
|
87
69
|
</div>
|
|
88
70
|
|
|
89
71
|
<script setup>
|
|
@@ -91,43 +73,8 @@ const isOpen = ref(true)
|
|
|
91
73
|
</script>
|
|
92
74
|
```
|
|
93
75
|
|
|
94
|
-
</template>
|
|
95
|
-
</ComponentDemo>
|
|
96
|
-
|
|
97
76
|
## Groups & dividers
|
|
98
77
|
|
|
99
|
-
<ComponentDemo>
|
|
100
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[25rem] maz:flex">
|
|
101
|
-
<MazSidebar v-model:open="groupsOpen" class="maz:h-full">
|
|
102
|
-
<MazSidebarContent>
|
|
103
|
-
<MazSidebarGroup label="Navigation">
|
|
104
|
-
<MazSidebarMenu>
|
|
105
|
-
<MazSidebarMenuItem>
|
|
106
|
-
<MazSidebarMenuButton label="Dashboard" :active="true" />
|
|
107
|
-
</MazSidebarMenuItem>
|
|
108
|
-
<MazSidebarMenuItem>
|
|
109
|
-
<MazSidebarMenuButton label="Projects" />
|
|
110
|
-
</MazSidebarMenuItem>
|
|
111
|
-
</MazSidebarMenu>
|
|
112
|
-
</MazSidebarGroup>
|
|
113
|
-
<MazSidebarSeparator />
|
|
114
|
-
<MazSidebarGroup label="Settings">
|
|
115
|
-
<MazSidebarMenu>
|
|
116
|
-
<MazSidebarMenuItem>
|
|
117
|
-
<MazSidebarMenuButton label="Profile" />
|
|
118
|
-
</MazSidebarMenuItem>
|
|
119
|
-
<MazSidebarMenuItem>
|
|
120
|
-
<MazSidebarMenuButton label="Billing" />
|
|
121
|
-
</MazSidebarMenuItem>
|
|
122
|
-
</MazSidebarMenu>
|
|
123
|
-
</MazSidebarGroup>
|
|
124
|
-
</MazSidebarContent>
|
|
125
|
-
</MazSidebar>
|
|
126
|
-
<main class="maz:flex-1 maz:p-4">Main content</main>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<template #code>
|
|
130
|
-
|
|
131
78
|
```html
|
|
132
79
|
<MazSidebar v-model:open="isOpen">
|
|
133
80
|
<MazSidebarContent>
|
|
@@ -153,44 +100,8 @@ const isOpen = ref(true)
|
|
|
153
100
|
</MazSidebar>
|
|
154
101
|
```
|
|
155
102
|
|
|
156
|
-
</template>
|
|
157
|
-
</ComponentDemo>
|
|
158
|
-
|
|
159
103
|
## Sub-menus
|
|
160
104
|
|
|
161
|
-
<ComponentDemo>
|
|
162
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[25rem] maz:flex">
|
|
163
|
-
<MazSidebar v-model:open="submenusOpen" class="maz:h-full">
|
|
164
|
-
<MazSidebarContent>
|
|
165
|
-
<MazSidebarMenu>
|
|
166
|
-
<MazSidebarMenuItem>
|
|
167
|
-
<MazSidebarMenuButton label="Dashboard" :active="true" />
|
|
168
|
-
</MazSidebarMenuItem>
|
|
169
|
-
<MazSidebarMenuItem>
|
|
170
|
-
<MazSidebarMenuSub label="Products" :default-open="true">
|
|
171
|
-
<MazSidebarMenuItem>
|
|
172
|
-
<MazSidebarMenuButton label="All Products" />
|
|
173
|
-
</MazSidebarMenuItem>
|
|
174
|
-
<MazSidebarMenuItem>
|
|
175
|
-
<MazSidebarMenuButton label="Add Product" />
|
|
176
|
-
</MazSidebarMenuItem>
|
|
177
|
-
</MazSidebarMenuSub>
|
|
178
|
-
</MazSidebarMenuItem>
|
|
179
|
-
<MazSidebarMenuItem>
|
|
180
|
-
<MazSidebarMenuSub label="Reports">
|
|
181
|
-
<MazSidebarMenuItem>
|
|
182
|
-
<MazSidebarMenuButton label="Sales" />
|
|
183
|
-
</MazSidebarMenuItem>
|
|
184
|
-
</MazSidebarMenuSub>
|
|
185
|
-
</MazSidebarMenuItem>
|
|
186
|
-
</MazSidebarMenu>
|
|
187
|
-
</MazSidebarContent>
|
|
188
|
-
</MazSidebar>
|
|
189
|
-
<main class="maz:flex-1 maz:p-4">Main content</main>
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
<template #code>
|
|
193
|
-
|
|
194
105
|
```html
|
|
195
106
|
<MazSidebar v-model:open="isOpen">
|
|
196
107
|
<MazSidebarContent>
|
|
@@ -210,9 +121,6 @@ const isOpen = ref(true)
|
|
|
210
121
|
</MazSidebar>
|
|
211
122
|
```
|
|
212
123
|
|
|
213
|
-
</template>
|
|
214
|
-
</ComponentDemo>
|
|
215
|
-
|
|
216
124
|
## Icon mode with tooltips
|
|
217
125
|
|
|
218
126
|
When `collapsible="icon"` and the sidebar is collapsed, labels fade out and only the icons stay visible. To help users identify items in collapsed state, provide a `tooltip` prop on each `MazSidebarMenuButton`: it uses the `v-tooltip` directive and is only shown on hover when the sidebar is collapsed by default.
|
|
@@ -221,8 +129,8 @@ When `collapsible="icon"` and the sidebar is collapsed, labels fade out and only
|
|
|
221
129
|
|
|
222
130
|
Both `MazSidebar` and `MazSidebarMenuButton` accept a `tooltip-mode` prop:
|
|
223
131
|
|
|
224
|
-
- `closed` (default on the sidebar)
|
|
225
|
-
- `always`
|
|
132
|
+
- `closed` (default on the sidebar) - tooltip only shows on hover when the sidebar is collapsed
|
|
133
|
+
- `always` - tooltip shows on hover regardless of the sidebar state
|
|
226
134
|
|
|
227
135
|
Set it on the sidebar to apply to every descendant button, or override per-button:
|
|
228
136
|
|
|
@@ -243,34 +151,9 @@ Set it on the sidebar to apply to every descendant button, or override per-butto
|
|
|
243
151
|
</MazSidebar>
|
|
244
152
|
```
|
|
245
153
|
|
|
246
|
-
|
|
247
|
-
When no `tooltip` prop is provided on a button, the `v-tooltip` directive is not attached at all — no listeners, no popover instance.
|
|
248
|
-
:::
|
|
249
|
-
|
|
250
|
-
<ComponentDemo>
|
|
251
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[25rem] maz:flex">
|
|
252
|
-
<MazSidebar v-model:open="iconModeOpen" collapsible="icon" class="maz:h-full">
|
|
253
|
-
<MazSidebarContent>
|
|
254
|
-
<MazSidebarMenu>
|
|
255
|
-
<MazSidebarMenuItem>
|
|
256
|
-
<MazSidebarMenuButton :icon="MazHome" label="Dashboard" tooltip="Go to Dashboard" :active="true" />
|
|
257
|
-
</MazSidebarMenuItem>
|
|
258
|
-
<MazSidebarMenuItem>
|
|
259
|
-
<MazSidebarMenuButton :icon="MazCog6Tooth" label="Settings" tooltip="Open Settings" />
|
|
260
|
-
</MazSidebarMenuItem>
|
|
261
|
-
</MazSidebarMenu>
|
|
262
|
-
</MazSidebarContent>
|
|
263
|
-
<MazSidebarFooter>
|
|
264
|
-
<MazSidebarTrigger />
|
|
265
|
-
</MazSidebarFooter>
|
|
266
|
-
</MazSidebar>
|
|
267
|
-
<main class="maz:flex-1 maz:flex maz:flex-col maz:gap-4 maz:p-4">
|
|
268
|
-
Click the trigger to collapse/expand
|
|
269
|
-
<MazBtn @click="iconModeOpen = !iconModeOpen">Toggle sidebar</MazBtn>
|
|
270
|
-
</main>
|
|
271
|
-
</div>
|
|
154
|
+
**Tip: Performance**
|
|
272
155
|
|
|
273
|
-
|
|
156
|
+
When no `tooltip` prop is provided on a button, the `v-tooltip` directive is not attached at all - no listeners, no popover instance.
|
|
274
157
|
|
|
275
158
|
```html
|
|
276
159
|
<script setup>
|
|
@@ -296,35 +179,13 @@ const isOpen = ref(true)
|
|
|
296
179
|
</template>
|
|
297
180
|
```
|
|
298
181
|
|
|
299
|
-
</template>
|
|
300
|
-
</ComponentDemo>
|
|
301
|
-
|
|
302
182
|
## Hover mode
|
|
303
183
|
|
|
304
184
|
`collapsible="hover"` displays the sidebar in icon-only mode and **automatically expands it when the mouse enters the sidebar (or any descendant) and collapses it when the mouse leaves**. Keyboard focus also expands the sidebar, so users navigating with `Tab` see the full labels.
|
|
305
185
|
|
|
306
|
-
|
|
307
|
-
This is a **purely visual** state. The `v-model:open` value is not updated and the persistence cookie is not written when the sidebar expands or collapses through hover. Use this mode when you want the rail-style sidebar of `collapsible="icon"` without exposing a toggle.
|
|
308
|
-
:::
|
|
309
|
-
|
|
310
|
-
<ComponentDemo>
|
|
311
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[22rem] maz:flex">
|
|
312
|
-
<MazSidebar collapsible="hover" class="maz:h-full">
|
|
313
|
-
<MazSidebarContent>
|
|
314
|
-
<MazSidebarMenu>
|
|
315
|
-
<MazSidebarMenuItem>
|
|
316
|
-
<MazSidebarMenuButton :icon="MazHome" label="Dashboard" :active="true" />
|
|
317
|
-
</MazSidebarMenuItem>
|
|
318
|
-
<MazSidebarMenuItem>
|
|
319
|
-
<MazSidebarMenuButton :icon="MazCog6Tooth" label="Settings" />
|
|
320
|
-
</MazSidebarMenuItem>
|
|
321
|
-
</MazSidebarMenu>
|
|
322
|
-
</MazSidebarContent>
|
|
323
|
-
</MazSidebar>
|
|
324
|
-
<main class="maz:flex-1 maz:p-4">Move your cursor over the sidebar to expand it.</main>
|
|
325
|
-
</div>
|
|
186
|
+
**Tip:**
|
|
326
187
|
|
|
327
|
-
|
|
188
|
+
This is a **purely visual** state. The `v-model:open` value is not updated and the persistence cookie is not written when the sidebar expands or collapses through hover. Use this mode when you want the rail-style sidebar of `collapsible="icon"` without exposing a toggle.
|
|
328
189
|
|
|
329
190
|
```html
|
|
330
191
|
<MazSidebar collapsible="hover">
|
|
@@ -341,71 +202,19 @@ This is a **purely visual** state. The `v-model:open` value is not updated and t
|
|
|
341
202
|
</MazSidebar>
|
|
342
203
|
```
|
|
343
204
|
|
|
344
|
-
</template>
|
|
345
|
-
</ComponentDemo>
|
|
346
|
-
|
|
347
205
|
## Offcanvas mode
|
|
348
206
|
|
|
349
|
-
<ComponentDemo>
|
|
350
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[20rem] maz:flex">
|
|
351
|
-
<MazSidebar v-model:open="offcanvasOpen" collapsible="offcanvas" class="maz:h-full">
|
|
352
|
-
<MazSidebarContent>
|
|
353
|
-
<MazSidebarMenu>
|
|
354
|
-
<MazSidebarMenuItem>
|
|
355
|
-
<MazSidebarMenuButton label="Home" :active="true" />
|
|
356
|
-
</MazSidebarMenuItem>
|
|
357
|
-
<MazSidebarMenuItem>
|
|
358
|
-
<MazSidebarMenuButton label="About" />
|
|
359
|
-
</MazSidebarMenuItem>
|
|
360
|
-
</MazSidebarMenu>
|
|
361
|
-
</MazSidebarContent>
|
|
362
|
-
</MazSidebar>
|
|
363
|
-
<main class="maz:flex-1 maz:flex maz:flex-col maz:gap-4 maz:p-4">
|
|
364
|
-
<MazBtn @click="offcanvasOpen = !offcanvasOpen">Toggle sidebar</MazBtn>
|
|
365
|
-
Main content — sidebar disappears completely when closed
|
|
366
|
-
</main>
|
|
367
|
-
</div>
|
|
368
|
-
|
|
369
|
-
<template #code>
|
|
370
|
-
|
|
371
207
|
```html
|
|
372
208
|
<MazSidebar v-model:open="isOpen" collapsible="offcanvas">
|
|
373
209
|
<!-- content -->
|
|
374
210
|
</MazSidebar>
|
|
375
211
|
```
|
|
376
212
|
|
|
377
|
-
</template>
|
|
378
|
-
</ComponentDemo>
|
|
379
|
-
|
|
380
213
|
## Overlay vs push mode
|
|
381
214
|
|
|
382
215
|
In `mode="push"` (default), the sidebar is part of the document flow and pushes the main content.
|
|
383
216
|
In `mode="overlay"`, the sidebar floats over the content with a backdrop, escape key support and focus trapping.
|
|
384
217
|
|
|
385
|
-
<ComponentDemo>
|
|
386
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[20rem] maz:relative">
|
|
387
|
-
<MazBtn class="maz:absolute maz:top-4 maz:left-4 maz:z-1" @click="overlayOpen = !overlayOpen">
|
|
388
|
-
Toggle overlay sidebar
|
|
389
|
-
</MazBtn>
|
|
390
|
-
<MazSidebar v-model:open="overlayOpen" mode="overlay">
|
|
391
|
-
<MazSidebarHeader>
|
|
392
|
-
<div class="maz:p-4 maz:font-bold">Overlay Sidebar</div>
|
|
393
|
-
</MazSidebarHeader>
|
|
394
|
-
<MazSidebarContent>
|
|
395
|
-
<MazSidebarMenu>
|
|
396
|
-
<MazSidebarMenuItem>
|
|
397
|
-
<MazSidebarMenuButton label="Home" :active="true" />
|
|
398
|
-
</MazSidebarMenuItem>
|
|
399
|
-
</MazSidebarMenu>
|
|
400
|
-
</MazSidebarContent>
|
|
401
|
-
<MazSidebarFooter>
|
|
402
|
-
<MazSidebarTrigger />
|
|
403
|
-
</MazSidebarFooter>
|
|
404
|
-
</MazSidebar>
|
|
405
|
-
</div>
|
|
406
|
-
|
|
407
|
-
<template #code>
|
|
408
|
-
|
|
409
218
|
```html
|
|
410
219
|
<!-- Overlay mode: sidebar floats over content -->
|
|
411
220
|
<MazSidebar v-model:open="isOpen" mode="overlay">
|
|
@@ -413,71 +222,21 @@ In `mode="overlay"`, the sidebar floats over the content with a backdrop, escape
|
|
|
413
222
|
</MazSidebar>
|
|
414
223
|
```
|
|
415
224
|
|
|
416
|
-
</template>
|
|
417
|
-
</ComponentDemo>
|
|
418
|
-
|
|
419
225
|
## Side end (right)
|
|
420
226
|
|
|
421
|
-
<ComponentDemo>
|
|
422
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[20rem] maz:flex">
|
|
423
|
-
<main class="maz:flex-1 maz:p-4">Main content</main>
|
|
424
|
-
<MazSidebar v-model:open="sideEndOpen" side="end" class="maz:h-full">
|
|
425
|
-
<MazSidebarContent>
|
|
426
|
-
<MazSidebarMenu>
|
|
427
|
-
<MazSidebarMenuItem>
|
|
428
|
-
<MazSidebarMenuButton label="Right panel item" />
|
|
429
|
-
</MazSidebarMenuItem>
|
|
430
|
-
</MazSidebarMenu>
|
|
431
|
-
</MazSidebarContent>
|
|
432
|
-
</MazSidebar>
|
|
433
|
-
</div>
|
|
434
|
-
|
|
435
|
-
<template #code>
|
|
436
|
-
|
|
437
227
|
```html
|
|
438
|
-
<div class="
|
|
439
|
-
<main class="
|
|
228
|
+
<div class="flex h-screen">
|
|
229
|
+
<main class="flex-1">Main content</main>
|
|
440
230
|
<MazSidebar v-model:open="isOpen" side="end">
|
|
441
231
|
<!-- content -->
|
|
442
232
|
</MazSidebar>
|
|
443
233
|
</div>
|
|
444
234
|
```
|
|
445
235
|
|
|
446
|
-
</template>
|
|
447
|
-
</ComponentDemo>
|
|
448
|
-
|
|
449
236
|
## Badges
|
|
450
237
|
|
|
451
238
|
`badge` accepts a `string`, a `number`, or a full `MazBadgeProps` object (with an optional `text`) to fine-tune color, size, outlined, etc.
|
|
452
239
|
|
|
453
|
-
<ComponentDemo>
|
|
454
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[22rem] maz:flex">
|
|
455
|
-
<MazSidebar v-model:open="badgesOpen" class="maz:h-full">
|
|
456
|
-
<MazSidebarContent>
|
|
457
|
-
<MazSidebarMenu>
|
|
458
|
-
<MazSidebarMenuItem>
|
|
459
|
-
<MazSidebarMenuButton label="Inbox" :badge="12" :active="true" />
|
|
460
|
-
</MazSidebarMenuItem>
|
|
461
|
-
<MazSidebarMenuItem>
|
|
462
|
-
<MazSidebarMenuButton label="Errors" :badge="{ text: 3, color: 'destructive' }" />
|
|
463
|
-
</MazSidebarMenuItem>
|
|
464
|
-
<MazSidebarMenuItem>
|
|
465
|
-
<MazSidebarMenuButton label="Beta" :badge="{ text: 'NEW', color: 'success', outlined: true }" />
|
|
466
|
-
</MazSidebarMenuItem>
|
|
467
|
-
<MazSidebarMenuItem>
|
|
468
|
-
<MazSidebarMenuButton label="Settings" />
|
|
469
|
-
</MazSidebarMenuItem>
|
|
470
|
-
</MazSidebarMenu>
|
|
471
|
-
</MazSidebarContent>
|
|
472
|
-
</MazSidebar>
|
|
473
|
-
<main class="maz:flex-1 maz:flex maz:flex-col maz:gap-4 maz:p-4">
|
|
474
|
-
Badges are hidden in icon-collapsed mode.
|
|
475
|
-
<MazBtn @click="badgesOpen = !badgesOpen">Toggle sidebar</MazBtn>
|
|
476
|
-
</main>
|
|
477
|
-
</div>
|
|
478
|
-
|
|
479
|
-
<template #code>
|
|
480
|
-
|
|
481
240
|
```html
|
|
482
241
|
<!-- Simple: pass a string or number -->
|
|
483
242
|
<MazSidebarMenuButton label="Inbox" :badge="12" />
|
|
@@ -493,59 +252,28 @@ In `mode="overlay"`, the sidebar floats over the content with a backdrop, escape
|
|
|
493
252
|
/>
|
|
494
253
|
```
|
|
495
254
|
|
|
496
|
-
</template>
|
|
497
|
-
</ComponentDemo>
|
|
498
|
-
|
|
499
255
|
## User menu in footer
|
|
500
256
|
|
|
501
|
-
<ComponentDemo>
|
|
502
|
-
<div class="maz:border maz:border-divider maz:overflow-hidden maz:rounded-md maz:h-[22rem] maz:flex">
|
|
503
|
-
<MazSidebar v-model:open="userMenuOpen" class="maz:h-full">
|
|
504
|
-
<MazSidebarContent>
|
|
505
|
-
<MazSidebarMenu>
|
|
506
|
-
<MazSidebarMenuItem>
|
|
507
|
-
<MazSidebarMenuButton label="Dashboard" :active="true" />
|
|
508
|
-
</MazSidebarMenuItem>
|
|
509
|
-
</MazSidebarMenu>
|
|
510
|
-
</MazSidebarContent>
|
|
511
|
-
<MazSidebarFooter>
|
|
512
|
-
<div class="maz:flex maz:items-center maz:gap-3 maz:p-3">
|
|
513
|
-
<MazAvatar src="https://placedog.net/100/100" size="0.8rem" />
|
|
514
|
-
<div class="maz:flex-1 maz:min-w-0">
|
|
515
|
-
<p class="maz:m-0 maz:text-md maz:font-semibold">Jane Doe</p>
|
|
516
|
-
<p class="maz:m-0 maz:text-xs maz:text-muted">jane@example.com</p>
|
|
517
|
-
</div>
|
|
518
|
-
</div>
|
|
519
|
-
</MazSidebarFooter>
|
|
520
|
-
</MazSidebar>
|
|
521
|
-
<main class="maz:flex-1 maz:p-4">Main content</main>
|
|
522
|
-
</div>
|
|
523
|
-
|
|
524
|
-
<template #code>
|
|
525
|
-
|
|
526
257
|
```html
|
|
527
258
|
<MazSidebar v-model:open="isOpen">
|
|
528
259
|
<MazSidebarContent><!-- ... --></MazSidebarContent>
|
|
529
260
|
<MazSidebarFooter>
|
|
530
|
-
<div class="
|
|
261
|
+
<div class="flex items-center gap-3 p-3">
|
|
531
262
|
<MazAvatar src="..." size="0.8rem" />
|
|
532
|
-
<div class="
|
|
533
|
-
<p class="
|
|
534
|
-
<p class="
|
|
263
|
+
<div class="flex-1 min-w-0">
|
|
264
|
+
<p class="m-0 text-md font-semibold">Jane Doe</p>
|
|
265
|
+
<p class="m-0 text-xs text-muted">jane@example.com</p>
|
|
535
266
|
</div>
|
|
536
267
|
</div>
|
|
537
268
|
</MazSidebarFooter>
|
|
538
269
|
</MazSidebar>
|
|
539
270
|
```
|
|
540
271
|
|
|
541
|
-
</template>
|
|
542
|
-
</ComponentDemo>
|
|
543
|
-
|
|
544
272
|
## Mobile (static rendering)
|
|
545
273
|
|
|
546
|
-
|
|
274
|
+
**Note:**
|
|
275
|
+
|
|
547
276
|
Automatic mobile drawer (drawer auto under a breakpoint with backdrop) is a **deferred v1.1 feature**. For now, control the sidebar visibility programmatically based on viewport.
|
|
548
|
-
:::
|
|
549
277
|
|
|
550
278
|
```html
|
|
551
279
|
<script setup>
|
|
@@ -561,11 +289,11 @@ watch(isMobile, (mobile) => {
|
|
|
561
289
|
</script>
|
|
562
290
|
|
|
563
291
|
<template>
|
|
564
|
-
<div class="
|
|
292
|
+
<div class="flex h-screen">
|
|
565
293
|
<MazSidebar v-model:open="isOpen" :mode="isMobile ? 'overlay' : 'push'">
|
|
566
294
|
<!-- content -->
|
|
567
295
|
</MazSidebar>
|
|
568
|
-
<main class="
|
|
296
|
+
<main class="flex-1">
|
|
569
297
|
<MazSidebarTrigger />
|
|
570
298
|
<!-- page content -->
|
|
571
299
|
</main>
|
|
@@ -628,7 +356,7 @@ The sidebar persists its open/collapsed state in a cookie (`maz-sidebar-open`) s
|
|
|
628
356
|
|
|
629
357
|
### SSR considerations
|
|
630
358
|
|
|
631
|
-
Persistence is **SSR-native**
|
|
359
|
+
Persistence is **SSR-native** - the server reads the request cookie and renders the sidebar in its persisted state immediately, so there is no expand → collapse flash on hydration. This works out of the box in Nuxt and any Vue 3 SSR runtime that exposes the request headers through `useSSRContext()`.
|
|
632
360
|
|
|
633
361
|
If you prefer to manage the state yourself (e.g. to share it with other parts of your app), disable persistence and feed the cookie via your own ref:
|
|
634
362
|
|
|
@@ -648,7 +376,7 @@ const sidebarOpen = useCookie<boolean>('maz-sidebar-open', { default: () => true
|
|
|
648
376
|
|
|
649
377
|
## With router (vue-router / NuxtLink)
|
|
650
378
|
|
|
651
|
-
`MazSidebarMenuButton` uses `resolveLinkComponent()` internally
|
|
379
|
+
`MazSidebarMenuButton` uses `resolveLinkComponent()` internally - it detects `RouterLink` (vue-router) or a provided `NuxtLink`. Pass the `to` prop for router navigation, `href` for plain anchor links.
|
|
652
380
|
|
|
653
381
|
```html
|
|
654
382
|
<!-- With vue-router -->
|
|
@@ -687,33 +415,93 @@ Customize the sidebar width using these CSS custom properties (also settable via
|
|
|
687
415
|
|
|
688
416
|
## MazSidebar
|
|
689
417
|
|
|
690
|
-
|
|
418
|
+
## MazSidebar API
|
|
419
|
+
|
|
420
|
+
`import MazSidebar from 'maz-ui/components/MazSidebar'`
|
|
421
|
+
|
|
422
|
+
### Props
|
|
423
|
+
|
|
424
|
+
- `id` (`string`): Unique identifier for the sidebar (auto-generated if not provided).
|
|
425
|
+
- `open` (`boolean`, default: `true`, `v-model:open`): Whether the sidebar is open.
|
|
426
|
+
- `side` (`"end" | "start"`, default: `"start"`): Side of the sidebar.
|
|
427
|
+
- `collapsible` (`"icon" | "none" | "hover" | "offcanvas"`, default: `"offcanvas"`): How the sidebar collapses - offcanvas: completely hidden - icon: only icons visible - hover: only icons visible by default, expands on mouse hover or keyboard focus (transient visual state - does not update `v-model:open` nor the persistence cookie) - none: always fully visible.
|
|
428
|
+
- `mode` (`"push" | "overlay"`, default: `"push"`): How the sidebar affects layout - push: sidebar is in document flow - overlay: sidebar floats over content with a backdrop.
|
|
429
|
+
- `width` (`string`, default: `"16rem"`): Width of the expanded sidebar.
|
|
430
|
+
- `icon-width` (`string`, default: `"3rem"`): Width of the collapsed sidebar in icon mode.
|
|
431
|
+
- `tooltip-mode` (`MazSidebarTooltipMode`, default: `"closed"`): When descendant `MazSidebarMenuButton` components should display their tooltip. - `always`: tooltip shows on hover regardless of the sidebar state - `closed`: tooltip only shows on hover when the sidebar is collapsed Individual buttons can override this via their own `tooltipMode` prop.
|
|
432
|
+
- `persist` (`boolean`, default: `true`): Persist the open/collapsed state in a cookie so it survives reloads. Restoration happens on client mount (SSR-safe). For zero-flash SSR, read the cookie server-side and forward it via `v-model:open`.
|
|
433
|
+
- `persist-key` (`string`, default: `"maz-sidebar-open"`): Cookie key used when `persist` is enabled. Set a unique key per sidebar instance if you mount several sidebars on the same site.
|
|
434
|
+
|
|
435
|
+
### Events
|
|
436
|
+
|
|
437
|
+
- `@update:open` (payload: `value: boolean`): Emitted when open state changes
|
|
438
|
+
|
|
439
|
+
### Slots
|
|
440
|
+
|
|
441
|
+
- `#default`
|
|
442
|
+
|
|
443
|
+
### Exposed (template ref)
|
|
444
|
+
|
|
445
|
+
- `toggle`
|
|
446
|
+
- `setOpen`
|
|
691
447
|
|
|
692
448
|
## MazSidebarMenuButton
|
|
693
449
|
|
|
694
|
-
|
|
450
|
+
## MazSidebarMenuButton API
|
|
451
|
+
|
|
452
|
+
`import MazSidebarMenuButton from 'maz-ui/components/MazSidebarMenuButton'`
|
|
453
|
+
|
|
454
|
+
### Props
|
|
455
|
+
|
|
456
|
+
- `to` (`string | Record<string, unknown>`): Route for router-link navigation.
|
|
457
|
+
- `href` (`string`): URL for anchor navigation.
|
|
458
|
+
- `icon` (`any`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control (size, title, fallback, …).
|
|
459
|
+
- `label` (`string`): Label text.
|
|
460
|
+
- `badge` (`MazSidebarMenuButtonBadge`): Badge content. Pass a `string`/`number` for a simple primary badge, or a full `MazBadgeProps` object (with optional `text`) to customise color, size, outlined, ….
|
|
461
|
+
- `tooltip` (`string`): Tooltip text. When provided, shows a tooltip on hover via the `v-tooltip` directive.
|
|
462
|
+
- `tooltip-mode` (`MazSidebarTooltipMode`): Controls when the tooltip should be displayed. - `always`: tooltip shows on hover regardless of the sidebar state - `closed`: tooltip only shows on hover when the sidebar is collapsed Overrides the parent `MazSidebar`'s `tooltipMode`. Falls back to the sidebar value (which defaults to `always`) when not provided.
|
|
463
|
+
- `active` (`boolean`): Whether the item is active (highlights with `aria-current="page"`).
|
|
464
|
+
- `disabled` (`boolean`): Whether the item is disabled.
|
|
465
|
+
- `size` (`"sm" | "md" | "lg"`, default: `"md"`): Size of the button.
|
|
466
|
+
|
|
467
|
+
### Events
|
|
468
|
+
|
|
469
|
+
- `@click` (payload: `event: MouseEvent`)
|
|
470
|
+
|
|
471
|
+
### Slots
|
|
472
|
+
|
|
473
|
+
- `#icon`
|
|
474
|
+
- `#default`
|
|
695
475
|
|
|
696
476
|
## MazSidebarMenuSub
|
|
697
477
|
|
|
698
|
-
|
|
478
|
+
## MazSidebarMenuSub API
|
|
479
|
+
|
|
480
|
+
`import MazSidebarMenuSub from 'maz-ui/components/MazSidebarMenuSub'`
|
|
481
|
+
|
|
482
|
+
### Props
|
|
483
|
+
|
|
484
|
+
- `label` (`string`): Label for the sub-menu trigger button.
|
|
485
|
+
- `icon` (`any`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control.
|
|
486
|
+
- `default-open` (`boolean`, default: `false`): Whether the sub-menu is open by default.
|
|
487
|
+
|
|
488
|
+
### Slots
|
|
489
|
+
|
|
490
|
+
- `#icon`
|
|
491
|
+
- `#label`
|
|
492
|
+
- `#chevron`
|
|
493
|
+
- `#default`
|
|
699
494
|
|
|
700
495
|
## MazSidebarGroup
|
|
701
496
|
|
|
702
|
-
|
|
497
|
+
## MazSidebarGroup API
|
|
703
498
|
|
|
704
|
-
|
|
705
|
-
import { ref } from 'vue'
|
|
499
|
+
`import MazSidebarGroup from 'maz-ui/components/MazSidebarGroup'`
|
|
706
500
|
|
|
707
|
-
|
|
708
|
-
import { MazCog6Tooth } from '@maz-ui/icons/lazy/MazCog6Tooth'
|
|
501
|
+
### Props
|
|
709
502
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
const iconModeOpen = ref(true)
|
|
716
|
-
const submenusOpen = ref(true)
|
|
717
|
-
const groupsOpen = ref(true)
|
|
718
|
-
const basicOpen = ref(true)
|
|
719
|
-
</script>
|
|
503
|
+
- `label` (`string`): Optional label for the group.
|
|
504
|
+
|
|
505
|
+
### Slots
|
|
506
|
+
|
|
507
|
+
- `#default`
|