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
Copy file name to clipboardExpand all lines: apps/docs/content/_components/modal.md
+24-75Lines changed: 24 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,61 +6,45 @@
6
6
7
7
`SfModal` creates a modal window that opens on top of the main window. This component can be used to display important information that requires user interaction.
8
8
9
+
<!--
9
10
In addition to the UI aspect, `SfModal` adds additional functionality that implements several best practices:
10
11
11
12
1. Traps focus within the modal using the [`useTrapFocus`](../hooks/useTrapFocus.html) function
12
13
2. Allows the user to close the modal by pressing the `Escape` key.
13
14
3. Allows the user to close the modal by clicking outside of it.
14
15
15
16
The closing behavior can be disabled by setting the `disableClickAway`/`disableEsc` prop to `true`.
17
+
-->
16
18
17
19
## Examples
18
20
19
21
### Basic usage
20
22
21
-
::vue-only
22
-
The visibility of the modal is controlled by `v-model`.
23
-
::
24
-
::react-only
25
23
The visibility of the modal is controlled by the `open` prop.
26
-
::
27
-
::qwik-only
28
-
The visibility of the modal is controlled by the `open` prop.
29
-
::
24
+
25
+
<!--
30
26
This example also uses the [`useDisclosure`](../hooks/useDisclosure.html) function to provide nice controls for handling the modal's visibility.
`SfModal` sets the `aria-modal="true"` attribute. Also, it sets the `tabindex` to `-1` so `Tab` and `Shift + Tab` do not move focus outside the modal.
@@ -73,65 +57,30 @@ Since you may need to use this component in different contexts, there is no `rol
73
57
You should add `aria-labelledby` or `aria-label` attributes to provide an accessible label for your modal - usually this value can be the title of the modal. To add more context, you should use the `aria-describedby` or `aria-description` attributes.
74
58
75
59
Both techniques can be seen in the code examples above.
|`update:modelValue`| emits when hitting `esc` key (when `disableEsc` is set to `false`) and on click outside (when `disableClickAway` is set to `false`) |
0 commit comments