primevue-mirror/apps/showcase/doc/drawer/AccessibilityDoc.vue

88 lines
2.9 KiB
Vue
Raw Permalink Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText id="accessibility" label="Accessibility" v-bind="$attrs">
<h3>Screen Reader</h3>
<p>
2024-04-18 14:22:30 +00:00
Drawer component uses <i>complementary</i> role by default, since any attribute is passed to the root element aria role can be changed depending on your use case and additional attributes like <i>aria-labelledby</i> can be added. In
addition <i>aria-modal</i> is added since focus is kept within the drawer when opened.
2023-02-28 08:29:30 +00:00
</p>
<p>Trigger element also requires <i>aria-expanded</i> and <i>aria-controls</i> to be handled explicitly.</p>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code" hideToggleCode hideStackBlitz v-bind="$attrs" />
2023-02-28 08:29:30 +00:00
<h3>Overlay Keyboard Support</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i>tab</i>
</td>
2024-04-18 14:22:30 +00:00
<td>Moves focus to the next the focusable element within the drawer.</td>
2023-02-28 08:29:30 +00:00
</tr>
<tr>
<td><i>shift</i> + <i>tab</i></td>
2024-04-18 14:22:30 +00:00
<td>Moves focus to the previous the focusable element within the drawer.</td>
2023-02-28 08:29:30 +00:00
</tr>
<tr>
<td>
<i>escape</i>
</td>
<td>Closes the dialog.</td>
</tr>
</tbody>
</table>
</div>
<h3>Close Button Keyboard Support</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i>enter</i>
</td>
2024-04-18 14:22:30 +00:00
<td>Closes the drawer.</td>
2023-02-28 08:29:30 +00:00
</tr>
<tr>
<td>
<i>space</i>
</td>
2024-04-18 14:22:30 +00:00
<td>Closes the drawer.</td>
2023-02-28 08:29:30 +00:00
</tr>
</tbody>
</table>
</div>
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Button label="Show" icon="pi pi-external-link" @click="visible = true" :aria-controls="visible ? 'sbar' : null" :aria-expanded="visible"/>
2023-02-28 08:29:30 +00:00
2024-04-18 14:22:30 +00:00
<Drawer id="sbar" v-model:visible="visible" role="region" >
2023-02-28 08:29:30 +00:00
<p>Content</p>
2024-04-18 14:22:30 +00:00
</Drawer>
2023-11-01 14:36:59 +00:00
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>