算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
react-aria【设计与创意】Build accessible UI components with React Aria. Use when creating accessible form controls, implementing ARIA patterns, building design systems, or fixing accessibility issues.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
React Aria (Adobe) provides accessible UI primitives for React. Handles keyboard navigation, screen reader announcements, focus management, and ARIA attributes — you provide styling.
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
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>
)
}
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>
}
react-aria-components: pre-built accessible components with render props.useButton, useTextField) for fully custom designs.