Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2289,23 +2289,23 @@ Here's how to migrate:

### ScrollButtonComponent

The Tabs's `ScrollButtonComponent` prop was deprecated in favor of `slots.scrollButton`:
The Tabs's `ScrollButtonComponent` prop was deprecated in favor of `slots.scrollButtons`:

```diff
<Tabs
- ScrollButtonComponent={ScrollButtonComponent}
+ slots={{ scrollButton: ScrollButtonComponent }}
+ slots={{ scrollButtons: ScrollButtonComponent }}
/>
```

### TabScrollButtonProps

The Tabs's `TabScrollButtonProps` prop was deprecated in favor of `slotProps.scrollButton`:
The Tabs's `TabScrollButtonProps` prop was deprecated in favor of `slotProps.scrollButtons`:

```diff
<Tabs
- TabScrollButtonProps={TabScrollButtonProps}
+ slotProps={{ scrollButton: TabScrollButtonProps }}
+ slotProps={{ scrollButtons: TabScrollButtonProps }}
/>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export default function transformer(file, api, options) {
packageName: options.packageName,
componentName: 'Tabs',
propName: 'ScrollButtonComponent',
slotName: 'scrollButton',
slotName: 'scrollButtons',
});
movePropIntoSlotProps(j, {
root,
packageName: options.packageName,
componentName: 'Tabs',
propName: 'TabScrollButtonProps',
slotName: 'scrollButton',
slotName: 'scrollButtons',
});

movePropIntoSlotProps(j, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { Tabs as MyTabs } from '@mui/material';

<Tabs
slots={{
scrollButton: CustomScrollButton
scrollButtons: CustomScrollButton
}}
slotProps={{
scrollButton: { disableRipple: true },
scrollButtons: { disableRipple: true },
indicator: { className: 'indicator' }
}} />;

<MyTabs
slots={{
scrollButton: CustomScrollButton
scrollButtons: CustomScrollButton
}}
slotProps={{
scrollButton: { disableRipple: true },
scrollButtons: { disableRipple: true },
indicator: { className: 'indicator' }
}} />;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { Tabs as MyTabs } from '@org/ui/material';

<Tabs
slots={{
scrollButton: CustomScrollButton
scrollButtons: CustomScrollButton
}}
slotProps={{
scrollButton: { disableRipple: true },
scrollButtons: { disableRipple: true },
indicator: { className: 'indicator' }
}} />;

<MyTabs
slots={{
scrollButton: CustomScrollButton
scrollButtons: CustomScrollButton
}}
slotProps={{
scrollButton: { disableRipple: true },
scrollButtons: { disableRipple: true },
indicator: { className: 'indicator' }
}} />;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ fn({
MuiTabs: {
defaultProps: {
slots: {
scrollButton: CustomScrollButton
scrollButtons: CustomScrollButton
},

slotProps: {
scrollButton: { disableRipple: true },
scrollButtons: { disableRipple: true },
indicator: { className: 'indicator' }
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Tabs/Tabs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export type TabsSlotsAndSlotProps = CreateSlotsAndSlotProps<
*/
indicator: SlotProps<'span', TabsIndicatorSlotPropsOverrides, TabsOwnerState>;
/**
* Props forwarded to the scrollButton slot.
* Props forwarded to the scrollButtons slot.
* By default, the available props are based on the [TabScrollButton](https://mui.com/material-ui/api/tab-scroll-button/#props) component.
*/
scrollButtons: SlotProps<
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ const Tabs = React.forwardRef(function Tabs(inProps, ref) {
slots,
slotProps: {
indicator: TabIndicatorProps,
scrollButton: TabScrollButtonProps,
scrollButtons: TabScrollButtonProps,
...slotProps,
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Tabs/Tabs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ describe.skipIf(isSafari)('<Tabs />', () => {
});
});

describe('scrollButton slot', () => {
describe('scrollButtons slot', () => {
it('should render start and end scroll buttons', () => {
render(
<Tabs
Expand Down
Loading