You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Vue.js wrapper component for [`a11y-dialog@5.4.1`](https://github.com/edenspiekermann/a11y-dialog) ([**demo**](https://codesandbox.io/s/rj20wr1kpp)).
3
+
This is a Vue.js wrapper component for [`a11y-dialog@7.3.0`](https://github.com/KittyGiraudel/a11y-dialog) ([**demo**](https://codesandbox.io/s/rj20wr1kpp)).
4
4
5
-
**Vue 2 and 3**
6
-
7
-
The newest major release of this package comes with Vue 3 support and removes the dependency to [`portal-vue@2.1.7`](https://github.com/LinusBorg/portal-vue). If you still need to support Vue 2, you can stay on version [`0.5.2`](https://github.com/morkro/vue-a11y-dialog/tree/0.5.2).
8
-
9
-
-[Install](#install)
5
+
-[Installation](#installation)
10
6
-[Usage](#usage)
11
7
-[Multiple dialogs](#multiple-dialogs)
12
8
-[API](#api)
13
9
-[Events](#events)
14
10
-[Slots](#slots)
15
11
-[Server-side Rendering](#server-side-rendering)
16
12
17
-
## Install
13
+
## Installation
14
+
15
+
This library supports both Vue 3 and Vue 2. However, active maintenance is focused on Vue 3. If you still need to support Vue 2, you can stay on version [`0.5.2`](https://github.com/morkro/vue-a11y-dialog/tree/0.5.2).
16
+
17
+
**Vue 3**
18
18
19
19
```bash
20
20
npm install vue-a11y-dialog
21
21
```
22
22
23
-
## Usage
23
+
**Vue 2**
24
24
25
-
In your `main.js` application file, install the component:
26
-
27
-
### Vue 2
28
-
29
-
```js
30
-
importVueA11yDialogfrom'vue-a11y-dialog'
31
-
32
-
Vue.use(VueA11yDialog)
25
+
```bash
26
+
npm install vue-a11y-dialog@0.5.2
33
27
```
34
28
35
-
### Vue 3
29
+
## Usage
30
+
31
+
In your `main.js` application file, install the component:
36
32
37
33
```js
38
34
import { createApp } from'vue'
39
-
importVueA11yDialogfrom'vue-a11y-dialog'
35
+
importA11yDialogfrom'vue-a11y-dialog'
40
36
importAppfrom'./App.vue'
41
37
42
-
createApp(App).use(VueA11yDialog).mount('#app')
38
+
createApp(App).use(A11yDialog).mount('#app')
43
39
```
44
40
45
41
Then use it as follows:
@@ -186,21 +182,7 @@ export default {
186
182
187
183
## API
188
184
189
-
> All `a11y-dialog` instance methods are available, see their [docs](https://github.com/edenspiekermann/a11y-dialog#js-api) for more.
190
-
191
-
### `disable-native`
192
-
193
-
-**Property**: `disable-native`
194
-
-**Type**: `Boolean`
195
-
-**Default**: `false`
196
-
-**Description**: Per default we're using the native `<dialog>` element. However, if you want to disable that and use a `<div role="dialog">` instead, you can just do that by adding this attribute. This gives you full control (and responsibilites) over styling. Read the [`a11y-dialog` Styling layer documentation](http://edenspiekermann.github.io/a11y-dialog/#styling-layer) for more information.
197
-
-**Usage**:
198
-
199
-
```html
200
-
<a11y-dialogdisable-native>
201
-
<!-- ... -->
202
-
</a11y-dialog>
203
-
```
185
+
> All `a11y-dialog` instance methods are available, for further documentation see [here](https://a11y-dialog.netlify.app/).
204
186
205
187
### `id`
206
188
@@ -250,7 +232,7 @@ export default {
250
232
-**Type**: `Object`
251
233
-**Required**: `false`
252
234
-**Default**: `{}`
253
-
-**Description**: Object of classes for each HTML element of the dialog element. Keys are: `base`, `overlay`, `element`, `document`, `title`, `closeButton`. See [a11y-dialog docs](http://edenspiekermann.github.io/a11y-dialog/#expected-dom-structure) for reference.
235
+
-**Description**: Object of classes for each HTML element of the dialog element. Keys are: `base`, `overlay`, `document`, `title`, `closeButton`. See [a11y-dialog docs](https://a11y-dialog.netlify.app/usage/markup) for reference.
254
236
-**Usage**:
255
237
256
238
```html
@@ -348,7 +330,7 @@ export default {
348
330
349
331
### `closeButtonContent`
350
332
351
-
-**Name**: `closeButtonLabel`
333
+
-**Name**: `closeButtonContent`
352
334
-**Default**: `\u00D7` (×)
353
335
-**Description**: The string that is the inner HTML of the close button.
354
336
-**Usage**:
@@ -362,6 +344,23 @@ export default {
362
344
</a11y-dialog>
363
345
```
364
346
347
+
348
+
### `closeButtonPosition`
349
+
350
+
-**Name**: `closeButtonPosition`
351
+
-**Default**: `first`
352
+
-**Description**: One of `first`, `last`, or `none`
353
+
-**Usage**:
354
+
355
+
```html
356
+
<a11y-dialogclose-button-position="last">
357
+
<templatev-slot:closeButtonContent>
358
+
<span>Close dialog</span>
359
+
</template>
360
+
<!-- ... -->
361
+
</a11y-dialog>
362
+
```
363
+
365
364
## Server-side Rendering
366
365
367
366
This is a client-only component; `a11y-dialog` won't render anything on the server and wait for your bundle to be executed on the client.
0 commit comments