MUI responsive Tabs

Viewed 1274

Is it possible to make MUI Tabs to be responsive?

What I have:

what I have

What I want to achieve:

what I want to achieve

1 Answers

You can set flexWrap: 'wrap' in the tab container component which is a flexbox:

<Tabs
  // disable the tab indicator because it doesn't work well with wrapped container
  TabIndicatorProps={{ sx: { display: 'none' } }}
  sx={{
    '& .MuiTabs-flexContainer': {
      flexWrap: 'wrap',
    },
  }}
  {...}
>

Codesandbox Demo

Related