Learn how to customize the theme and styles for tabs components, the theme object for tabs components has two main objects:
A. The defaultProps
object for setting up the default value for props of tabs component.
B. The styles
object for customizing the theme and styles of tabs component.
You can customize the theme and styles of tabs components by adding Tailwind CSS classes as key paired values for objects.
interface TabsStylesType {
defaultProps: {
className: string;
};
styles: {
base: object;
};
}
import type { TabsStylesType } from "@material-tailwind/react";
const theme = {
tabs: {
styles: {
base: {
display: "block",
overflow: "overflow-hidden",
},
},
},
};
interface TabsHeaderStylesType {
defaultProps: {
className: string;
};
styles: {
base: object;
};
}
import type { TabsHeaderStylesType } from "@material-tailwind/react";
const theme = {
tabsHeader: {
styles: {
base: {
display: "flex",
position: "relative",
},
},
},
};
interface TabsBodyStylesType {
defaultProps: {
animate: {
mount: object;
unmount: object;
};
className: string;
};
styles: {
base: object;
};
}
import type { TabsBodyStylesType } from "@material-tailwind/react";
const theme = {
tabsBody: {
styles: {
base: {
display: "block",
width: "w-full",
},
},
},
};
interface TabStylesType {
defaultProps: {
className: string;
disabled: boolean;
};
styles: {
base: {
tab: {
initial: object;
disabled: object;
};
indicator: object;
};
};
}
import type { TabStylesType } from "@material-tailwind/react";
const theme = {
tab: {
styles: {
base: {
tab: {
initial: {
display: "grid",
placeItems: "place-items-center",
},
disabled: {
opacity: "opacity-50",
cursor: "cursor-not-allowed",
},
},
},
},
},
};
interface TabPanelStylesType {
defaultProps: {
className: string;
};
styles: {
base: object;
};
}
import type { TabPanelStylesType } from "@material-tailwind/react";
const theme = {
tabPanel: {
styles: {
base: {
width: "w-full",
height: "h-max",
},
},
},
};