maz-ui 5.0.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/dist/assets/{MazDropzone.DJ8au25t.css → MazDropzone.BW2grpTi.css} +1 -1
- package/dist/chunks/{MazDrawer.DANxKYxJ.js → MazDrawer.CC8zomfx.js} +2 -2
- package/dist/chunks/{MazDropzone.POH3pmfi.js → MazDropzone.Dez5j0WP.js} +2 -2
- package/dist/components/MazDrawer.js +1 -1
- package/dist/components/MazDropzone.js +1 -1
- package/dist/components/MazDropzone.vue.d.ts +2 -2
- package/dist/components/MazInputPrice.vue.d.ts +1 -1
- package/dist/components/index.js +2 -2
- 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/components/maz-alert.md +241 -0
- 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/components/maz-badge.md +167 -0
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/components/maz-btn-group.md +316 -0
- package/docs/components/maz-btn.md +423 -0
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/components/maz-card.md +321 -0
- package/docs/components/maz-carousel.md +153 -0
- package/docs/components/maz-chart.md +206 -0
- 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/components/maz-code-highlight.md +155 -0
- package/docs/components/maz-container.md +241 -0
- package/docs/components/maz-date-picker.md +791 -0
- 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/components/maz-dropzone.md +387 -0
- 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/components/maz-icon.md +203 -0
- 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/components/maz-input.md +334 -0
- 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/components/maz-markdown-editor.md +320 -0
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/components/maz-pull-to-refresh.md +222 -0
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/components/maz-read-more.md +209 -0
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/components/maz-select-country.md +513 -0
- package/docs/components/maz-select.md +318 -0
- 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/components/maz-sidebar.md +507 -0
- package/docs/components/maz-skeleton.md +226 -0
- package/docs/components/maz-slider.md +165 -0
- package/docs/components/maz-spinner.md +84 -0
- package/docs/components/maz-stepper.md +301 -0
- 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/components/maz-tabs.md +308 -0
- 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/components/maz-window-mockup.md +182 -0
- 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/composables/use-display-names.md +130 -0
- package/docs/composables/use-drag.md +185 -0
- package/docs/composables/use-form-validator.md +1123 -0
- package/docs/composables/use-idle-timeout.md +172 -0
- package/docs/composables/use-pull-to-refresh.md +86 -0
- package/docs/composables/use-reading-time.md +132 -0
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/composables/use-swipe.md +171 -0
- package/docs/composables/use-timer.md +104 -0
- package/docs/composables/use-toast.md +50 -0
- package/docs/composables/use-user-visibility.md +127 -0
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/directives/click-outside.md +182 -0
- package/docs/directives/fullscreen-img.md +83 -0
- package/docs/directives/lazy-img.md +182 -0
- package/docs/directives/tooltip.md +298 -0
- package/docs/directives/zoom-img.md +100 -0
- package/docs/ecosystem/eslint-config.md +289 -0
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/ecosystem/icons/index.md +584 -0
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/ecosystem/node/exec-promise.md +93 -0
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/ecosystem/node/logger.md +152 -0
- package/docs/ecosystem/node/print-banner.md +101 -0
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/ecosystem/nuxt.md +551 -0
- package/docs/ecosystem/stylelint-config.md +310 -0
- package/docs/ecosystem/themes.md +966 -0
- package/docs/ecosystem/translations.md +1173 -0
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/ecosystem/utils/check-availability.md +85 -0
- package/docs/ecosystem/utils/cookie.md +86 -0
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/ecosystem/utils/currency.md +53 -0
- package/docs/ecosystem/utils/date.md +53 -0
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/ecosystem/utils/debounce-id.md +75 -0
- package/docs/ecosystem/utils/debounce.md +71 -0
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/ecosystem/utils/format-json.md +39 -0
- package/docs/ecosystem/utils/format-phone-number.md +43 -0
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/ecosystem/utils/get-error-message.md +45 -0
- package/docs/ecosystem/utils/idle-timeout.md +96 -0
- package/docs/ecosystem/utils/index.md +57 -0
- package/docs/ecosystem/utils/is-client.md +38 -0
- package/docs/ecosystem/utils/is-equal.md +44 -0
- package/docs/ecosystem/utils/is-ios.md +43 -0
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/ecosystem/utils/kebab-case.md +42 -0
- package/docs/ecosystem/utils/normalize-string.md +83 -0
- package/docs/ecosystem/utils/number.md +51 -0
- package/docs/ecosystem/utils/pascal-case.md +41 -0
- package/docs/ecosystem/utils/prevent-ios-input-zoom.md +72 -0
- package/docs/ecosystem/utils/script-loader.md +85 -0
- package/docs/ecosystem/utils/sleep.md +65 -0
- package/docs/ecosystem/utils/snake-case.md +42 -0
- package/docs/ecosystem/utils/swipe-handler.md +97 -0
- package/docs/ecosystem/utils/textarea-autogrow.md +47 -0
- package/docs/ecosystem/utils/throttle-id.md +54 -0
- package/docs/ecosystem/utils/throttle.md +63 -0
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/ecosystem/utils/types/deep-key-of.md +54 -0
- package/docs/ecosystem/utils/types/deep-partial.md +48 -0
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/ecosystem/utils/types/generic-instance-type.md +48 -0
- package/docs/ecosystem/utils/types/infer-maybe-ref.md +41 -0
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/ecosystem/utils/user-visibility.md +75 -0
- package/docs/guide/ai-agents.md +237 -0
- package/docs/guide/browser-support.md +88 -0
- package/docs/guide/getting-started.md +191 -0
- package/docs/guide/global-defaults.md +103 -0
- package/docs/guide/maz-ui-provider.md +231 -0
- package/docs/guide/migration-v5.md +871 -0
- package/docs/guide/resolvers.md +650 -0
- package/docs/guide/tailwind.md +483 -0
- package/docs/guide/vue.md +286 -0
- package/docs/manifest.json +1 -0
- package/docs/plugins/aos.md +312 -0
- package/docs/plugins/dialog.md +269 -0
- 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 +31 -4
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazBtnGroup"
|
|
3
|
+
description: "MazBtnGroup is a component to group multiple MazBtn buttons together with seamless styling. Supports props-based or slot-based rendering with customizable orientation, size, and color."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-btn-group"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazBtnGroup
|
|
9
|
+
|
|
10
|
+
> MazBtnGroup is a component to group multiple MazBtn buttons together with seamless styling. Supports props-based or slot-based rendering with customizable orientation, size, and color.
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazBtnGroup from 'maz-ui/components/MazBtnGroup'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-btn-group
|
|
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
|
+
## Basic usage with items
|
|
20
|
+
|
|
21
|
+
Use the `items` prop to quickly create a button group from an array of button configurations.
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<template>
|
|
25
|
+
<MazBtnGroup :items="items" />
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
30
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
31
|
+
|
|
32
|
+
const items: MazButtonGroupOption[] = [
|
|
33
|
+
{ text: 'Day' },
|
|
34
|
+
{ text: 'Week', active: true },
|
|
35
|
+
{ text: 'Month' },
|
|
36
|
+
]
|
|
37
|
+
</script>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Slot-based usage
|
|
41
|
+
|
|
42
|
+
Use the default slot to pass `MazBtn` components directly for full control over each button.
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<template>
|
|
46
|
+
<MazBtnGroup>
|
|
47
|
+
<MazBtn>Edit</MazBtn>
|
|
48
|
+
<MazBtn :active="true">Save</MazBtn>
|
|
49
|
+
<MazBtn>Delete</MazBtn>
|
|
50
|
+
</MazBtnGroup>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script lang="ts" setup>
|
|
54
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
55
|
+
import MazBtn from 'maz-ui/components/MazBtn'
|
|
56
|
+
</script>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Orientation
|
|
60
|
+
|
|
61
|
+
Use the `orientation` prop to arrange buttons horizontally (`row`) or vertically (`col`).
|
|
62
|
+
|
|
63
|
+
```vue
|
|
64
|
+
<template>
|
|
65
|
+
<MazBtnGroup :items="items" orientation="row" />
|
|
66
|
+
<MazBtnGroup :items="items" orientation="col" />
|
|
67
|
+
</template>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Sizes
|
|
71
|
+
|
|
72
|
+
Use the `size` prop to apply a size to all buttons in the group.
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<template>
|
|
76
|
+
<MazBtnGroup :items="items" size="mini" />
|
|
77
|
+
<MazBtnGroup :items="items" size="xs" />
|
|
78
|
+
<MazBtnGroup :items="items" size="sm" />
|
|
79
|
+
<MazBtnGroup :items="items" size="md" />
|
|
80
|
+
<MazBtnGroup :items="items" size="lg" />
|
|
81
|
+
<MazBtnGroup :items="items" size="xl" />
|
|
82
|
+
</template>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Colors
|
|
86
|
+
|
|
87
|
+
Use the `color` prop to apply a color to all buttons in the group.
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<template>
|
|
91
|
+
<MazBtnGroup :items="items" color="primary" />
|
|
92
|
+
<MazBtnGroup :items="items" color="secondary" />
|
|
93
|
+
<MazBtnGroup :items="items" color="info" />
|
|
94
|
+
<MazBtnGroup :items="items" color="success" />
|
|
95
|
+
<MazBtnGroup :items="items" color="warning" />
|
|
96
|
+
<MazBtnGroup :items="items" color="destructive" />
|
|
97
|
+
</template>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Button variants
|
|
101
|
+
|
|
102
|
+
Use the `outlined` or `pastel` properties on individual buttons or apply different variants to buttons in the group.
|
|
103
|
+
|
|
104
|
+
### Outlined
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<template>
|
|
108
|
+
<MazBtnGroup :items="items" />
|
|
109
|
+
</template>
|
|
110
|
+
|
|
111
|
+
<script lang="ts" setup>
|
|
112
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
113
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
114
|
+
|
|
115
|
+
const items: MazButtonGroupOption[] = [
|
|
116
|
+
{ text: 'Day', outlined: true },
|
|
117
|
+
{ text: 'Week', outlined: true },
|
|
118
|
+
{ text: 'Month', outlined: true },
|
|
119
|
+
]
|
|
120
|
+
</script>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Pastel
|
|
124
|
+
|
|
125
|
+
```vue
|
|
126
|
+
<template>
|
|
127
|
+
<MazBtnGroup :items="items" />
|
|
128
|
+
</template>
|
|
129
|
+
|
|
130
|
+
<script lang="ts" setup>
|
|
131
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
132
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
133
|
+
|
|
134
|
+
const items: MazButtonGroupOption[] = [
|
|
135
|
+
{ text: 'Day', pastel: true },
|
|
136
|
+
{ text: 'Week', pastel: true },
|
|
137
|
+
{ text: 'Month', pastel: true },
|
|
138
|
+
]
|
|
139
|
+
</script>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Slot-based variants
|
|
143
|
+
|
|
144
|
+
```vue
|
|
145
|
+
<template>
|
|
146
|
+
<MazBtnGroup>
|
|
147
|
+
<MazBtn outlined>Edit</MazBtn>
|
|
148
|
+
<MazBtn outlined>Save</MazBtn>
|
|
149
|
+
<MazBtn outlined>Delete</MazBtn>
|
|
150
|
+
</MazBtnGroup>
|
|
151
|
+
|
|
152
|
+
<MazBtnGroup>
|
|
153
|
+
<MazBtn pastel>Edit</MazBtn>
|
|
154
|
+
<MazBtn pastel>Save</MazBtn>
|
|
155
|
+
<MazBtn pastel>Delete</MazBtn>
|
|
156
|
+
</MazBtnGroup>
|
|
157
|
+
</template>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Click handlers
|
|
161
|
+
|
|
162
|
+
Add click handlers to buttons using the `onClick` property in items.
|
|
163
|
+
|
|
164
|
+
```vue
|
|
165
|
+
<template>
|
|
166
|
+
<MazBtnGroup :items="items" />
|
|
167
|
+
</template>
|
|
168
|
+
|
|
169
|
+
<script lang="ts" setup>
|
|
170
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
171
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
172
|
+
|
|
173
|
+
const items: MazButtonGroupOption[] = [
|
|
174
|
+
{ text: 'Alert', onClick: () => alert('Clicked Alert!') },
|
|
175
|
+
{ text: 'Console', onClick: () => console.log('Clicked Console!') },
|
|
176
|
+
]
|
|
177
|
+
</script>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## With icons
|
|
181
|
+
|
|
182
|
+
Use the `startIcon` or `endIcon` properties to add icons to buttons.
|
|
183
|
+
|
|
184
|
+
```vue
|
|
185
|
+
<template>
|
|
186
|
+
<MazBtnGroup :items="items" />
|
|
187
|
+
<MazBtnGroup :items="iconOnlyItems" />
|
|
188
|
+
</template>
|
|
189
|
+
|
|
190
|
+
<script lang="ts" setup>
|
|
191
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
192
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
193
|
+
import { MazArrowLeft } from '@maz-ui/icons/raw/MazArrowLeft'
|
|
194
|
+
import { MazArrowRight } from '@maz-ui/icons/raw/MazArrowRight'
|
|
195
|
+
|
|
196
|
+
const items: MazButtonGroupOption[] = [
|
|
197
|
+
{ text: 'Previous', startIcon: MazArrowLeft, active: true },
|
|
198
|
+
{ text: 'Next', endIcon: MazArrowRight },
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
const iconOnlyItems: MazButtonGroupOption[] = [
|
|
202
|
+
{ icon: MazBars3, color: 'transparent', outlined: true, active: true },
|
|
203
|
+
{ icon: MazSquares2x2, color: 'transparent', outlined: true },
|
|
204
|
+
]
|
|
205
|
+
</script>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## With links
|
|
209
|
+
|
|
210
|
+
Use the `href` or `to` properties to create link buttons.
|
|
211
|
+
|
|
212
|
+
```vue
|
|
213
|
+
<template>
|
|
214
|
+
<MazBtnGroup :items="items" />
|
|
215
|
+
</template>
|
|
216
|
+
|
|
217
|
+
<script lang="ts" setup>
|
|
218
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
219
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
220
|
+
|
|
221
|
+
const items: MazButtonGroupOption[] = [
|
|
222
|
+
{ text: 'External Link', href: 'https://maz-ui.com', target: '_blank' },
|
|
223
|
+
{ text: 'Router Link', to: { path: '/components/maz-btn' } },
|
|
224
|
+
]
|
|
225
|
+
</script>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Mixed button styles
|
|
229
|
+
|
|
230
|
+
Combine different button styles within the same group.
|
|
231
|
+
|
|
232
|
+
```vue
|
|
233
|
+
<template>
|
|
234
|
+
<MazBtnGroup :items="items" />
|
|
235
|
+
</template>
|
|
236
|
+
|
|
237
|
+
<script lang="ts" setup>
|
|
238
|
+
import MazBtnGroup from 'maz-ui/components/MazBtnGroup'
|
|
239
|
+
import type { MazButtonGroupOption } from 'maz-ui/components/MazBtnGroup'
|
|
240
|
+
|
|
241
|
+
const items: MazButtonGroupOption[] = [
|
|
242
|
+
{ text: 'Primary', color: 'primary' },
|
|
243
|
+
{ text: 'Success', color: 'success' },
|
|
244
|
+
{ text: 'Warning', color: 'warning', outlined: true },
|
|
245
|
+
{ text: 'Destructive', color: 'destructive', pastel: true },
|
|
246
|
+
]
|
|
247
|
+
</script>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Types
|
|
251
|
+
|
|
252
|
+
### MazButtonGroupOption
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import type { MazBtnProps } from 'maz-ui/components/MazBtn'
|
|
256
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
257
|
+
|
|
258
|
+
interface MazButtonGroupOption extends Omit<MazBtnProps, 'block'> {
|
|
259
|
+
/** The text of the button */
|
|
260
|
+
text: string
|
|
261
|
+
/** Click handler for the button */
|
|
262
|
+
onClick?: () => void
|
|
263
|
+
/** The href for anchor links */
|
|
264
|
+
href?: string
|
|
265
|
+
/** The route for router-link */
|
|
266
|
+
to?: RouteLocationRaw
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### MazButtonGroupProps
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
interface MazButtonGroupProps {
|
|
274
|
+
/**
|
|
275
|
+
* The items for the button group (optional when using slot-based approach)
|
|
276
|
+
* @default undefined
|
|
277
|
+
*/
|
|
278
|
+
items?: MazButtonGroupOption[]
|
|
279
|
+
/**
|
|
280
|
+
* The orientation of the button group
|
|
281
|
+
* @values 'row' | 'col'
|
|
282
|
+
* @default 'row'
|
|
283
|
+
*/
|
|
284
|
+
orientation?: 'row' | 'col'
|
|
285
|
+
/**
|
|
286
|
+
* The size of all buttons (only applies to props-based buttons)
|
|
287
|
+
* @default 'md'
|
|
288
|
+
*/
|
|
289
|
+
size?: 'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
290
|
+
/**
|
|
291
|
+
* The color of all buttons (only applies to props-based buttons)
|
|
292
|
+
* @default 'primary'
|
|
293
|
+
*/
|
|
294
|
+
color?: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'destructive' | 'transparent' | 'contrast' | 'accent'
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## MazBtnGroup API
|
|
299
|
+
|
|
300
|
+
`import MazBtnGroup from 'maz-ui/components/MazBtnGroup'`
|
|
301
|
+
|
|
302
|
+
### Props
|
|
303
|
+
|
|
304
|
+
- `items` (`MazButtonGroupOption[]`): The items for the button group (optional when using slot-based approach).
|
|
305
|
+
- `orientation` (`"row" | "col"`, default: `"row"`): The orientation of the button group.
|
|
306
|
+
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): The size of all buttons (only applies to props-based buttons).
|
|
307
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The color of all buttons (only applies to props-based buttons).
|
|
308
|
+
- `rounded-size` (`MazRoundedSize`, default: `'lg'`): The rounded size of the buttons.
|
|
309
|
+
- `outlined` (`boolean`, default: `false`): The outlined state of the buttons.
|
|
310
|
+
- `pastel` (`boolean`, default: `false`): The pastel state of the buttons.
|
|
311
|
+
- `loading` (`boolean`, default: `false`): The loading state of the buttons.
|
|
312
|
+
- `disabled` (`boolean`, default: `false`): The disabled state of the buttons.
|
|
313
|
+
|
|
314
|
+
### Slots
|
|
315
|
+
|
|
316
|
+
- `#default`: Slot for passing MazBtn components directly
|