Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
15858af
refactor(card): make layout helpers parent-independent
Sep 4, 2026
2704a5d
feat(card)!: introduce slot-first filled card
Sep 4, 2026
c9be122
feat(card): add Material variant token contract
Sep 4, 2026
b4454df
feat(card): modernize responsive cover media
Sep 4, 2026
d047aff
feat(card)!: expose one actionable target
Sep 4, 2026
9939c31
feat(card): add actionable state feedback
Sep 4, 2026
a4935a4
feat(card): complete state and motion behavior
Sep 4, 2026
33f8ced
fix(card): fix worklet related complaints
Sep 4, 2026
d1217ba
feat(card): add expressive example gallery
Sep 7, 2026
7e85772
docs(card): publish v6 contract and migration
Sep 7, 2026
c09891c
fix(docs): correct card migration examples
Sep 7, 2026
f8ca05a
refactor(card): drop derived testID's + fix tests
Sep 23, 2026
d70d034
fix(card): disabled card color
Sep 23, 2026
f0d5a10
docs(card): add card.actions migration info
Sep 23, 2026
b9086c3
refactor(card): adapt to main and use the shared focus ring
Stoneski93 Nov 17, 2026
d5ade58
fix(card): add aspectRatio prop to Card.Cover
Stoneski93 Nov 18, 2026
07ebcd6
chore(example): remove the Card render count example
Stoneski93 Nov 18, 2026
e5f51cc
fix(card): drive state feedback with React state
Stoneski93 Nov 18, 2026
b12320a
fix(card): draw the pressed state layer once
Stoneski93 Nov 18, 2026
59ae8fa
fix(card): draw the state layer over the slot content
Stoneski93 Nov 18, 2026
6eeacd3
fix(card): dim the content of a disabled Card
Stoneski93 Nov 18, 2026
95038c6
feat(card): restore the borderColor prop for outlined Cards
Stoneski93 Nov 18, 2026
5659f00
docs(card): merge the Card migration notes into one section
Stoneski93 Nov 18, 2026
a9f2d45
docs(card): render the title once in the navigation theming example
Stoneski93 Nov 18, 2026
5586f16
test(card): assert Card visuals directly instead of whole-tree snapshots
Stoneski93 Nov 18, 2026
ff0c19c
fix(card): let aspectRatio size a Card.Cover from a static source
Stoneski93 Nov 18, 2026
d0a0a32
docs(example): rebuild the Card example around a variant switcher
Stoneski93 Nov 18, 2026
4b6878d
docs: document Surface from its own component again
Stoneski93 Nov 18, 2026
a05ec87
fix(docs): merge prop types only across union branches
Stoneski93 Nov 18, 2026
6788761
fix(card): annotate the resolveCardVisuals return type
Stoneski93 Nov 18, 2026
3f4f5c3
docs(card): drop removed Button props from the Card examples
Stoneski93 Nov 18, 2026
90ec7f0
fix(card): skip the actions warning when the actions slot is empty
Stoneski93 Nov 18, 2026
0ae62d9
docs(example): show every Card state in each variant
Stoneski93 Nov 18, 2026
fe9953f
fix(card): pad Card.Actions 16dp at the sides
Stoneski93 Nov 18, 2026
1907341
docs(card): note the single-pointer alternative to dragging
Stoneski93 Nov 18, 2026
e823c0f
fix(card): keep Card.Title visible in a row-laid-out Card
Stoneski93 Nov 18, 2026
64d3ef8
fix(card): accept a union variant on a Card without a header
Stoneski93 Nov 18, 2026
9f244d2
fix(card): drop theme.animation.scale, removed on main
Stoneski93 Nov 18, 2026
7d5d214
fix(card): clear state feedback when a Card stops being actionable
Stoneski93 Nov 19, 2026
48772be
fix(card): ignore focus that bubbles up from a descendant
Stoneski93 Nov 19, 2026
8d987e8
fix(card): restore main's 194dp default cover height
Stoneski93 Nov 20, 2026
6056a2f
fix(card): show the focused outline color over a custom borderColor
Stoneski93 Nov 20, 2026
3a436e7
docs(card): note that Card.Cover style now applies to the image
Stoneski93 Nov 20, 2026
1b70506
test(card): query the nested Button by role in the focus ring test
Stoneski93 Nov 20, 2026
f35fdda
docs(card): explain the aria-disabled pass-through and the actions check
Stoneski93 Nov 20, 2026
7fa3090
refactor(card): move resolveCardVisuals to utils.ts
Stoneski93 Nov 20, 2026
ea6f530
refactor(card): name the layout helpers' spacing in tokens
Stoneski93 Nov 20, 2026
d6acca8
docs(card): record the November recheck of the Card tokens
Stoneski93 Nov 20, 2026
b1117bc
perf(card): drop the Card layers that draw nothing
Stoneski93 Nov 20, 2026
fdaffe9
fix(card): space Card regions as on main
Stoneski93 Nov 20, 2026
37e974a
fix(card): round all four corners of Card.Cover again
Stoneski93 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
294 changes: 173 additions & 121 deletions docs/6.x/docs/guides/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ So you can use Reanimated's `useSharedValue` and `useAnimatedStyle` to animate t

