You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce72155
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/6.x/docs/guides/migration.md
+136Lines changed: 136 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,6 +251,24 @@ When the dialog is `dismissable`, screen reader users can dismiss it with a visu
251
251
- The default elevation changed from level `1` to level `3`.
252
252
- 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.
253
253
254
+
#### `Dialog.Actions`
255
+
256
+
`Dialog.Actions` no longer injects `compact` on its buttons. To keep the previous behavior, you need to add the `compact` prop to each button:
257
+
258
+
```tsx
259
+
// Before (v5)
260
+
<Dialog.Actions>
261
+
<Button onPress={hide}>Done</Button>
262
+
</Dialog.Actions>
263
+
264
+
// After (v6)
265
+
<Dialog.Actions>
266
+
<Button compact onPress={hide}>
267
+
Done
268
+
</Button>
269
+
</Dialog.Actions>
270
+
```
271
+
254
272
### Menu
255
273
256
274
The `overlayAccessibilityLabel` prop was renamed to `dismissAccessibilityLabel`:
@@ -410,6 +428,124 @@ const theme = {
410
428
/>
411
429
```
412
430
431
+
### Card
432
+
433
+
#### `Card` layout
434
+
435
+
`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.
436
+
437
+
For the related components:
438
+
439
+
-`Card.Cover` and `Card.Actions` now apply negative margins to extend into the Card's edges:
440
+
-`Card.Cover` applies top, left and right margins for vertical cards and left, top, and bottom margins for horizontal cards.
441
+
-`Card.Actions` applies bottom, left, and right margins for vertical cards and left, bottom, and right margins for horizontal cards.
442
+
-`Card.Title` and `Card.Content` no longer apply padding around them.
443
+
444
+
This means, in a typical card layout, the Card will automatically apply the necessary spacing between these sections:
445
+
446
+
```tsx
447
+
<Card>
448
+
<Card.Coversource={cover} />
449
+
<Card.Titletitle="Card title" />
450
+
<Card.Content>
451
+
<Text>Card content</Text>
452
+
</Card.Content>
453
+
<Card.Actions>
454
+
<Buttonmode="contained">Action</Button>
455
+
<Buttonmode="outlined">Another Action</Button>
456
+
</Card.Actions>
457
+
</Card>
458
+
```
459
+
460
+
So your existing layouts with the following structure will continue to work as before:
461
+
462
+
-`Card` without `Card.Cover` or `Card.Actions`.
463
+
-`Card` with `Card.Cover` at the top and/or `Card.Actions` at the bottom.
464
+
465
+
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:
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.
`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:
510
+
511
+
```tsx
512
+
// Before (v5)
513
+
<Card.Actions>
514
+
<Button>Cancel</Button>
515
+
<Button>Ok</Button>
516
+
</Card.Actions>
517
+
518
+
// After (v6)
519
+
<Card.Actions>
520
+
<Buttonmode="outlined">Cancel</Button>
521
+
<Buttonmode="contained">Ok</Button>
522
+
</Card.Actions>
523
+
```
524
+
525
+
### List
526
+
527
+
#### `List.Accordion`
528
+
529
+
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.
0 commit comments