Skip to content

feat: tabs styles classnames#438

Merged
hcopp merged 18 commits intomasterfrom
hunter/tabs-styles-classnames
Feb 27, 2026
Merged

feat: tabs styles classnames#438
hcopp merged 18 commits intomasterfrom
hunter/tabs-styles-classnames

Conversation

@hcopp
Copy link
Contributor

@hcopp hcopp commented Feb 25, 2026

What changed? Why?

This PR

  1. Adds styles/classNames props to Tab, SegmentedTab, and PeriodSelector
  2. Fixed borderRadius issues on SegmentedTab and SlideButton
  3. Updated docs

Root cause (required for bugfixes)

UI changes

Docs

Components

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Feb 25, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS ✅ See below

CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 1/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

tabs={tabs}
width="100%"
/>
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a bug where it would throw an error if you selected a tab

| 'compact'
| 'disabled'
| 'uncheckedLabel'
| 'variant'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should create a shared type for al border props (and maybe subtype for border radius props.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not necessary at this point. Unless we find out we are explicitly using border props everywhere in CDS components. In that case we can do a non-breaking refactor later.

activeBackground = 'bgInverse',
background = 'bgSecondary',
borderRadius = 1000,
borderRadius = 700,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change to technically match design, shouldn't have a visual impact unless someone had larger spacing tokens.

tab: 'cds-PeriodSelector-tab',
/** Active indicator element */
activeIndicator: 'cds-PeriodSelector-activeIndicator',
} as const;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on this? Customers get these static classnames at each level, meaning you have all three as classNames.

cds-Tabs-tab cds-SegmentedTabs-tab cds-PeriodSelector-tab

I see the benefit, so someone could target. But also wondering if we should allow an overwrite, and just have cds-PeriodSelector-tab.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped static classnames for now, per discussion in Slack

/** Active indicator element */
activeIndicator?: StyleProp<ViewStyle>;
};
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With TabsProps being generic, I wasn't able to get the comments from it to show in docs, so recreating I thought is best best workaround until we decide static classnames here.

@hcopp hcopp changed the title Hunter/tabs styles classnames feat: tabs styles classnames Feb 26, 2026
activeBackground = 'bgInverse',
background = 'bgSecondary',
borderRadius = 1000,
borderRadius = 700,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match design we updated it, again shouldn't have issues. For PeriodSelector design shows 1000.

| 'compact'
| 'disabled'
| 'uncheckedLabel'
| 'variant'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not necessary at this point. Unless we find out we are explicitly using border props everywhere in CDS components. In that case we can do a non-breaking refactor later.

{...props}
>
<Box as="span" justifyContent="center" paddingX={2} paddingY={1}>
<MotionBox as="span" justifyContent="center" paddingX={2} paddingY={1} {...motionProps}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for moving motion from text to the wrapping box, and do we have any regression risk from this change?

@hcopp hcopp merged commit c959dbd into master Feb 27, 2026
30 checks passed
@hcopp hcopp deleted the hunter/tabs-styles-classnames branch February 27, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants