Skip to content

Commit

Permalink
Add a11yLabel prop
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Jun 5, 2024
1 parent 6ae51bb commit 5126f36
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ import { useColorScheme } from '../../utils'
export type LoadingIndicatorProps = {
/** Optional text appearing below indicator */
text?: string
/** AccessibilityLabel for the text */
a11yLabel?: string
/** Optional custom content to display below indicator */
children?: React.ReactNode
}

export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
text,
a11yLabel,
children,
}) => {
const colorScheme = useColorScheme()
Expand Down Expand Up @@ -82,7 +85,9 @@ export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
{text && (
<>
<Spacer />
<Text style={textStyle}>{text}</Text>
<Text style={textStyle} accessibilityLabel={a11yLabel}>
{text}
</Text>
</>
)}
{children && (
Expand Down

0 comments on commit 5126f36

Please sign in to comment.