以契约保障无障碍交互
键盘、焦点和表单行为开箱即用。
Lyra 组件记录可访问名称、状态和事件行为。跨浏览器检查覆盖核心交互模式;应用仍需提供有意义的标签与内容,并开展端到端测试。
示例
为交互控件提供明确的可访问名称。
import '@aceshooting/lyra-ui/components/lr-icon-button.js';
const action = document.createElement('lr-icon-button');
action.icon = 'search';
action.setAttribute('aria-label', 'Search'); // Translate this label in your app.
document.body.append(action);