Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
5c1828f
feat(tooltip): align plain tooltip colors and typography with MD3
burczu Jun 10, 2026
d2e5c32
feat(tooltip): add fade enter/exit animation
burczu Jun 10, 2026
dd5586c
feat(tooltip): add rich tooltip variant
burczu Jun 10, 2026
83a82bc
docs(tooltip): showcase rich tooltip and document both variants
burczu Jun 10, 2026
76c4518
refactor(tooltip): extract shared useTooltipFade hook
burczu Jun 10, 2026
13f31ed
feat(fab): modernize FloatingActionButton to MD3
adrcotfas May 22, 2026
28ab4b1
feat(fab): add focus ring
adrcotfas May 27, 2026
880201c
fix: review findings
adrcotfas Jun 3, 2026
77f0833
refactor(tooltip): drop redundant token type annotations
burczu Jun 17, 2026
dd0633e
refactor(tooltip): render-prop API for Tooltip.Rich
burczu Jun 17, 2026
fa2dd79
fix(tooltip): label the rich tooltip dismiss backdrop
burczu Jun 17, 2026
72e7ca2
fix(tooltip): open Rich tooltip on web regardless of trigger
burczu Jun 19, 2026
982c83d
refactor(tooltip): derive mount during render, not in an effect
burczu Jun 23, 2026
5e1c36f
refactor(tooltip): measure the trigger in useLayoutEffect
burczu Jun 23, 2026
a151776
feat(tooltip): replace Reanimated shared values with CSS transitions
burczu Jun 24, 2026
d56bfef
refactor(tooltip): replace isWeb with inline Platform.OS checks
burczu Jun 24, 2026
fb8ec26
refactor(tooltip): replace timer arrays with single nullable refs
burczu Jun 24, 2026
3fe4981
refactor(tooltip): remove as type casts
burczu Jun 24, 2026
fefe3df
refactor(tooltip): replace cloneElement with render prop
burczu Jun 25, 2026
730f303
fix(tooltip): add collapsable={false} to trigger wrapper
burczu Jun 25, 2026
b652791
fix(tooltip): fix web hover flicker and cursor-leave dismiss
burczu Jun 29, 2026
75f0dd9
fix(tooltip): mobile interaction and Android animation bugs
burczu Jun 29, 2026
6d1dfac
fix(tooltip): fix Tooltip.Rich one-tap switching after scroll
burczu Jun 30, 2026
f85fcdb
fix(tooltip): cancel stale hide timer before scheduling a new one
burczu Jun 30, 2026
416f283
refactor(tooltip): replace as casts with proper ref type
burczu Jun 30, 2026
4e6a8a7
fix(tooltip): fix FAB tooltip and Tooltip.Rich touchscreen web
burczu Jun 30, 2026
0be9098
fix(fab): apply upstream a11y migration and fix RNTL v14 patterns
burczu Jul 1, 2026
b3e8d00
fix(tests): import Jest globals from @jest/globals in FABUtils test
burczu Jul 1, 2026
35ef55e
fix(fab): restore aria props and drop forwardRef wrapper
burczu Jul 2, 2026
b706530
Merge remote-tracking branch 'origin/main' into feat/tooltip-md3-mode…
MikitasK Aug 24, 2026
689922c
fix: restore verbatim module syntax
MikitasK Aug 24, 2026
682dd9a
docs: document Tooltip render prop migration
MikitasK Aug 24, 2026
8a0bfb4
fix: use ARIA props for rich backdrop
MikitasK Aug 24, 2026
f0bbfb0
fix: accept callback refs in Extended
MikitasK Aug 24, 2026
fa201b5
refactor: remove hardcoded test IDs
MikitasK Aug 24, 2026
0f4faa6
fix: stabilize native positioning
MikitasK Aug 24, 2026
cd1e8e6
fix: fade Android shadow with surface
MikitasK Aug 24, 2026
e7cbb3a
fix: support callback refs
MikitasK Aug 25, 2026
8941c39
fix: align rich title color with MD3
MikitasK Aug 28, 2026
f675a2b
Merge branch 'main' of https://github.com/callstack/react-native-pape…
MikitasK Sep 5, 2026
e477af6
fix(tooltip): use the spec's asymmetric padding on the rich tooltip
MikitasK Sep 5, 2026
0f1bfd6
fix(tooltip): drop the redundant `as Window` assertions
MikitasK Sep 5, 2026
e81edf7
Merge upstream/main into feat/tooltip-md3-modernization
MikitasK Sep 21, 2026
83d0ca7
docs: add Tooltip.Rich API page
MikitasK Sep 21, 2026
55e96b6
Merge upstream/main into feat/tooltip-md3-modernization
MikitasK Oct 15, 2026
27a7757
chore: revert unrelated dependency & tsconfig changes
MikitasK Oct 27, 2026
367a26c
style: sort imports in the Banner docs example
MikitasK Oct 27, 2026
4a9ca97
fix: address review feedback
MikitasK Oct 27, 2026
e7432fc
feat: add onDismiss callback & cover onPress event forwarding
MikitasK Nov 4, 2026
f8170dc
Merge remote-tracking branch 'origin/main' into feat/tooltip-md3-mode…
lukewalczak Nov 18, 2026
0d933e7
fix(tooltip): keep Tooltip.Rich open while hovered on web
lukewalczak Nov 18, 2026
ecbf49e
fix(tooltip): show on focus and hide rich backdrop from a11y
lukewalczak Nov 18, 2026
c3fa301
fix(tooltip): type key events without KeyDownEvent for legacy RN types
lukewalczak Nov 18, 2026
67ac430
chore(fab): restore aria-label JSDoc in FAB menu
lukewalczak Nov 18, 2026
76e4d94
fix(tooltip): clear pending timers, close rich tooltip on Escape down
lukewalczak Nov 18, 2026
228b55e
chore(fab): revert FAB changes unrelated to Tooltip
lukewalczak Nov 18, 2026
3a1ef27
fix(tooltip): close rich tooltip on outside press on web
lukewalczak Nov 18, 2026
4c87f45
fix(tooltip): use dialog role for rich tooltip with actions
lukewalczak Nov 18, 2026
8ce72f4
refactor(tooltip): reuse show() and drop zero-size rect check
lukewalczak Nov 18, 2026
85500fc
fix(tooltip): improve rich tooltip a11y, web interactions and MD3 sizing
lukewalczak Nov 18, 2026
7f2d8b6
docs(tooltip): update migration guide and rich tooltip example
lukewalczak Nov 18, 2026
9905c80
fix(tooltip): use the 320dp rich tooltip max width from Compose
lukewalczak Nov 18, 2026
1e33904
refactor(tooltip): use useTimeout directly instead of useTooltipTimers
lukewalczak Nov 18, 2026
e975a07
chore(tooltip): remove comments that repeat code or other comments
lukewalczak Nov 18, 2026
db06c3c
fix(tooltip): describe the rich tooltip trigger with a hint on native
lukewalczak Nov 18, 2026
d50982f
fix(tooltip): let the rich tooltip exit fade finish before unmount
lukewalczak Nov 18, 2026
39236b1
Merge branch 'main' into feat/tooltip-md3-modernization
lukewalczak Nov 18, 2026
6cea718
test(tooltip): drop unused mock and show calling both press handlers
lukewalczak Nov 19, 2026
bf75268
fix(tooltip): keep the rich tooltip open while focus is inside it
lukewalczak Nov 19, 2026
2b73a22
docs(tooltip): note onPress on switch, add rich tooltip variant
lukewalczak Nov 19, 2026
f9e56b0
fix(tooltip): keep a wide tooltip clear of the right edge
lukewalczak Nov 19, 2026
bb2bcfe
chore(tooltip)!: note breaking Tooltip changes
lukewalczak Nov 19, 2026
c567296
Merge branch 'main' into feat/tooltip-md3-modernization
lukewalczak Nov 20, 2026
6ae59ff
fix(tooltip): address review feedback
lukewalczak Nov 20, 2026
3c9db0f
fix(tooltip): keep the native trigger its own accessibility element
lukewalczak Nov 20, 2026
4a6c3fd
fix(tooltip): keep the rich tooltip open on Enter after keyboard focus
lukewalczak Nov 20, 2026
2e2e16b
fix(tooltip): describe the trigger with the title, add titleAsAriaLabel
lukewalczak Nov 20, 2026
08ee792
refactor(tooltip): move web hover and focus handling into hooks
lukewalczak Nov 20, 2026
ce530b0
fix(tooltip): keep Tab and Shift+Tab next to the rich tooltip trigger
lukewalczak Nov 20, 2026
8b13dfa
Merge remote-tracking branch 'origin/main' into feat/tooltip-md3-mode…
lukewalczak Nov 20, 2026
7e4d256
refactor(tooltip): drop unneeded memoization and no-op aria-live
lukewalczak Nov 20, 2026
cbb1b86
Merge remote-tracking branch 'origin/main' into feat/tooltip-md3-mode…
lukewalczak Nov 25, 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
56 changes: 55 additions & 1 deletion docs/6.x/docs/guides/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,19 @@ Showing and hiding use the `standardDecelerate` and `standardAccelerate` easing

