Skip to content

Release 0.9.0

Latest

Choose a tag to compare

@ArturKalach ArturKalach released this 05 Jul 15:19

0.9.0 (2026-07-05)

Unified Focus & Press Styling

This release reworks how A11y.View / A11y.Pressable / A11y.Input report style state: style and containerStyle now take a single callback for both keyboard focus and press, backed by a leaner, fully pull-based iOS halo. No breaking changes to fix in your app — the old props still work — but there's a new, smaller API to move to when you're ready, and two accessibility bugs are fixed along the way.

Highlights:

  • 🎨 One style callbackstyle / containerStyle now accept ({ focused, pressed }) => style, replacing focusStyle / containerFocusStyle (deprecated).
  • ⌨️ Automatic keyboard-press paritywithPressedStyle and androidKeyboardPressState now auto-enable themselves; no more remembering to flip them on.
  • 🫥 New useIsViewPressed() — a press-state counterpart to useIsViewFocused(), correct for touch and physical keyboard, on both platforms.
  • 🍩 Simpler iOS halo — fully pull-based, so a disabled halo (haloEffect={false} / tintType="none") never re-arms itself on rounded views; roundedHaloFix is no longer needed.
  • 🐛 Two accessibility fixes — a Fabric view-recycling bug that could leave a reused view's halo stuck on a stale radius, and an iOS A11y.Card fix restoring touch/drag screen-reader exploration over card content.

🎨 style / containerStyle take over from focusStyle / containerFocusStyle

Both props now accept a callback that receives the current interaction state — { focused, pressed } — so one prop drives styling for keyboard focus, touch press, and physical-keyboard press alike:

<A11y.Pressable
  style={({ focused, pressed }) => [
    styles.button,
    focused && { backgroundColor: 'dodgerblue' },
    pressed && { opacity: 0.85 },
  ]}
  containerStyle={({ focused }) => [
    styles.container,
    focused && { borderColor: 'dodgerblue', borderWidth: 2 },
  ]}
  onPress={onPress}
>
  <Text>Styled on focus & press</Text>
</A11y.Pressable>

focusStyle / containerFocusStyle keep working but are now deprecated. See the Pressable focus guide and Focus styling guide.

⌨️ Keyboard press parity, automatically

withPressedStyle and androidKeyboardPressState used to be opt-in flags you had to remember to set. Both are now inferred:

  • Pressed-style handling turns on automatically whenever style (or containerStyle) is a function.
  • androidKeyboardPressState auto-enables whenever a pressed-reactive style or render prop is present (style/containerStyle as a function, renderContent, or a function children), so physical-keyboard activation styles the same as touch on Android out of the box.

An explicit value on either prop still overrides the auto-detection. See the new withKeyboardFocus re-render cost guide.

🫥 useIsViewPressed()

A press counterpart to useIsViewFocused(). Descendants can react to press — touch or physical keyboard, either platform — without re-rendering the focusable host itself:

import { A11y, useIsViewPressed } from 'react-native-a11y';

const Label = () => {
  const pressed = useIsViewPressed();
  return <Text style={pressed && styles.pressed}>Item</Text>;
};

<A11y.Pressable onPress={onPress}>
  <Label />
</A11y.Pressable>;

🍩 A halo that stays off

The iOS halo effect is now computed fresh from props on every focus query instead of being re-armed off the view's live layer radius. Practically: haloEffect={false} / tintType="none" now always stays disabled on rounded views, with nothing extra to do. roundedHaloFix is deprecated and ignored — safe to delete.

🐛 Bug fixes

  • iOS halo props on recycled Fabric views — a view recycled by Fabric for a new component with an unchanged halo prop could get stuck on a previously-reset value (e.g. a square halo instead of the configured radius). Fixed by comparing against live instance state instead of the previous props snapshot.
  • A11y.Card touch / drag exploration — removed an iOS accessibilityElements override that was blocking touch-exploration ("drag to discover") over a card's children.

🔁 Migration

Nothing requires a change — all 0.8 props still compile. See From 0.8.0 to 0.9.0 in the migration guide for the full deprecation list and the one edge case worth checking (direct useContext(IsViewFocusedContext) consumers).