Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f179389
feat: refactor icon button component
alpharius-ck Sep 4, 2026
5d3d043
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Sep 4, 2026
0a40a7d
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Sep 8, 2026
c4824f1
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Sep 10, 2026
d414dfa
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Sep 16, 2026
4c0cc26
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Oct 26, 2026
6e82a5c
feat: addressing ai comments
alpharius-ck Oct 28, 2026
5bcea1d
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Nov 16, 2026
2bbdd7e
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Nov 16, 2026
5a059d5
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Nov 16, 2026
d2011c7
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Nov 17, 2026
b5b6661
fix(icon-button): address review feedback
alpharius-ck Nov 18, 2026
8aa2839
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Nov 18, 2026
9e4317f
fix(icon-button): address second round of review feedback
alpharius-ck Nov 19, 2026
5fd225f
docs(icon-button): document `containerColor` while disabled
alpharius-ck Nov 19, 2026
05f654d
fix(icon-button): follow the container corner in touchable and ripple
alpharius-ck Nov 19, 2026
9d57115
Merge branch 'main' into feat/refactor-icon-button-component
alpharius-ck Nov 20, 2026
0c6665a
refactor(appbar): pass `variant` to IconButton as its `mode`
alpharius-ck Nov 20, 2026
7764be7
fix(icon-button): mark the button busy while loading
alpharius-ck Nov 20, 2026
992076a
fix(icon-button): take the loading indicator out of the keyboard order
Doberjohn Nov 20, 2026
e4ebd6b
docs(icon-button): drop the em dashes from the IconButton docs
Doberjohn Nov 20, 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
142 changes: 137 additions & 5 deletions docs/6.x/docs/guides/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ The following component style props no longer support overriding their backgroun
- `Card`
- `Chip`
- `Dialog`
- `IconButton`
- `Menu`: `contentStyle`
- `Searchbar`
- `Snackbar`
Expand Down Expand Up @@ -506,7 +507,7 @@ A `theme` set on a part is merged over the `theme` of the `Appbar`, so it takes
#### Material 3 Expressive

- The `mode` prop of `Appbar` and `Appbar.Header` accepts two new values: `medium-flexible` and `large-flexible`. Their height is the minimum height (`112` and `120`), and they grow when the title wraps onto a second line.
- `Appbar.Action` has new `variant` and `width` props. `variant="filled"` and `variant="tonal"` render the action in a container, and `width="wide"` makes the container wider. A filled or tonal action is selected by default, and passing `selected={false}` shows the unselected container.
- `Appbar.Action` has new `variant` and `width` props. `variant="filled"` and `variant="tonal"` render the action in a container, and `width="wide"` makes the container wider. Without `selected` the action shows the primary or the secondary container color. Pass `selected` to make it a toggle, with the selected and unselected colors of the icon button.
- `Appbar` and `Appbar.Header` have a new `isScrolled` prop. Set it when the content below has scrolled, to switch the container to the `surfaceContainer` color. Unlike `elevated`, it doesn't add elevation.

```tsx
Expand Down Expand Up @@ -839,10 +840,6 @@ The misspelled `traileringIcon` props have been renamed:

The close button (`onClose`) now fills the trailing 34dp column reserved for it, instead of only the 26x18 area around its icon, and its touch target extends to 48dp in height. Taps in that column that used to activate the chip's `onPress` now activate `onClose`.

### IconButton

Corner radii set through `style` no longer shape the press, hover and disabled feedback.

### TouchableRipple

`borderless` has no effect on web. The web ripple is always clipped to the touchable's shape, including when `centered` is set, and the touchable no longer clips its own content. A child that needs a clipped or rounded shape should carry that shape itself.
Expand Down Expand Up @@ -1367,6 +1364,141 @@ An accordion with a `left` element now indents only its `List.Item` children. An

`theme` set on `List.Accordion` no longer reaches its children either. Pass it to the child that needs the override.

### IconButton

`IconButton` now follows the Material 3 Expressive spec. The color modes, size API, and toggle `selected` behavior have changed. Passing the old numeric `size` (for example `size={24}`) crashes at runtime, because `size` is now a named token and `IconButtonTokens.sizes[24]` is `undefined`.

#### Mode names

- **`contained`** → **`filled`**
- **`contained-tonal`** → **`tonal`**
- Unspecified mode is now **`standard`** (no container fill), which matches the previous default.

```tsx
// Before (v5)
<IconButton icon="camera" mode="contained" onPress={onPress} />
<IconButton icon="camera" mode="contained-tonal" onPress={onPress} />

// After (v6)
<IconButton icon="camera" mode="filled" onPress={onPress} />
<IconButton icon="camera" mode="tonal" onPress={onPress} />
```

#### Size

`size` is a named scale: `'extra-small' | 'small' | 'medium' | 'large' | 'extra-large'`, the same names as `Button`. It defaults to `'small'`, which still uses a 24dp icon.

To set the glyph size in dp without changing the container scale, use `iconSize`. The container keeps the size of its `size` (a square 40dp for the default), so a glyph larger than it is clipped. Pick a larger `size` instead.

```tsx
// Before (v5)
<IconButton icon="camera" size={24} onPress={onPress} />
<IconButton icon="camera" size={32} onPress={onPress} />

// After (v6)
<IconButton icon="camera" onPress={onPress} />
<IconButton icon="camera" iconSize={32} onPress={onPress} />
```

```tsx
// After (v6): named container sizes
<IconButton icon="plus" size="extra-small" onPress={onPress} />
<IconButton icon="plus" size="small" onPress={onPress} />
<IconButton icon="plus" size="medium" onPress={onPress} />
<IconButton icon="plus" size="large" onPress={onPress} />
<IconButton icon="plus" size="extra-large" onPress={onPress} />
```

#### Shape

`style.borderRadius` no longer overrides the container corner or shapes the press, hover and disabled feedback. Use `shape`: `'round'` (default) or `'square'`. Toggle-ON inverts the resting shape; press uses a shared corner for both. Arbitrary radii from `style` are not supported.

```tsx
// Before (v5)
<IconButton icon="camera" style={{ borderRadius: 0 }} onPress={onPress} />

// After (v6)
<IconButton icon="camera" shape="square" onPress={onPress} />
```

#### Touch target

An `IconButton` with a touch handler reaches the 48dp minimum target through hit slop, without changing what is drawn. This applies to `extra-small` and `small`, whose containers are smaller than 48dp. Pass `hitSlop` to override it, or `hitSlop={0}` to opt out. A disabled button, or one with no touch handler, gets no extra target.

#### `Appbar.Action` and `Appbar.BackAction`

`size` is no longer a numeric prop on `Appbar.Action` or `Appbar.BackAction`. They inherit `IconButton`'s named `size` (default `'small'`). Drop `size={24}`. For a custom glyph size, pass `iconSize`.

```tsx
// Before (v5)
<Appbar.Action icon="magnify" size={24} onPress={onPress} />
<Appbar.BackAction size={24} onPress={onPress} />

// After (v6)
<Appbar.Action icon="magnify" onPress={onPress} />
<Appbar.BackAction onPress={onPress} />
```

#### `containerColor` while disabled

A disabled `filled` or `tonal` button, or a disabled selected `outlined` one, takes the disabled container color, `onSurface` at 0.10 opacity, and ignores `containerColor`. As in 5.x, a disabled button doesn't keep the color passed for its container, just as `iconColor` doesn't apply either.

#### `selected={false}` uses toggle-off colors

`selected` is tri-state. Omit it for the default (non-toggle) colors. Pass `true` / `false` only for a toggle.

For `filled`, the default and toggle-on containers use `primary`. Toggle-off (`selected={false}`) uses `surfaceContainer` instead of `primary`.

```tsx
// Before (v5): selected={false} still used the default (non-toggle) colors
<IconButton icon="star-outline" mode="contained" selected={false} onPress={onPress} />

// After (v6): omit selected unless the button is a toggle
<IconButton icon="star-outline" mode="filled" onPress={onPress} />