### Tooltip

The trigger is now a render function. Spread the props it receives onto the trigger element, so the tooltip can attach its handlers and accessibility props without cloning the element:

```diff
- <Tooltip title="Print">
- <Appbar.Action icon="printer" onPress={handlePrint} />
- </Tooltip>
+ <Tooltip title="Print">
+ {(props) => (
+ <Appbar.Action {...props} icon="printer" onPress={handlePrint} />
+ )}
+ </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.

e.g.:
Expand All @@ -632,11 +645,52 @@ e.g.:
- </Tooltip>
+ <View style={{ position: 'absolute', right: 16, bottom: 16 }}>
+ <Tooltip title="Add">
+ <FAB icon="plus" />
+ {(props) => <FAB {...props} icon="plus" />}
+ </Tooltip>
+ </View>
```

The tooltip now follows the Material Design 3 plain tooltip:

- It uses the `inverseSurface` container and `inverseOnSurface` text in the `bodySmall` type style, instead of `onSurface` and `surface` in `labelLarge`.
- It has 8dp horizontal padding, a 24dp minimum height and a 40dp minimum width, and long titles wrap onto up to three lines at a 320dp width, instead of being cut to one line.
- It fades in and out, and appears 4dp away from the trigger, below it or above it when there's no room. It keeps at least 8dp from the left and right screen edges, and from the top one when it's too tall for either side.
- In right-to-left layouts it is placed from the trailing edge.

