From 27e1c72c14e5cfc9ad292da8e01e3ec4b8c8d66b Mon Sep 17 00:00:00 2001 From: Doberjohn Date: Tue, 24 Nov 2026 14:05:21 +0200 Subject: [PATCH 1/2] docs(migration): fix the Switch, IconButton, TextInput and Dialog notes Corrects four places in the 6.x migration guide: - Focus indicator: a Switch without onValueChange is read-only and isn't a keyboard stop. A Drawer.CollapsedItem without onPress still is. - IconButton: filled and tonal draw primary and secondaryContainer at rest, where 5.x drew surfaceVariant until selected. The guide shows how to keep the 5.x look with containerColor and iconColor. - TextInput: the iconSize sample passes the accessory props, so it type checks. - Dialog: a dialog without content keeps the content area's 24dp bottom padding. The guide gives the contentProps workaround. Part of #4991 --- docs/6.x/docs/guides/migration.md | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/6.x/docs/guides/migration.md b/docs/6.x/docs/guides/migration.md index 301b800d29..509503b5ef 100644 --- a/docs/6.x/docs/guides/migration.md +++ b/docs/6.x/docs/guides/migration.md @@ -415,7 +415,7 @@ Interactive components now draw the Material Design 3 keyboard focus indicator: Components that fill a clipping container or touch their neighbours draw the ring 3dp inside their edge instead: `List.Item`, `List.Accordion`, `Checkbox.Item`, `RadioButton.Item`, `Menu.Item`, the `FAB.Menu` items, `Drawer.Item`, the `BottomNavigation` tabs, `DataTable.Row`, `DataTable.Cell`, `DataTable.Title` and `SegmentedButtons`. `Drawer.CollapsedItem` draws it around its icon and label, 2dp clear of the active indicator. `FAB` and `Switch` draw this ring instead of their own, and `Checkbox` keeps its circular ring around the state layer. -A `TouchableRipple`, and every component built on it, rings only while it can be pressed. A disabled one shows no ring. One with no touch handler and no `disabled` is the plain view described in [TouchableRipple without a press handler](#touchableripple-without-a-press-handler): it isn't a keyboard stop, so it never rings. This applies to `TouchableRipple` only: a `Switch` or `Drawer.CollapsedItem` without a handler is still a keyboard stop and rings. +A `TouchableRipple`, and every component built on it, rings only while it can be pressed. A disabled one shows no ring. One with no touch handler and no `disabled` is the plain view described in [TouchableRipple without a press handler](#touchableripple-without-a-press-handler): it isn't a keyboard stop, so it never rings. This applies to `TouchableRipple` only: a `Drawer.CollapsedItem` without `onPress` is still a keyboard stop and rings. A `Switch` without `onValueChange` is read-only, so it isn't a keyboard stop and never rings, as [Switches without `onValueChange`](#switches-without-onvaluechange) explains. An outward ring sits outside the component, so a scroll view or a container with `overflow: 'hidden'` clips it, and a neighbour that touches the component can cover it. Chips in a horizontal `ScrollView`, or a `TouchableRipple` that fills the width of a scroll view, show only part of the ring. Give the container 5dp of padding, or pass `focusRing="inward"` where the component takes it: @@ -778,6 +778,8 @@ The new **`actions`** prop is more customizable because it accepts **`React.Reac /> ``` +A dialog without `content` still renders the content area with its 24dp bottom padding, so a dialog with only a `title` and `actions` has 40dp between them instead of 16dp in 5.x, and one with only `actions` places them 48dp below the top of the dialog instead of 24dp. To keep the 5.x spacing, pass `contentProps={{ style: { paddingBottom: 0 } }}`. + #### Dialog actions The dialog no longer injects `compact` on its action buttons, and the default [`Button`](#button) mode is now `filled`. Add `mode="text"` to each button. At the default `small` size, the buttons are **40dp** tall, the Material Design 3 size for dialog actions. The `compact` text buttons in 5.x were **38dp** tall. For a more compact look, also add `size="extra-small"`, which is **32dp** tall: @@ -1043,10 +1045,14 @@ const [value, setValue] = React.useState(''); ```tsx // Before (v5) - +} /> // After (v6) - + ( + + )} +/> ``` #### Label and supporting text @@ -1506,6 +1512,25 @@ An accordion with a `left` element now indents only its `List.Item` children. An ``` +The colors at rest changed too. In 5.x, a `contained` or `contained-tonal` button that wasn't `selected` drew a `surfaceVariant` container, with a `primary` icon for `contained` and an `onSurfaceVariant` icon for `contained-tonal`. Only a selected one drew `primary` with an `onPrimary` icon, or `secondaryContainer` with an `onSecondaryContainer` icon. In 6.x, `filled` and `tonal` draw those colors at rest. To keep the 5.x look, pass the 5.x colors as `containerColor` and `iconColor`: + +```tsx + + +``` + #### 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. @@ -1600,6 +1625,8 @@ For `filled`, the default and toggle-on containers use `primary`. Toggle-off (`s /> ``` +Neither keeps the 5.x look, a `surfaceVariant` container with a `primary` icon: `filled` draws `primary` at rest and `surfaceContainer` when toggled off, so pass `containerColor` and `iconColor` as in [Mode names](#mode-names), on a toggle only while it is off. + #### `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`. From 90e10d7580a56e9c769b9d297dfe5442bcafc60e Mon Sep 17 00:00:00 2001 From: Doberjohn Date: Tue, 24 Nov 2026 14:23:00 +0200 Subject: [PATCH 2/2] docs(migration): note IconButton's tonal toggle and outline colors A selected tonal button draws secondary instead of secondaryContainer, so a 5.x tonal toggle that is off now looks like one that was on. The outlined outline uses outlineVariant instead of outline, also when disabled. Part of #4991 --- docs/6.x/docs/guides/migration.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/6.x/docs/guides/migration.md b/docs/6.x/docs/guides/migration.md index 509503b5ef..8f35158461 100644 --- a/docs/6.x/docs/guides/migration.md +++ b/docs/6.x/docs/guides/migration.md @@ -1531,6 +1531,8 @@ The colors at rest changed too. In 5.x, a `contained` or `contained-tonal` butto /> ``` +`outlined` keeps its name, but its outline uses `outlineVariant` instead of `outline`, and keeps it when disabled instead of switching to `surfaceDisabled`. A theme that set `colors.outline` to restyle outlined icon buttons sets `outlineVariant` now. + #### 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. @@ -1627,6 +1629,19 @@ For `filled`, the default and toggle-on containers use `primary`. Toggle-off (`s Neither keeps the 5.x look, a `surfaceVariant` container with a `primary` icon: `filled` draws `primary` at rest and `surfaceContainer` when toggled off, so pass `containerColor` and `iconColor` as in [Mode names](#mode-names), on a toggle only while it is off. +For `tonal`, toggle-on draws `secondary` with an `onSecondary` icon, and toggle-off draws the default `secondaryContainer` with an `onSecondaryContainer` icon, the colors a selected 5.x `contained-tonal` button drew. So a 5.x tonal toggle that is off now looks like one that was on. To keep the 5.x colors, pass them for both states: + +```tsx + +``` + #### `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`.