Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
10b7acf
fix: make hidden banner content inert and fix region semantics
lukemorawski Nov 13, 2026
e5f2694
fix: call show/hide animation callbacks only on animation finished
lukemorawski Nov 13, 2026
2dca9a4
fix: announce banner on every show and stop focus restore crashing web
lukemorawski Nov 13, 2026
2872525
fix: keep a touchableRef passed through an action
lukemorawski Nov 13, 2026
d809243
refactor: drop the type casts flagged in review
lukemorawski Aug 20, 2026
1f3be42
refactor: drop the as any casts from the animation mocks
lukemorawski Aug 20, 2026
e62c969
fix: reflow actions on measured width instead of flex wrap
lukemorawski Nov 13, 2026
05861a5
fix: address review on test ids, focus, action refs and icon role
lukemorawski Nov 13, 2026
3060180
test: follow main's button test ids in banner tests
lukemorawski Nov 13, 2026
523bd74
fix: use main's host instance ref types in banner
lukemorawski Nov 13, 2026
fabf491
fix: focus the host instance directly on web
lukemorawski Nov 13, 2026
47c73d1
test: update banner snapshots after rebase
lukemorawski Nov 13, 2026
f2c1cfa
chore(example): label the banner example FABs
lukemorawski Nov 17, 2026
a93515c
fix(banner): address review on layout, inert, announce and focus rescue
lukemorawski Nov 17, 2026
9d8c48c
test(banner): cover reshow without actions, drop style reflow tests
lukemorawski Nov 17, 2026
e9e1e7c
chore(example): use the review wording for the urgent FAB label
lukemorawski Nov 17, 2026
49808c7
docs(migration): add the banner changes
lukemorawski Nov 17, 2026
f1100c8
fix(banner): follow the reduce motion api from #5235
lukemorawski Nov 18, 2026
6e8faf8
fix(banner): type host refs for legacy RN types
lukemorawski Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/6.x/docs/guides/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,32 @@ e.g.:
/>
```

### Banner

A hidden `Banner` is now inert while it animates out, then its content unmounts. Children lose their local state on hide.

`onShowAnimationFinished` and `onHideAnimationFinished` run only after a `visible` change whose animation finished, not on mount or when interrupted. Under [reduce motion](#reduce-motion) the animation takes 0 ms and still counts as finished.

At most 2 actions render, the rest are ignored with a dev warning. On a window 600dp or wider the actions sit next to the message. The breakpoint follows the window, not the banner.

The banner is now a polite `status` live region instead of `alert`. Use `urgent` for messages that should interrupt:

```diff
-<Banner visible={visible} actions={actions}>
+<Banner visible={visible} actions={actions} urgent>
Your payment failed.
</Banner>
```

The message is announced only when the banner goes from hidden to visible. Tests that use `getByRole('alert')` need `urgent`, or should find the message by text.

The icon is hidden from screen readers. Set `iconAccessibilityLabel` if it carries its own meaning.

When a focused action is removed, focus moves to the next action, or the message:

- **Web:** keyboard focus moves. On hide, focus returns to the element that had it when the banner showed.
- **iOS and Android:** the screen reader cursor moves if the action was just pressed. Keyboard focus doesn't move, and nothing is restored on hide.

### Tooltip

`Tooltip` no longer reads positioning styles such as `position: 'absolute'` from the `style` of the wrapped element. Apply them to a parent `View` wrapping the `Tooltip` instead.
Expand Down
26 changes: 23 additions & 3 deletions example/src/Examples/BannerExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const PHOTOS = Array.from({ length: 24 }).map(
const BannerExample = () => {
const [visible, setVisible] = React.useState<boolean>(true);
const [useCustomTheme, setUseCustomTheme] = React.useState<boolean>(false);
const [urgent, setUrgent] = React.useState<boolean>(false);
const defaultTheme = useTheme();

const customTheme = {
Expand All @@ -30,6 +31,7 @@ const BannerExample = () => {
return (
<View style={styles.container}>
<Banner
urgent={urgent}
actions={[
{
label: `Set ${useCustomTheme ? 'default' : 'custom'} theme`,
Expand All @@ -50,8 +52,9 @@ const BannerExample = () => {
}
theme={useCustomTheme ? customTheme : defaultTheme}
>
Two line text string with two actions. One to two lines is preferable on
mobile.
{urgent
? 'Urgent: this message interrupts the screen reader.'
: 'Two line text string with two actions. One to two lines is preferable on mobile.'}
</Banner>
<ScreenWrapper>
<View style={styles.grid}>
Expand All @@ -67,7 +70,18 @@ const BannerExample = () => {
))}
</View>
</ScreenWrapper>
<FAB icon="eye" style={styles.fab} onPress={() => setVisible(!visible)} />
<FAB
icon="eye"
aria-label={visible ? 'Hide banner' : 'Show banner'}
style={styles.fab}
onPress={() => setVisible(!visible)}
/>
<FAB
icon="alert"
aria-label={urgent ? 'Make banner not urgent' : 'Make banner urgent'}
style={styles.urgentFab}
onPress={() => setUrgent(!urgent)}
/>
</View>
);
};
Expand Down Expand Up @@ -116,6 +130,12 @@ const styles = StyleSheet.create({
bottom: 0,
margin: 16,
},
urgentFab: {
alignSelf: 'flex-end',
position: 'absolute',
bottom: 0,
margin: 16,
},
});

export default BannerExample;
Loading
Loading