Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
00e72de
refactor(list): replace React.Children injection in List.Accordion wi…
matkoson Jun 18, 2026
0e91ea5
refactor(dialog): remove child composition injection
matkoson Jun 23, 2026
41ecff8
refactor(card): remove child composition injection
matkoson Jun 23, 2026
2d97fbc
refactor(toggle-button): style row buttons via context
matkoson Jun 23, 2026
012f27f
test: align composition tests with upstream utilities
matkoson Jun 29, 2026
426827f
fix: preserve dialog icon title spacing
matkoson Jun 29, 2026
d2f5f61
refactor(toggle-button): align segmented row to MD3 spec
matkoson Jun 30, 2026
414bc13
test(toggle-button): assert MD3 secondaryContainer selected fill in row
matkoson Jun 30, 2026
17199df
refactor(appbar): provide shared values via context
matkoson Jun 30, 2026
b3d0b92
revert(toggle-button): drop MD3 redesign, keep legacy visual identity
matkoson Jun 30, 2026
0d08f46
fix(toggle-button, dialog): address review feedback on composition re…
matkoson Jul 2, 2026
38fb0b4
fix(card, dialog, appbar): resolve remaining Copilot review findings
matkoson Jul 6, 2026
a33bb5b
Merge branch 'main' into refactor/react-children-takeover
adam-sajko Aug 28, 2026
526de9e
revert: drop Appbar from this PR
adam-sajko Aug 28, 2026
6e81c50
fix: preserve child keys in Card and Dialog action rows
adam-sajko Aug 25, 2026
3d070b5
test: stabilise the Tooltip pressOut timing
adam-sajko Aug 25, 2026
6b22e0b
docs: document Card, Dialog, List and ToggleButton.Row breaking changes
adam-sajko Aug 28, 2026
6d0b2dc
Merge branch 'main' into refactor/react-children-takeover
adam-sajko Sep 3, 2026
d377ebf
Merge remote-tracking branch 'upstream/main' into refactor/react-chil…
adam-sajko Sep 8, 2026
f2e295f
refactor: apply review feedback to card, dialog, list and toggle button
adam-sajko Sep 9, 2026
dc043ee
Merge remote-tracking branch 'upstream/main' into refactor/react-chil…
adam-sajko Sep 9, 2026
a5dde9a
Merge remote-tracking branch 'upstream/main' into refactor/react-chil…
adam-sajko Sep 15, 2026
3853421
Merge branch 'main' into refactor/react-children-takeover
satya164 Sep 15, 2026
e4bdb0f
refactor: rework Card's API
satya164 Sep 15, 2026
66909ad
Merge remote-tracking branch 'upstream/main' into refactor/react-chil…
adam-sajko Sep 16, 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
136 changes: 136 additions & 0 deletions docs/6.x/docs/guides/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,24 @@ e.g.:
- The default elevation changed from level `1` to level `3`.
- The `style` prop no longer configures the background color or border radius. You can override `theme.colors.surfaceContainerHigh` and `theme.shapes.corner.extraLarge` using the `theme` prop instead.

#### `Dialog.Actions`

`Dialog.Actions` no longer injects `compact` on its buttons. To keep the previous behavior, you need to add the `compact` prop to each button:

```tsx
// Before (v5)
<Dialog.Actions>
<Button onPress={hide}>Done</Button>
</Dialog.Actions>

// After (v6)
<Dialog.Actions>
<Button compact onPress={hide}>
Done
</Button>
</Dialog.Actions>
```

### Searchbar

The misspelled `traileringIcon` props have been renamed:
Expand Down Expand Up @@ -330,6 +348,124 @@ const theme = {
/>
```

### Card

#### `Card` layout

`Card` and its related components have been reworked. Instead of injecting padding to its children, the `Card` component now adds a padding (`16dp`) around its content as well as a gap (`16dp`) between its children.

For the related components:

- `Card.Cover` and `Card.Actions` now apply negative margins to extend into the Card's edges:
- `Card.Cover` applies top, left and right margins for vertical cards and left, top, and bottom margins for horizontal cards.
- `Card.Actions` applies bottom, left, and right margins for vertical cards and left, bottom, and right margins for horizontal cards.
- `Card.Title` and `Card.Content` no longer apply padding around them.

This means, in a typical card layout, the Card will automatically apply the necessary spacing between these sections:

```tsx
<Card>
<Card.Cover source={cover} />
<Card.Title title="Card title" />
<Card.Content>
<Text>Card content</Text>
</Card.Content>
<Card.Actions>
<Button mode="contained">Action</Button>
<Button mode="outlined">Another Action</Button>
</Card.Actions>
</Card>
```

So your existing layouts with the following structure will continue to work as before:

- `Card` without `Card.Cover` or `Card.Actions`.
- `Card` with `Card.Cover` at the top and/or `Card.Actions` at the bottom.

If you have `Card.Cover` or `Card.Actions` in positions other than the top and bottom respectively, you will need to adjust their margins. For example, for a `Card.Cover` in the middle of the Card, you would need to set its top and bottom margins to zero:

```tsx
<Card>
<Card.Title title="Card title" />
<Card.Cover source={cover} style={{ marginTop: 0, marginBottom: 0 }} />
<Card.Content>
<Text>Card content</Text>
</Card.Content>
</Card>
```

We have also added a `direction` prop to the `Card` component, which lets you arrange its items horizontally instead of the default vertical layout. So if you have custom `flexDirection` styles on the Card, you should replace them with the `direction` prop.

```tsx
// Before (v5)
<Card style={{ flexDirection: 'row' }}>
<Card.Cover source={cover} style={{ width: 72, height: 72 }} />
<Card.Title title="Card title" />
<Card.Content>
<Text>Card content</Text>
</Card.Content>
<Card.Actions>
<Button mode="contained">Action</Button>
<Button mode="outlined">Another Action</Button>
</Card.Actions>
</Card>

// After (v6)
<Card direction="horizontal">
<Card.Cover source={cover} style={{ width: 72, height: 72 }} />
<Card.Title title="Card title" />
<Card.Content>
<Text>Card content</Text>
</Card.Content>
<Card.Actions>
<Button mode="contained">Action</Button>
<Button mode="outlined">Another Action</Button>
</Card.Actions>
</Card>
```

#### `Card.Actions`

`Card.Actions` no longer injects `mode` on the buttons. To keep the previous behavior, you need to set `mode="outlined"` on the first button and `mode="contained"` on the rest:

```tsx
// Before (v5)
<Card.Actions>
<Button>Cancel</Button>
<Button>Ok</Button>
</Card.Actions>

// After (v6)
<Card.Actions>
<Button mode="outlined">Cancel</Button>
<Button mode="contained">Ok</Button>
</Card.Actions>
```

### List

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ### ToggleButton section, but ToggleButton.Row changes visibly - divider ownership moves to the row and alignSelf: 'flex-start' is new. Card, Dialog and List all got one.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, done


#### `List.Accordion`

An accordion with a `left` element now indents only its `List.Item` children. Anything else you put inside keeps its own padding, so indent it yourself to line it up with the items.

```tsx
// Before (v5)
<List.Accordion title="Group" left={props => <List.Icon {...props} icon="folder" />}>
<View>
<Text>Custom row</Text>
</View>
</List.Accordion>

// After (v6)
<List.Accordion title="Group" left={props => <List.Icon {...props} icon="folder" />}>
<View style={{ paddingLeft: 40 }}>
<Text>Custom row</Text>
</View>
</List.Accordion>
```

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

### ToggleButton

`ToggleButton`, `ToggleButton.Group` and `ToggleButton.Row` were removed. For an
Expand Down
16 changes: 13 additions & 3 deletions example/src/Examples/CardExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ const CardExample = () => {
<Card style={styles.card} mode={selectedMode}>
<Card.Cover source={require('../../assets/images/forest.jpg')} />
<Card.Actions>
<Button onPress={() => {}}>Share</Button>
<Button onPress={() => {}}>Explore</Button>
<Button mode="outlined" onPress={() => {}}>
Share
</Button>
<Button mode="contained" onPress={() => {}}>
Explore
</Button>
</Card.Actions>
</Card>
<Card style={styles.card} mode={selectedMode}>
Expand Down Expand Up @@ -104,12 +108,14 @@ const CardExample = () => {
<Card.Title title="Custom Button styles" />
<Card.Actions>
<Button
mode="outlined"
theme={{ shapes: { corner: { largeIncreased: 12 } } }}
onPress={() => {}}
>
Share
</Button>
<Button
mode="contained"
theme={{ shapes: { corner: { largeIncreased: 12 } } }}
onPress={() => {}}
>
Expand All @@ -128,7 +134,7 @@ const CardExample = () => {
/>
<Card.Cover
source={require('../../assets/images/artist-2.jpg')}
style={styles.customCoverRadius}
style={[styles.customCoverRadius, styles.bottomCover]}
/>
</Card>
<Card style={styles.card} mode={selectedMode}>
Expand Down Expand Up @@ -233,6 +239,10 @@ const styles = StyleSheet.create({
borderTopRightRadius: 0,
borderBottomRightRadius: 24,
},
bottomCover: {
marginTop: 0,
marginBottom: -16,
},
});

export default CardExample;
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,15 @@ const SegmentedButtonMultiselectRealCase = () => {
contentContainerStyle={styles.contentContainer}
renderItem={({ item }) => {
return (
<Card mode="contained" style={styles.card}>
<Card.Content style={styles.content}>
<Card.Cover style={styles.cover} source={item.cover} />
<Card.Title
title={item.name}
subtitle={'$'.repeat(item.price)}
titleVariant="titleMedium"
style={styles.title}
right={() => <IconButton icon={'bookmark-outline'} />}
/>
</Card.Content>
<Card mode="contained" direction="horizontal" style={styles.card}>
<Card.Cover style={styles.cover} source={item.cover} />
<Card.Title
title={item.name}
subtitle={'$'.repeat(item.price)}
titleVariant="titleMedium"
style={styles.title}
right={() => <IconButton icon={'bookmark-outline'} />}
/>
</Card>
);
}}
Expand All @@ -90,12 +88,6 @@ const styles = StyleSheet.create({
marginHorizontal: 16,
marginTop: 16,
},
content: {
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 0,
paddingVertical: 0,
},
cover: {
width: 72,
height: 72,
Expand Down
30 changes: 11 additions & 19 deletions example/src/Examples/SegmentedButtons/SegmentedButtonRealCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ const SegmentedButtonRealCase = () => {
contentContainerStyle={styles.contentContainer}
renderItem={({ item }) => {
return (
<Card mode="contained" style={styles.card}>
<Card.Content style={styles.content}>
<Card.Cover style={styles.cover} source={item.cover} />
<Card.Title
title={item.title}
subtitle={item.artist}
titleVariant="titleMedium"
style={styles.title}
right={() => <IconButton icon={'bookmark-outline'} />}
/>
</Card.Content>
<Card mode="contained" direction="horizontal" style={styles.card}>
<Card.Cover style={styles.cover} source={item.cover} />
<Card.Title
title={item.title}
subtitle={item.artist}
titleVariant="titleMedium"
style={styles.title}
right={() => <IconButton icon={'bookmark-outline'} />}
/>
</Card>
);
}}
Expand All @@ -68,15 +66,9 @@ const styles = StyleSheet.create({
marginHorizontal: 16,
marginTop: 16,
},
content: {
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 0,
paddingVertical: 0,
},
cover: {
width: 72,
height: 72,
width: 84,
height: 84,
},
title: {
flexShrink: 1,
Expand Down
16 changes: 12 additions & 4 deletions example/src/Examples/TeamDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ const News = () => {
</Text>
</Card.Content>
<Card.Actions>
<Button onPress={() => {}}>Share</Button>
<Button onPress={() => {}}>Read more</Button>
<Button mode="outlined" onPress={() => {}}>
Share
</Button>
<Button mode="contained" onPress={() => {}}>
Read more
</Button>
</Card.Actions>
</Card>
<Card style={styles.card} mode="contained">
Expand All @@ -110,8 +114,12 @@ const News = () => {
</Text>
</Card.Content>
<Card.Actions>
<Button onPress={() => {}}>Share</Button>
<Button onPress={() => {}}>Read more</Button>
<Button mode="outlined" onPress={() => {}}>
Share
</Button>
<Button mode="contained" onPress={() => {}}>
Read more
</Button>
</Card.Actions>
</Card>
</View>
Expand Down
Loading