primevue-mirror/doc/button/AccessibilityDoc.vue

58 lines
1.8 KiB
Vue
Raw 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>
Button component renders a native button element that implicitly includes any passed prop. Text to describe the button is defined with the <i>aria-label</i> prop, if not present <i>label</i> prop is used as the value. If the button is
icon only or custom templating is used, it is recommended to use <i>aria-label</i> so that screen readers would be able to read the element properly.
</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>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>
<td>Moves focus to the button.</td>
</tr>
<tr>
<td><i>enter</i></td>
<td>Activates the button.</td>
</tr>
<tr>
<td><i>space</i></td>
<td>Activates the button.</td>
</tr>
</tbody>
</table>
</div>
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Button icon="pi pi-check" aria-label="Submit" />
2023-02-28 08:29:30 +00:00
<Button icon="pi pi-check" label="Submit" />
<Button class="youtube p-0" aria-label="Youtube">
<i class="pi pi-youtube px-2"></i>
2024-05-20 12:14:38 +00:00
<span class="px-4">Youtube</span>
2023-11-01 14:36:59 +00:00
</Button>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>