// After (v6): explicit toggle off / on
<IconButton
icon={isStarred ? 'star' : 'star-outline'}
mode="filled"
selected={isStarred}
onPress={toggleStarred}
/>
```

#### `Card.Title` `right` props

`Card.Title` still calls `right({ size: 24 })`. Do not spread those props onto `IconButton`: `size` is no longer a number. Ignore the callback argument, or pass it as `iconSize`.

```tsx
// Before (v5)
<Card.Title
title="Card title"
right={(props) => (
<IconButton {...props} icon="dots-vertical" onPress={onPress} />
)}
/>

// After (v6)
<Card.Title
title="Card title"
right={() => <IconButton icon="dots-vertical" onPress={onPress} />}
/>
```

```tsx
// After (v6): keep the 24dp glyph from Card.Title
<Card.Title
title="Card title"
right={(props) => (
<IconButton
icon="dots-vertical"
iconSize={props.size}
onPress={onPress}
/>
)}
/>
```

### Typography components

The Material Design 2 typography components were removed. Use `Text` with the matching `variant` instead:
Expand Down
Binary file removed docs/public/screenshots/icon-button-1.png
Binary file not shown.
Binary file removed docs/public/screenshots/icon-button-2.png
Binary file not shown.
Binary file removed docs/public/screenshots/icon-button-3.png
Binary file not shown.
Binary file removed docs/public/screenshots/icon-button-4.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/src/components/ScreenshotTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const ScreenshotTabs = ({ screenshotData }: ScreenshotTabsProps) => {

const screenshots = Object.entries(screenshotData).map(([key, value]) => (
<TabItem key={key} value={key} label={key} default>
{typeof value === 'string' ? renderScreenshot(value) : null}
{typeof value === 'string' ? (
renderScreenshot(value)
) : (
<ScreenshotTabs screenshotData={value} />
)}
</TabItem>
));

Expand Down
20 changes: 16 additions & 4 deletions docs/src/data/screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,22 @@ export const screenshots = {
'FAB.Group': 'screenshots/fab-group.gif',
Icon: 'screenshots/icon.png',
IconButton: {
default: 'screenshots/icon-button-1.png',
outlined: 'screenshots/icon-button-4.png',
contained: 'screenshots/icon-button-2.png',
'contained-tonal': 'screenshots/icon-button-3.png',
standard: {
Android: 'screenshots/icon-button-standard.android.png',
iOS: 'screenshots/icon-button-standard.ios.png',
},
filled: {
Android: 'screenshots/icon-button-filled.android.png',
iOS: 'screenshots/icon-button-filled.ios.png',
},
tonal: {
Android: 'screenshots/icon-button-tonal.android.png',
iOS: 'screenshots/icon-button-tonal.ios.png',
},
outlined: {
Android: 'screenshots/icon-button-outlined.android.png',
iOS: 'screenshots/icon-button-outlined.ios.png',
},
},
'List.Accordion': {
'with left icon': 'screenshots/list-accordion-1.png',
Expand Down
64 changes: 40 additions & 24 deletions docs/src/data/themeColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,56 +219,72 @@ export const themeColors = {
},
},
IconButton: {
default: {
standard: {
iconColor: 'theme.colors.onSurfaceVariant',
},
outlined: {
iconColor: 'theme.colors.onSurfaceVariant',
borderColor: 'theme.colors.outlineVariant',
},
filled: {
backgroundColor: 'theme.colors.primary',
iconColor: 'theme.colors.onPrimary',
},
tonal: {
backgroundColor: 'theme.colors.secondaryContainer',
iconColor: 'theme.colors.onSecondaryContainer',
},
},
selected: {
default: {
standard: {
iconColor: 'theme.colors.primary',
},
outlined: {
backgroundColor: 'theme.colors.inverseSurface',
iconColor: 'theme.colors.inverseOnSurface',
},
contained: {
filled: {
backgroundColor: 'theme.colors.primary',
iconColor: 'theme.colors.onPrimary',
},
'contained-tonal': {
backgroundColor: 'theme.colors.secondaryContainer',
iconColor: 'theme.colors.onSecondaryContainer',
tonal: {
backgroundColor: 'theme.colors.secondary',
iconColor: 'theme.colors.onSecondary',
},
},
unselected: {
default: {
standard: {
iconColor: 'theme.colors.onSurfaceVariant',
},
outlined: {
iconColor: 'theme.colors.onSurfaceVariant',
borderColor: 'theme.colors.outline',
},
contained: {
backgroundColor: 'theme.colors.surfaceVariant',
iconColor: 'theme.colors.primary',
borderColor: 'theme.colors.outlineVariant',
},
'contained-tonal': {
backgroundColor: 'theme.colors.surfaceVariant',
filled: {
backgroundColor: 'theme.colors.surfaceContainer',
iconColor: 'theme.colors.onSurfaceVariant',
},
tonal: {
backgroundColor: 'theme.colors.secondaryContainer',
iconColor: 'theme.colors.onSecondaryContainer',
},
},
disabled: {
default: {
iconColor: 'theme.colors.onSurfaceDisabled',
standard: {
iconColor: 'theme.colors.onSurface',
},
outlined: {
backgroundColor: 'theme.colors.surfaceDisabled',
iconColor: 'theme.colors.onSurfaceDisabled',
borderColor: 'theme.colors.surfaceDisabled',
iconColor: 'theme.colors.onSurface',
borderColor: 'theme.colors.outlineVariant',
},
contained: {
backgroundColor: 'theme.colors.surfaceDisabled',
iconColor: 'theme.colors.onSurfaceDisabled',
filled: {
backgroundColor: 'theme.colors.onSurface',
iconColor: 'theme.colors.onSurface',
},
'contained-tonal': {
backgroundColor: 'theme.colors.surfaceDisabled',
iconColor: 'theme.colors.onSurfaceDisabled',
tonal: {
backgroundColor: 'theme.colors.onSurface',
iconColor: 'theme.colors.onSurface',
},
},
},
Expand Down
12 changes: 8 additions & 4 deletions example/src/Examples/BadgeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ const BadgeExample = () => {
<List.Section title="Text">
<View style={styles.row}>
<View style={styles.item}>
<IconButton icon="palette-swatch" size={36} style={styles.button} />
<IconButton
icon="palette-swatch"
size="medium"
style={styles.button}
/>
<Badge visible={visible} style={styles.textBadge}>
12
</Badge>
</View>
<View style={styles.item}>
<IconButton icon="inbox" size={36} style={styles.button} />
<IconButton icon="inbox" size="medium" style={styles.button} />
<Badge
visible={visible}
style={[
Expand All @@ -53,11 +57,11 @@ const BadgeExample = () => {
<List.Section title="Dot">
<View style={styles.row}>
<View style={styles.item}>
<IconButton icon="book-open" size={36} style={styles.button} />
<IconButton icon="book-open" size="medium" style={styles.button} />
<Badge visible={visible} style={styles.dotBadge} />
</View>
<View style={styles.item}>
<IconButton icon="receipt" size={36} style={styles.button} />
<IconButton icon="receipt" size="medium" style={styles.button} />
<Badge visible={visible} style={styles.dotBadge} />
</View>
</View>
Expand Down
8 changes: 3 additions & 5 deletions example/src/Examples/CardExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ const CardExample = () => {
title="Berries that are trimmed at the end"
subtitle="Omega Ruby"
left={(props: any) => <Avatar.Icon {...props} icon="folder" />}
right={(props: any) => (
<IconButton {...props} icon="dots-vertical" onPress={() => {}} />
)}
right={() => <IconButton icon="dots-vertical" onPress={() => {}} />}
/>
<Card.Content>
<Text variant="bodyMedium">
Expand Down Expand Up @@ -146,10 +144,10 @@ const CardExample = () => {
<Card.Title
title="Just Strawberries"
subtitle="... and only Strawberries"
right={(props: any) => (
right={() => (
<IconButton
{...props}
icon={isSelected ? 'heart' : 'heart-outline'}
selected={isSelected}
onPress={() => setIsSelected(!isSelected)}
/>
)}
Expand Down
Loading
Loading