Search code examples
reactjsscrolltabsnavigationmaterial-ui

Change scroll button Icon on Material UI Tabs component


I need to change the icon of the scroll buttons (left and right) of Tabs component.

There's a props called 'ScrollButtonComponent, but I don't know how can I put different left and right icons in the buttons.

Print of the component

https://material-ui.com/components/tabs/


Solution

  • Please go to TabScrollButton.js inside nodeModule folder and then change KeyboardArrowLeft or KeyboardArrowRight inside ButtonBase section. TabScrollButton

    <ButtonBase
          component="div"
          className={className}
          ref={ref}
          role={null}
          tabIndex={null}
          {...other}
        >
          {direction === 'left' ? (
            <KeyboardArrowLeft fontSize="small" />
          ) : (
            <KeyboardArrowRight fontSize="small" />
          )}
        </ButtonBase>
      );