
components
Tabs
v.1.0.0 | SaturnUsage
The name of the tokens object to style the Tabs component is PRIMARY_TABS_STYLES.
You can not change the name of the object of tokens.
There is one prop that allows to modify different aspects of the component:
- Variant: modify the styles of the Tabs.
Variants
Variants can modify the styles for the Tabs. The tokens used are:
- tabContainer?: CommonStyleType & {
[Key in DeviceBreakpointsType]?: CommonStyleType & {
focusWithin?: CommonStyleType;
focus?: CommonStyleType;
focusVisible?: CommonStyleType;
};
}; - arrowLeftIconContainer?: Omit<CommonStyleType, 'MOBILE'> & {
[DeviceBreakpointsType.MOBILE]?: CommonStyleType & { focusVisible?: CommonStyleType };
}; -leftIcon?: IconTypes; - arrowRightIconContainer?: Omit<CommonStyleType, 'MOBILE'> & {
[DeviceBreakpointsType.MOBILE]?: CommonStyleType & { focusVisible?: CommonStyleType };
}; - rightIcon?: IconTypes
- firstTabButton?: CommonStyleType;
- lastTabButton?: CommonStyleType;
- oneTabContainer?: CommonStyleType;
- contentContainer?: CommonStyleType;
- tabButtonsContainer?: CommonStyleType;
- container: CommonStyleType;
- fullContainer: CommonStyleType;
12345678910
const PRIMARY_TABS_STYLES { [VARIANT]: { tabContainer?: { ...CommonStyleType, [DEVICE_BREAKPOINT]?: { focusWithin?: CommonStyleType, focus?: CommonStyleType, focusVisible?: CommonStyleType, }, },
Additionally, there are states to modify each Tab individually. The internal states are:
12345
enum TabsStateTypes { SELECTED, UNSELECTED, EMPTY, }
And the internal state tokens are:
- label?: TypographyTypes;
- tabButton?: CommonStyleType;
123456789
const PRIMARY_TABS_STYLES = { [VARIANT]: { ...restTokens, [PRIMARY_TABS_STATE]?: { label?: TypographyTypes, tabButton?: CommonStyleType, }, } }
Example
Tabs theme object example:
12345678910
const PRIMARY_TABS_STYLES = { [VARIANT]: { tabContainer?: { ...CommonStyleType, [DEVICE_BREAKPOINT]?: { focusWithin?: CommonStyleType, focus?: CommonStyleType, focusVisible?: CommonStyleType, }, },