Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
744cef9
feat(fab): modernize FloatingActionButton to MD3
adrcotfas May 22, 2026
eeadb87
feat(fab): add focus ring
adrcotfas May 27, 2026
6a3310f
fix: review findings
adrcotfas Jun 3, 2026
dd1297d
feat(tooltip): align plain tooltip colors and typography with MD3
burczu Jun 10, 2026
9079c49
feat(tooltip): add fade enter/exit animation
burczu Jun 10, 2026
793d397
feat(tooltip): add rich tooltip variant
burczu Jun 10, 2026
d52cbcc
docs(tooltip): showcase rich tooltip and document both variants
burczu Jun 10, 2026
bdcf0e5
refactor(tooltip): extract shared useTooltipFade hook
burczu Jun 10, 2026
d9a0ab9
Merge remote-tracking branch 'origin/main' into feat/tooltip-md3-mode…
burczu Jun 15, 2026
4da1478
Merge remote-tracking branch 'upstream/main' into feat/tooltip-md3-mo…
burczu Jun 15, 2026
c1fe84c
refactor(tooltip): drop redundant token type annotations
burczu Jun 17, 2026
29fb3d1
refactor(tooltip): render-prop API for Tooltip.Rich
burczu Jun 17, 2026
a1aeb7f
fix(tooltip): label the rich tooltip dismiss backdrop
burczu Jun 17, 2026
525c09b
fix(tooltip): open Rich tooltip on web regardless of trigger
burczu Jun 19, 2026
0ad21ed
Merge branch 'main' into feat/tooltip-md3-modernization
burczu Jun 23, 2026
a7e1e31
refactor(tooltip): derive mount during render, not in an effect
burczu Jun 23, 2026
2f8af9e
refactor(tooltip): measure the trigger in useLayoutEffect
burczu Jun 23, 2026
fb44370
feat(tooltip): replace Reanimated shared values with CSS transitions
burczu Jun 24, 2026
c58fc38
refactor(tooltip): replace isWeb with inline Platform.OS checks
burczu Jun 24, 2026
32b2042
refactor(tooltip): replace timer arrays with single nullable refs
burczu Jun 24, 2026
1b6ba12
refactor(tooltip): remove as type casts
burczu Jun 24, 2026
98a700c
refactor(tooltip): replace cloneElement with render prop
burczu Jun 25, 2026
0b0c077
fix(tooltip): add collapsable={false} to trigger wrapper
burczu Jun 25, 2026
db39505
fix(docs): rename TooltipRich page key to RichTooltip
burczu Jun 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
1 change: 1 addition & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const config = {
},
Tooltip: {
Tooltip: 'Tooltip/Tooltip',
RichTooltip: 'Tooltip/RichTooltip',
},
TouchableRipple: {
TouchableRipple: 'TouchableRipple/TouchableRipple',
Expand Down
132 changes: 98 additions & 34 deletions example/src/Examples/TooltipExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Appbar,
Avatar,
Banner,
Button,
Chip,
FAB,
IconButton,
Expand Down Expand Up @@ -46,17 +47,28 @@ const TooltipExample = () => {
header: () => (
<Appbar.Header elevated>
<Tooltip title="Go back">
<Appbar.BackAction onPress={() => navigation.goBack()} />
{(props) => (
<Appbar.BackAction
{...props}
onPress={() => navigation.goBack()}
/>
)}
</Tooltip>
<Appbar.Content title="Tooltips" />
<Tooltip title="Print ⌘ + P">
<Appbar.Action icon="printer" onPress={() => {}} />
{(props) => (
<Appbar.Action {...props} icon="printer" onPress={() => {}} />
)}
</Tooltip>
<Tooltip title="Search">
<Appbar.Action icon="magnify" onPress={() => {}} />
{(props) => (
<Appbar.Action {...props} icon="magnify" onPress={() => {}} />
)}
</Tooltip>
<Tooltip title="More options">
<Appbar.Action icon={MORE_ICON} onPress={() => {}} />
{(props) => (
<Appbar.Action {...props} icon={MORE_ICON} onPress={() => {}} />
)}
</Tooltip>
</Appbar.Header>
),
Expand All @@ -83,11 +95,14 @@ const TooltipExample = () => {
enterTouchDelay={transport.enterTouchDelay}
leaveTouchDelay={transport.leaveTouchDelay}
>
<IconButton
icon={transport.title.split(' ')[0].toLowerCase()}
size={24}
onPress={() => {}}
/>
{(props) => (
<IconButton
{...props}
icon={transport.title.split(' ')[0].toLowerCase()}
size={24}
onPress={() => {}}
/>
)}
</Tooltip>
))}
</View>
Expand All @@ -99,57 +114,106 @@ const TooltipExample = () => {
onValueChange={setTextAlign}
>
<Tooltip title="Align left">
<ToggleButton icon="format-align-left" value="left" />
{(props) => (
<ToggleButton
{...props}
icon="format-align-left"
value="left"
/>
)}
</Tooltip>
<Tooltip title="Align center">
<ToggleButton icon="format-align-center" value="center" />
{(props) => (
<ToggleButton
{...props}
icon="format-align-center"
value="center"
/>
)}
</Tooltip>
<Tooltip title="Align right">
<ToggleButton icon="format-align-right" value="right" disabled />
{(props) => (
<ToggleButton
{...props}
icon="format-align-right"
value="right"
disabled
/>
)}
</Tooltip>
</ToggleButton.Row>
</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 compact onPress={dismiss}>
Learn more
</Button>
<Button compact mode="contained" onPress={dismiss}>
Add
</Button>
</>
)}
>
{(props) => <IconButton {...props} icon="plus" size={24} />}
</Tooltip.Rich>
<Tooltip.Rich content="A rich tooltip with body text only — no title or actions.">
{(props) => (
<IconButton {...props} icon="information" size={24} />
)}
</Tooltip.Rich>
</View>
</List.Section>
</ScreenWrapper>
<View style={styles.fabContainer}>
<Tooltip title="Press Me">
<FAB icon="plus" onPress={() => {}} />
{(props) => <FAB {...props} icon="plus" onPress={() => {}} />}
</Tooltip>
</View>
</>
Expand Down
12 changes: 9 additions & 3 deletions jest/testSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ jest.mock('react-native-worklets', () =>
require('react-native-worklets/lib/module/mock')
);

jest.mock('react-native-reanimated', () =>
require('react-native-reanimated/mock')
);
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');

// The mock doesn't ship the CSS easing helpers; stub the ones we use.
return {
...Reanimated,
cubicBezier: (...points) => `cubic-bezier(${points.join(', ')})`,
};
});

jest.mock('@react-native-vector-icons/material-design-icons', () => {
const React = require('react');
Expand Down
Loading