react-aria

用于使用 React Aria 构建无障碍(accessible)UI 组件。适用于创建无障碍表单控件、实现 ARIA 模式、构建设计系统或修复无障碍问题的场景。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "react-aria":https://skillpi.com/zh/skills/deepskill-89210c7ee7cf4cb9186fceb91e388b5f4dba51469b4f0c3f59a189d69625838b。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于使用 React Aria 构建无障碍(accessible)UI 组件。适用于创建无障碍表单控件、实现 ARIA 模式、构建设计系统或修复无障碍问题的场景。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: react-aria
description: >-
  Build accessible UI components with React Aria. Use when creating accessible
  form controls, implementing ARIA patterns, building design systems, or fixing
  accessibility issues.
license: Apache-2.0
compatibility: 'React 18+'
metadata:
  author: terminal-skills
  version: 1.0.0
  category: development
  tags: [react-aria, accessibility, a11y, design-system, components]

React Aria

Overview

React Aria (Adobe) provides accessible UI primitives for React. Handles keyboard navigation, screen reader announcements, focus management, and ARIA attributes — you provide styling.

Instructions

Step 1: Accessible Components

import { Button, Label, ListBox, ListBoxItem, Popover, Select, SelectValue } from 'react-aria-components'

export function SelectField({ label, items, onSelectionChange }) {
  return (
    <Select onSelectionChange={onSelectionChange}>
      <Label>{label}</Label>
      <Button><SelectValue /><span aria-hidden="true">▼</span></Button>
      <Popover>
        <ListBox>
          {items.map(item => (
            <ListBoxItem key={item.id} id={item.id}>{item.name}</ListBoxItem>
          ))}
        </ListBox>
      </Popover>
    </Select>
  )
}
// Arrow keys navigate, Enter selects, Escape closes
// Screen reader: announces value, role, option count

Step 2: Focus Management

import { FocusScope } from 'react-aria'

function ModalDialog({ children, onClose }) {
  return (
    <FocusScope contain restoreFocus autoFocus>
      <div role="dialog" aria-modal="true">
        {children}
        <button onClick={onClose}>Close</button>
      </div>
    </FocusScope>
  )
}

Step 3: Custom Hooks

import { useButton } from 'react-aria'
import { useRef } from 'react'

function CustomButton(props) {
  const ref = useRef(null)
  const { buttonProps } = useButton(props, ref)
  return <button {...buttonProps} ref={ref}>{props.children}</button>
}

Guidelines

  • React Aria = behavior + accessibility. You control styling (Tailwind, CSS-in-JS).
  • react-aria-components: pre-built accessible components with render props.
  • Individual hooks (useButton, useTextField) for fully custom designs.
  • FocusScope traps focus in modals — required for WCAG 2.1.
  • Test with VoiceOver (Mac), NVDA (Windows), keyboard-only.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 提供 React Aria 无障碍 UI 组件构建能力,适用于表单控件、ARIA 模式实现、设计系统构建等明确开发场景
  • 具有广泛实用价值,属于明确场景的通用工具
触发精准92/100

亮点

  • description 明确描述使用场景,触发词精准完整,边界清晰
结构规范95/100

待提升项

  • 缺少 When to Use 显式章节 原报告严重程度:轻微

    文档结构良好但缺少显式的 When to Use 章节来进一步明确使用时机

    改进建议:建议添加 When to Use 章节,更清晰地说明适用场景和时机

  • 缺少端到端完整示例 原报告严重程度:轻微

    虽然有代码片段示例,但缺少一个完整的端到端使用示例

    改进建议:建议补充一个完整的项目示例,展示从安装到使用的完整流程

亮点

  • 文档结构清晰,包含 Overview、Instructions(分步骤)、Guidelines
  • 有完整代码示例,frontmatter 完整,单文件未超限
执行可靠88/100

亮点

  • 代码示例语法正确,工具来源明确(React Aria),参数使用合理
  • 覆盖主要使用场景,无不可逆操作
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。