Skip to content

Commit b275f17

Browse files
committed
fix(tabs): spread style prop
1 parent 4e706ac commit b275f17

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/react-core/src/components/Tabs/Tabs.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export interface TabsProps
4747
children: TabsChild | TabsChild[];
4848
/** Additional classes added to the tabs */
4949
className?: string;
50+
/** Additional inline styles added to the tabs */
51+
style?: React.CSSProperties;
5052
/** Tabs background color variant */
5153
variant?: 'default' | 'secondary';
5254
/** The index of the active tab */
@@ -468,6 +470,7 @@ class Tabs extends Component<TabsProps, TabsState> {
468470
render() {
469471
const {
470472
className,
473+
style,
471474
children,
472475
activeKey,
473476
defaultActiveKey,
@@ -576,7 +579,11 @@ class Tabs extends Component<TabsProps, TabsState> {
576579
)}
577580
{...getOUIAProps(Tabs.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)}
578581
id={id && id}
579-
style={{ [linkAccentLength.name]: currentLinkAccentLength, [linkAccentStart.name]: currentLinkAccentStart }}
582+
style={{
583+
[linkAccentLength.name]: currentLinkAccentLength,
584+
[linkAccentStart.name]: currentLinkAccentStart,
585+
...style
586+
}}
580587
{...props}
581588
>
582589
{expandable && isVertical && (

packages/react-core/src/components/Tabs/examples/TabsDefault.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const TabsDefault: React.FunctionComponent = () => {
2727
isBox={isBox}
2828
aria-label="Tabs in the default example"
2929
role="region"
30+
style={{ border: '1px solid red' }}
3031
>
3132
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>} aria-label="Default content - users">
3233
Users

0 commit comments

Comments
 (0)