```tsx
import { useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
import { Card, Text } from 'react-native-paper';

const MyComponent = () => {
const opacity = useSharedValue(1);
const animatedStyle = useAnimatedStyle(() => ({
opacity: opacity.value,
}));

return <Card style={animatedStyle}>Button</Card>;
return <Card content={<Text>Animated Card</Text>} style={animatedStyle} />;
};
```

Expand Down Expand Up @@ -75,7 +76,7 @@ To follow the same preference in your own components, use the `useReduceMotion()
The `elevation` prop no longer accepts a React Native `Animated.Value` in the following components:

- `Banner`
- `Card`
- `Card` (`variant="elevated"` only)
- `Searchbar`
- `Snackbar`
- `Surface`
Expand Down Expand Up @@ -494,6 +495,176 @@ e.g.:
+ </View>
```

### Card

Paper 6 replaces the Card's `mode` and arbitrary-children interfaces with Material 3 variants and explicit slots. These interfaces were removed; they are not deprecated APIs. Migrate each Card directly to the new contract.

#### Variants and default

Replace `mode` with `variant`:

| Paper 5 | Paper 6 |
| ------------------ | -------------------- |
| `mode="contained"` | `variant="filled"` |
| `mode="elevated"` | `variant="elevated"` |
| `mode="outlined"` | `variant="outlined"` |

The default also changed. A Paper 5 Card without `mode` was elevated; a Paper 6 Card without `variant` is filled and has no resting shadow. Add `variant="elevated"` if you need to preserve the old default emphasis. The `elevation` prop is accepted only with `variant="elevated"`.

#### Replace nested composition with slots

Arbitrary Card children were removed. Paper 6 renders the explicit regions in the deterministic order `media`, header, `content`, and `actions`, regardless of the order in which props are written. Arrays, fragments, conditional values, and custom wrappers can be passed inside a slot without changing region placement.

For the common header form, move `Card.Title` values to `title`, `subtitle`, `leading`, and `trailing`. Move the remaining regions to their corresponding slots:

```tsx
// Before (v5)
<Card mode="contained" onPress={openDetails}>
<Card.Cover source={{ uri: coverUri }} />
<Card.Title title="Weekend trip" subtitle="2 days" />
<Card.Content>
<Text variant="bodyMedium">View the itinerary.</Text>
</Card.Content>
</Card>

// After (v6)
<Card
accessibilityLabel="Open weekend trip details"
onPress={openDetails}
media={<Card.Cover source={{ uri: coverUri }} />}
title="Weekend trip"
subtitle="2 days"
content={
<Card.Content>
<Text variant="bodyMedium">View the itinerary.</Text>
</Card.Content>
}
/>
```

Use `header` when the complete header is custom. It is mutually exclusive with `title`, `subtitle`, `leading`, and `trailing`:

```tsx
<Card
variant="outlined"
header={<TripHeader trip={trip} />}
content={
<Card.Content>
<Text>{trip.summary}</Text>
</Card.Content>
}
/>
```

`Card.Content`, `Card.Cover`, `Card.Title`, and `Card.Actions` remain available as layout helpers inside the new slots. They are not arbitrary Card children.

#### `Card.Content` padding

`Card.Content` no longer changes its padding based on its neighbors. In Paper 5 it added top padding only when it came first and bottom padding only when it came last. Now each region pads its own top and sides with `16dp`, and the Card adds `16dp` below its last region. An action row instead ends `8dp` below its buttons. `Card.Title` no longer has a minimum height: it sizes from its content.

Used outside a Card, `Card.Content` has no bottom padding. Add it with the `style` prop:

```tsx
<Card.Content style={{ paddingBottom: 16 }}>
<Text>Shown outside a Card</Text>
</Card.Content>
```

#### Horizontal layout

To place the regions in a row, set `flexDirection` in `contentStyle`, which styles the wrapper around the slots. Also set `paddingBottom: 0`, so the media in the row reaches the Card's bottom edge instead of sitting above the `16dp` the Card adds below its last region:

```tsx
<Card
contentStyle={{ flexDirection: 'row', paddingBottom: 0 }}
media={<Card.Cover source={cover} style={{ width: 72, height: 72 }} />}
title="Card title"
/>
```

#### Outline color

The `borderColor` in `style` no longer changes the outline color of an outlined Card. Use the `borderColor` prop instead. It is accepted only with `variant="outlined"`:

```diff
<Card
- mode="outlined"
- style={{ borderColor: 'red' }}
+ variant="outlined"
+ borderColor="red"
title="Card title"
/>
```

#### `Card.Cover`

Use the `aspectRatio` prop to size a cover responsively. It replaces the default height of `194`:

```tsx
<Card media={<Card.Cover source={cover} aspectRatio={16 / 9} />} />
```

`Card.Cover` rounds all four corners with the theme's `corner.medium`, as in Paper 5, and the Card also clips its media to the Card's shape. Pass `borderRadius` in the cover's `style` to change the rounding.

`Card.Cover` no longer wraps its image in a `View`. Its `style` is now typed as `ImageStyle` and applies to the `Image` itself instead of a wrapper `View`. To style the area around the cover, wrap the cover in your own `View`:

```diff
- <Card.Cover source={cover} style={{ padding: 8 }} />
+ <View style={{ padding: 8 }}>
+ <Card.Cover source={cover} />
+ </View>
```

#### `Card.Actions` no longer styles its buttons

`Card.Actions` no longer assigns `mode="outlined"` to its first button, `mode="contained"` (now `mode="filled"`) to the rest, or `compact` to any of them. It only lays its children out in a row; set each `Button`'s `mode` explicitly to keep the old look. `compact` was removed from `Button`; see [`Button`](#button) for its `size` replacement:

```tsx
// Before (v5) — Card.Actions styled the buttons automatically
<Card.Actions>
<Button onPress={discard}>Discard</Button>
<Button onPress={save}>Save</Button>
</Card.Actions>

// After (v6) — set mode explicitly
<Card.Actions>
<Button mode="outlined" onPress={discard}>Discard</Button>
<Button mode="filled" onPress={save}>Save</Button>
</Card.Actions>
```

`Card.Actions` also has **16dp** of padding at the start and end, the Material Design 3 Card padding, instead of 8dp, and 8dp above and below. To keep the 5.x spacing, pass `style={{ paddingHorizontal: 8, paddingTop: 0 }}`.

#### Choose one interaction model

Give the Card an interaction handler when the whole Card represents one action. It becomes one accessibility target with button semantics by default, so do not place independent controls in its `actions` slot.

When buttons or other controls perform independent actions, keep the Card itself neutral and put those controls in `actions`:

```tsx
<Card
variant="elevated"
title="Draft itinerary"
content={
<Card.Content>
<Text>Review before saving.</Text>
</Card.Content>
}
actions={
<Card.Actions>
<Button onPress={discard}>Discard</Button>
<Button mode="filled" onPress={save}>
Save
</Button>
</Card.Actions>
}
/>
```

Paper 6 warns in development if whole-Card interaction handlers and a populated `actions` slot are combined. A neutral Card remains a grouping container unless you provide accessibility semantics explicitly. The `dragged` prop controls the Material dragged presentation only; drag gestures and lifecycle remain application responsibilities.

Card refs and test IDs now target documented nodes: `ref` targets the outer shell, `touchableRef` targets the actionable interaction node, and `testID` targets the interaction node for actionable Cards or the slot-content node for neutral Cards.

### Surface

- The `elevation` prop no longer accepts a React Native `Animated.Value`. Any `elevation` changes are animated automatically.
Expand Down Expand Up @@ -1091,125 +1262,6 @@ These need no code change, but the rendering differs:
`elevated` and `outlined`, and **12dp** for `text` (**16dp** with an icon).
Existing buttons change width.

### 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="filled">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="filled">Action</Button>
<Button mode="outlined">Another Action</Button>
</Card.Actions>
</Card>
```

#### Outline color

The `borderColor` in `style` no longer changes the outline color in `outlined` mode. Use the `borderColor` prop instead:

```diff
<Card
mode="outlined"
- style={{ borderColor: 'red' }}
+ borderColor="red"
>
<Card.Content>...</Card.Content>
</Card>
```

#### `Card.Cover`

The `style` prop of `Card.Cover` is now typed as a `View` style. Image style properties such as `resizeMode` or `tintColor` were never applied, so pass them as `Image` props instead:

```diff
- <Card.Cover source={cover} style={{ resizeMode: 'contain' }} />
+ <Card.Cover source={cover} resizeMode="contain" />
```

`Card.Cover` no longer applies the border radius from `style` to the image directly. The image is clipped by the container, so any border radius passed in `style` still applies.

#### `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="filled"` (formerly `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="filled">Ok</Button>
</Card.Actions>
```

### List

#### `List.Accordion`
Expand Down
13 changes: 6 additions & 7 deletions docs/6.x/docs/guides/theming-with-react-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ For React Native Paper theme to work, we need to use `PaperProvider` also at the
```js
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { TouchableOpacity } from 'react-native';
import { Card, Text, List, PaperProvider } from 'react-native-paper';

const Stack = createNativeStackNavigator();
Expand All @@ -54,21 +53,21 @@ const title = 'Card title';
const content = 'Card content';

const HomeScreen = ({ navigation }) => (
<TouchableOpacity
<Card
accessibilityLabel={`Open ${title}`}
onPress={() =>
navigation?.push('Details', {
title,
content,
})
}
>
<Card>
title={title}
content={
<Card.Content>
<Text variant="titleLarge">{title}</Text>
<Text variant="bodyMedium">{content}</Text>
</Card.Content>
</Card>
</TouchableOpacity>
}
/>
);

const DetailsScreen = (props) => {
Expand Down
Loading