On web, the tooltip also opens when the trigger gets keyboard focus, and the trigger is described by the tooltip through `aria-describedby`. On iOS and Android, the trigger gets the title as its `accessibilityHint`. For a trigger without a visible label, such as an icon button, set `titleAsAriaLabel` so the title becomes its `aria-label` on every platform instead.

`Tooltip.Rich` is new. It shows an optional title, supporting text and action buttons, and uses the same render function for its trigger. Pressing the trigger toggles the tooltip, so the trigger's own `onPress` replaces it. Use a trigger without an `onPress`, or call both:

```tsx
<Tooltip.Rich
title="Add to library"
content="Save this item to read it later."
actions={({ dismiss }) => (
<Button mode="text" onPress={dismiss}>
Learn more
</Button>
)}
>
{(props) => (
<IconButton
{...props}
icon="information-outline"
aria-label="More info"
onPress={() => {
props.onPress?.();
handleInfoPress();
}}
/>
)}
</Tooltip.Rich>
```

While a rich tooltip is open on iOS and Android, a press on another rich tooltip's trigger only switches the tooltips, so that trigger's own `onPress` doesn't run.

On iOS and Android, its trigger gets the title and the text content as its `accessibilityHint`. Give an icon-only trigger its own `aria-label`.

A rich tooltip closes on a press outside it, on a press on an action that calls `dismiss`, on another press on the trigger, when the screen size changes and on the VoiceOver escape gesture on iOS. The Android back button isn't taken by the tooltip, so it still goes back. On web it opens on hover and on keyboard focus, and closes on Escape and when the pointer or the focus leaves both the trigger and the tooltip. The down arrow key on the trigger moves focus into the actions, and focus that was in the tooltip goes back to the trigger when it closes.

