gluestack-accessibility
БесплатноБез исполняемых скриптовНе проверенUse when ensuring accessible gluestack-ui implementations. Covers WAI-ARIA patterns, screen reader support, keyboard navigation, focus management, and WCAG…
от TheBushidoCollective★ 202 звезды на GitHubОб этом скилле
gluestack-ui - Accessibility
Expert knowledge of building accessible user interfaces with gluestack-ui, ensuring WCAG 2.1 AA compliance across React and React Native platforms.
Overview
gluestack-ui components are built with accessibility in mind, following WAI-ARIA guidelines and providing built-in support for screen readers, keyboard navigation, and focus management. This skill covers best practices for maintaining and enhancing accessibility.
Key Concepts
Built-in Accessibility
gluestack-ui components include accessibility features out of the box:
// Button automatically has role="button" and handles focus
<Button onPress={handlePress}>
<ButtonText>Submit</ButtonText>
</Button>
// Modal manages focus trap and escape key handling
<Modal isOpen={isOpen} onClose={onClose}>
<ModalContent>
<ModalBody>Content</ModalBody>
</ModalContent>
</Modal>
// Form controls link labels to inputs
<FormControl>
<FormControlLabel>
<FormControlLabelText>Email</FormControlLabelText>
</FormControlLabel>
<Input>
<InputField />
</Input>
</FormControl>
Accessibility Props
React Native accessibility props supported by gluestack-ui:
<Pressable
accessibilityLabel="Close dialog"
accessibilityHint="Closes the current dialog and returns to the previous screen"
accessibilityRole="button"
accessibilityState={{ disabled: isDisabled }}
accessible={true}
onPress={onClose}
>
<Icon as={CloseIcon} />
</Pressable>
ARIA Attributes for Web
For web platforms, use ARIA attributes:
import { Platform } from 'react-native';
<Button
{...(Platform.OS === 'web' && {
'aria-label': 'Close dialog',
'aria-describedby': 'dialog-description',
'aria-expanded': isExpanded,
})}
onPress={handlePress}
>
<ButtonText>Toggle</ButtonText>
</Button>
Screen Reader Support
Meaningful Labels
Provide descriptive labels for interactive elements:
// Bad: No context for screen reader users
<Button onPress={handleDelete}>
<ButtonIcon as={TrashIcon} />
</Button>
// Good: Clear accessibility label
<Button
onPress={handleDelete}
accessibilityLabel="Delete item"
accessibilityHint="Permanently removes this item from your list"
>
<ButtonIcon as={TrashIcon} />
</Button>
Announcing Dynamic Changes
Use accessibility live regions for dynamic content:
import { AccessibilityInfo } from 'react-native';
function SearchResults({ results, isLoading }: {
results: Item[];
isLoading: boolean;
}) {
useEffect(() => {
if (!isLoading) {
AccessibilityInfo.announceForAccessibility(
`${results.length} results found`
);
}
}, [results, isLoading]);
return (
<VStack
accessibilityRole="list"
accessibilityLabel={`Search results, ${results.length} items`}
>
{results.map((item) => (
<Box key={item.id} accessibilityRole="listitem">
<Text>{item.name}</Text>
</Box>
))}
</VStack>
);
}
Image Accessibility
Always provide alt text for images:
import { Image } from '@/components/ui/image';
// Informative image
<Image
source={{ uri: product.imageUrl }}
alt={`${product.name} - ${product.color} color option`}
className="w-full h-48 rounded-lg"
/>
// Decorative image (hide from screen readers)
<Image
source={require('@/assets/decorative-pattern.png')}
alt=""
accessibilityElementsHidden={true}
importantForAccessibility="no-hide-descendants"
className="absolute inset-0 opacity-10"
/>
Keyboard Navigation
Focus Management
Ensure proper focus order and visibility:
import { useRef, useEffect } from 'react';
import { TextInput } from 'react-native';
function SearchModal({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) {
const searchInputRef = useRef<TextInput>(null);
useEffect(() => {
if (isOpen) {
// Focus the search input when modal opens
searchInputRef.current?.focus();
}
}, [isOpen]);
return (
<Modal isOpen={isOpen} onClose={onClose}>
<ModalContent>
<ModalHeader>
<Heading>Search</Heading>
<ModalCloseButton />
</ModalHeader>
<ModalBody>
<Input>
<InputField
ref={searchInputRef}
placeholder="Search..."
accessibilityLabel="Search input"
/>
</Input>
</ModalBody>
</ModalContent>
</Modal>
);
}
Focus Trap in Modals
gluestack-ui Modal automatically traps focus, but you can enhance it:
function AccessibleModal({ isOpen, onClose, children }: {
isOpen: boolean;
onClose: () => void;
children: React.ReactNode;
}) {
return (
<Modal
isOpen={isOpen}
onClose={onClose}
closeOnOverlayClick={true}
// Escape key closes modal (built-in)
>
<ModalBackdrop />
<ModalContent
accessibilityRole="dialog"
accessibilityModal={true}
a
Установить gluestack-accessibility в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobFAQ
Что делает скилл gluestack-accessibility?
Use when ensuring accessible gluestack-ui implementations. Covers WAI-ARIA patterns, screen reader support, keyboard navigation, focus management, and WCAG 2.1 AA compliance.
Как установить скилл gluestack-accessibility?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gluestack-accessibility запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic