Skip to content

Commit b19adc2

Browse files
committed
docs: document navigator modals
1 parent 3eb77c5 commit b19adc2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,24 @@ It is possible to use multiple `<Navigator>` elements by providing each new Navi
143143
}
144144
</script>
145145
```
146+
147+
# Navigator Modals
148+
149+
```ts
150+
type ModalOptions = { id: string } & ShowModalOptions
151+
this.$navigator.modal(path: string, options: ModalOptions);
152+
```
153+
154+
The default id for modal navigators is `modalNavigator` but can be changed by passing an `id` inside the ModalOptions.
155+
156+
```js
157+
// use the default id for the modal
158+
this.$navigator.modal('/path', { fullscreen: true })
159+
// to navigate the modal to '/other'
160+
this.$navigator.navigate('/other', { frame: 'modalNavigator' })
161+
162+
// use a different id for the modal
163+
this.$navigator.modal('/path', { fullscreen: true, id: 'myModal' })
164+
// to navigate the myModal modal to '/other'
165+
this.$navigator.navigate('/other', { frame: 'myModal' })
166+
```

0 commit comments

Comments
 (0)