### Surface

- The `elevation` prop no longer accepts a React Native `Animated.Value`. Any `elevation` changes are animated automatically.
Expand Down
4 changes: 4 additions & 0 deletions docs/component-docs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ const pages = {
},
Tooltip: {
Tooltip: 'Tooltip/Tooltip',
TooltipRich: {
source: 'Tooltip/RichTooltip',
title: 'Tooltip.Rich',
},
},
TouchableRipple: {
TouchableRipple: 'TouchableRipple/TouchableRipple',
Expand Down
11 changes: 9 additions & 2 deletions docs/src/data/themeColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,15 @@ export const themeColors = {
},
Tooltip: {
'-': {
backgroundColor: 'theme.colors.onSurface',
textColor: 'theme.colors.surface',
backgroundColor: 'theme.colors.inverseSurface',
textColor: 'theme.colors.inverseOnSurface',
},
},
'Tooltip.Rich': {
'-': {
backgroundColor: 'theme.colors.surfaceContainer',
'title textColor': 'theme.colors.onSurfaceVariant',
textColor: 'theme.colors.onSurfaceVariant',
},
},
};
202 changes: 144 additions & 58 deletions example/src/Examples/TooltipExample.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react';
import { Platform, StyleSheet, View, Image } from 'react-native';
import { Linking, Platform, StyleSheet, View, Image } from 'react-native';

import { useNavigation } from '@react-navigation/native';
import {
Appbar,
Avatar,
Banner,
Button,
Chip,
FAB,
IconButton,
Expand Down Expand Up @@ -43,18 +44,29 @@ const TooltipExample = () => {
navigation.setOptions({
header: () => (
<Appbar.Header elevated>
<Tooltip title="Go back">
<Appbar.BackAction onPress={() => navigation.goBack()} />
<Tooltip title="Go back" titleAsAriaLabel>
{(props) => (
<Appbar.BackAction
{...props}
onPress={() => navigation.goBack()}
/>
)}
</Tooltip>
<Appbar.Content title="Tooltips" />
<Tooltip title="Print ⌘ + P">
<Appbar.Action icon="printer" onPress={() => {}} />
<Tooltip title="Print ⌘ + P" titleAsAriaLabel>
{(props) => (
<Appbar.Action {...props} icon="printer" onPress={() => {}} />
)}
</Tooltip>
<Tooltip title="Search">
<Appbar.Action icon="magnify" onPress={() => {}} />
<Tooltip title="Search" titleAsAriaLabel>
{(props) => (
<Appbar.Action {...props} icon="magnify" onPress={() => {}} />
)}
</Tooltip>
<Tooltip title="More options">
<Appbar.Action icon={MORE_ICON} onPress={() => {}} />
<Tooltip title="More options" titleAsAriaLabel>
{(props) => (
<Appbar.Action {...props} icon={MORE_ICON} onPress={() => {}} />
)}
</Tooltip>
</Appbar.Header>
),
Expand All @@ -78,87 +90,161 @@ const TooltipExample = () => {
<Tooltip
key={index}
title={transport.title}
titleAsAriaLabel
enterTouchDelay={transport.enterTouchDelay}
leaveTouchDelay={transport.leaveTouchDelay}
>
<IconButton
icon={transport.title.split(' ')[0].toLowerCase()}
onPress={() => {}}
/>
{(props) => (
<IconButton
{...props}
icon={transport.title.split(' ')[0].toLowerCase()}
onPress={() => {}}
/>
)}
</Tooltip>
))}
</View>
</List.Section>
<List.Section title="Icon toggles">
<View style={styles.toggleRow}>
<Tooltip title="Align left">
<IconButton
icon="format-align-left"
mode="tonal"
selected={textAlign === 'left'}
onPress={() => setTextAlign('left')}
/>
<Tooltip title="Align left" titleAsAriaLabel>
{(props) => (
<IconButton
{...props}
icon="format-align-left"
mode="tonal"
selected={textAlign === 'left'}
onPress={() => setTextAlign('left')}
/>
)}
</Tooltip>
<Tooltip title="Align center">
<IconButton
icon="format-align-center"
mode="tonal"
selected={textAlign === 'center'}
onPress={() => setTextAlign('center')}
/>
<Tooltip title="Align center" titleAsAriaLabel>
{(props) => (
<IconButton
{...props}
icon="format-align-center"
mode="tonal"
selected={textAlign === 'center'}
onPress={() => setTextAlign('center')}
/>
)}
</Tooltip>
<Tooltip title="Align right">
<IconButton
icon="format-align-right"
mode="tonal"
selected={textAlign === 'right'}
disabled
onPress={() => setTextAlign('right')}
/>
<Tooltip title="Align right" titleAsAriaLabel>
{(props) => (
<IconButton
{...props}
icon="format-align-right"
mode="tonal"
selected={textAlign === 'right'}
disabled
onPress={() => setTextAlign('right')}
/>
)}
</Tooltip>
</View>
</List.Section>
<List.Section title="Avatar">
<View style={styles.avatarContainer}>
<Tooltip title="Username">
<Avatar.Text label="U" />
{(props) => <Avatar.Text {...props} label="U" />}
</Tooltip>
</View>
</List.Section>
<List.Section title="Chip">
<View style={styles.chipContainer}>
<Tooltip title="Copied">
<Chip
mode="outlined"
avatar={
<Image
source={require('../../assets/images/avatar.png')}
accessibilityIgnoresInvertColors
/>
}
>
John Doe
</Chip>
{(props) => (
<Chip
{...props}
mode="outlined"
avatar={
<Image
source={require('../../assets/images/avatar.png')}
accessibilityIgnoresInvertColors
/>
}
>
John Doe
</Chip>
)}
</Tooltip>
</View>
</List.Section>
<List.Section title="Card">
<Tooltip title="Cafeteria, 1st floor">
<Card style={styles.cardContainer}>
<Card.Title
title="Lunch break"
subtitle="1:00-2:00 PM"
left={(props) => (
<Avatar.Icon {...props} icon="food-fork-drink" />
)}
/>
</Card>
{(props) => (
<Card {...props} style={styles.cardContainer}>
<Card.Title
title="Lunch break"
subtitle="1:00-2:00 PM"
left={(leftProps) => (
<Avatar.Icon {...leftProps} icon="food-fork-drink" />
)}
/>
</Card>
)}
</Tooltip>
</List.Section>
<List.Section title="Rich tooltips">
<View style={styles.iconButtonContainer}>
<Tooltip.Rich
title="Add to library"
content="Save this item to read it later from any of your devices."
actions={({ dismiss }) => (
<>
<Button mode="text" size="extra-small" onPress={dismiss}>
Learn more
</Button>
<Button mode="text" size="extra-small" onPress={dismiss}>
Add
</Button>
</>
)}
>
{(props) => (
<IconButton {...props} icon="plus" aria-label="Add" />
)}
</Tooltip.Rich>
<Tooltip.Rich content="A rich tooltip with body text only — no title or actions.">
{(props) => (
<IconButton
{...props}
icon="information"
aria-label="More information"
/>
)}
</Tooltip.Rich>
<Tooltip.Rich
content="A rich tooltip without a title, with a link as its action."
actions={({ dismiss }) => (
<Button
mode="text"
size="extra-small"
onPress={() => {
dismiss();
void Linking.openURL(
'https://m3.material.io/components/tooltips/overview'
);
}}
>
Open MD3 guidelines
</Button>
)}
>
{(props) => (
<IconButton
{...props}
icon="help-circle-outline"
aria-label="Help"
/>
)}
</Tooltip.Rich>
</View>
</List.Section>
</ScreenWrapper>
<View style={styles.fabContainer}>
<Tooltip title="Press Me">
<FAB icon="plus" onPress={() => {}} />
<Tooltip title="Press Me" titleAsAriaLabel>
{(props) => <FAB {...props} icon="plus" onPress={() => {}} />}
Comment thread
lukewalczak marked this conversation as resolved.
Resolved
</Tooltip>
</View>
</>
Expand Down
Loading
Loading