Skip to content

refactor: use one size name per control height - #975

Open
rohanchkrabrty wants to merge 6 commits into
mainfrom
refactor/size-names
Open

rohanchkrabrty wants to merge 6 commits into
mainfrom
refactor/size-names

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Rename the 32px control size to medium: Button normal, and large on Input, TextArea, Search, Combobox.Input, Command.Input, Checkbox, Radio and Switch. Pixel sizes and defaults do not change.
  • Rename Badge sizes micro to mini and regular to medium. small stays the default.
  • Rename Tabs sizes small, medium and large to mini, small and medium, so the 32px segmented list is medium, like Button and Input. Pixel sizes do not change, so the default is now small.
  • Replace Separator size (small, half, full) with variant (full, middle). middle insets both ends of the line.
  • Update internal usages (DataView Timeline badges and view switcher, CalendarPreview scales), docs pages, playgrounds, Figma templates, the add-new-component skill example and the Upgrading page.

Decisions where the proposal is silent:

  • Size names from smallest to largest are micro, mini, small, medium and large. The size right below small is mini, so Badge uses mini, not the proposal's xsmall.
  • Tabs still accepts small and medium, so TypeScript does not report old Tabs values. The Upgrading page tells readers to check each Tabs size.
  • Separator middle insets each end by 16px on a horizontal line and 8px on a vertical line, as MUI Divider middle does. The line is centered. half and small both map to middle, so the length of those lines changes (they were 50% and 20px).
  • Button small stays 22px, and Badge stays 18, 22 and 28px. These do not match the 24px and 32px rule. They are open items for design.
  • Checkbox, Radio and Switch medium keep their current sizes.
  • CSS module classes follow the pattern each file already uses (.medium, size-medium, badge-mini). The new Separator classes are variant-full and variant-middle.
  • docs/V1-migration.md keeps the old names, because it describes the 1.0 release.
  • The Separator orientation demo is rewritten, because it used size="half". The Input playground uses defaultValue, so the default size is left out of the generated code.

Checks run after the merge with main: pnpm lint, pnpm exec tsc --noEmit in packages/react, and vitest --run in packages/react (3899 tests) pass. Before the Tabs rename and the merge, I compared 17 docs pages on a local dev server with the deployed docs in light and dark themes. The computed size, spacing and color of every demo part matched. Only the demo labels and the Separator demos differed. Before the merge, a local page measured the segmented Tabs list at 24, 28 and 32px for mini, small and medium, next to Button small (22px) and medium (32px).

@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
apsara Ready Ready Preview Nov 16, 2026 7:39am UTC

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8863252b-6fa7-4058-91b3-0003e55909e9
Commits

Reviewing files that changed from the base of the PR and between 5e6859b and 5e218a2.

Files selected for processing: 88

  • .agents/skills/add-new-component/SKILL.md
  • apps/www/src/components/dataview-demo.tsx
  • apps/www/src/components/docs/footer.tsx
  • apps/www/src/components/tag/tag.module.css
  • apps/www/src/components/tag/tag.tsx
  • apps/www/src/content/docs/(overview)/upgrading.mdx
  • apps/www/src/content/docs/ai-elements/prompt-input/demo.ts
  • apps/www/src/content/docs/components/badge/demo.ts
  • apps/www/src/content/docs/components/badge/index.mdx
  • apps/www/src/content/docs/components/badge/props.ts
  • apps/www/src/content/docs/components/button/demo.ts
  • apps/www/src/content/docs/components/button/index.mdx
  • apps/www/src/content/docs/components/checkbox/demo.ts
  • apps/www/src/content/docs/components/checkbox/index.mdx
  • apps/www/src/content/docs/components/checkbox/props.ts
  • apps/www/src/content/docs/components/chip/demo.ts
  • apps/www/src/content/docs/components/chip/index.mdx
  • apps/www/src/content/docs/components/chip/props.ts
  • apps/www/src/content/docs/components/combobox/demo.ts
  • apps/www/src/content/docs/components/combobox/props.ts
  • apps/www/src/content/docs/components/command/props.ts
  • apps/www/src/content/docs/components/floating-actions/demo.ts
  • apps/www/src/content/docs/components/floating-actions/props.ts
  • apps/www/src/content/docs/components/input/demo.ts
  • apps/www/src/content/docs/components/input/index.mdx
  • apps/www/src/content/docs/components/input/props.ts
  • apps/www/src/content/docs/components/radio/demo.ts
  • apps/www/src/content/docs/components/radio/index.mdx
  • apps/www/src/content/docs/components/radio/props.ts
  • apps/www/src/content/docs/components/search/demo.ts
  • apps/www/src/content/docs/components/search/index.mdx
  • apps/www/src/content/docs/components/search/props.ts
  • apps/www/src/content/docs/components/separator/demo.ts
  • apps/www/src/content/docs/components/separator/index.mdx
  • apps/www/src/content/docs/components/separator/props.ts
  • apps/www/src/content/docs/components/switch/demo.ts
  • apps/www/src/content/docs/components/switch/index.mdx
  • apps/www/src/content/docs/components/switch/props.ts
  • apps/www/src/content/docs/components/tabs/demo.ts
  • apps/www/src/content/docs/components/tabs/index.mdx
  • apps/www/src/content/docs/components/tabs/props.ts
  • apps/www/src/content/docs/components/textarea/demo.ts
  • apps/www/src/content/docs/components/textarea/index.mdx
  • apps/www/src/content/docs/components/textarea/props.ts
  • apps/www/src/content/docs/dataview/demo.ts
  • packages/react/components/badge/__tests__/badge.test.tsx
  • packages/react/components/badge/badge.module.css
  • packages/react/components/badge/badge.tsx
  • packages/react/components/button/__tests__/button.test.tsx
  • packages/react/components/button/button.module.css
  • packages/react/components/button/button.tsx
  • packages/react/components/calendar-preview/calendar-preview-scales.tsx
  • packages/react/components/checkbox/__tests__/checkbox.test.tsx
  • packages/react/components/checkbox/checkbox.module.css
  • packages/react/components/checkbox/checkbox.tsx
  • packages/react/components/chip/__tests__/chip.test.tsx
  • packages/react/components/chip/chip.module.css
  • packages/react/components/chip/chip.tsx
  • packages/react/components/command/command-input.tsx
  • packages/react/components/data-table/components/display-properties.tsx
  • packages/react/components/data-view/components/display-properties.tsx
  • packages/react/components/data-view/components/timeline.tsx
  • packages/react/components/data-view/components/view-switcher.tsx
  • packages/react/components/input/__tests__/input.test.tsx
  • packages/react/components/input/input.module.css
  • packages/react/components/input/input.tsx
  • packages/react/components/radio/__tests__/radio.test.tsx
  • packages/react/components/radio/radio.module.css
  • packages/react/components/radio/radio.tsx
  • packages/react/components/separator/__tests__/separator.test.tsx
  • packages/react/components/separator/separator.module.css
  • packages/react/components/separator/separator.tsx
  • packages/react/components/switch/__tests__/switch.test.tsx
  • packages/react/components/switch/switch.module.css
  • packages/react/components/switch/switch.tsx
  • packages/react/components/tabs/__tests__/tabs.test.tsx
  • packages/react/components/tabs/tabs.module.css
  • packages/react/components/tabs/tabs.tsx
  • packages/react/components/text-area/__tests__/text-area.test.tsx
  • packages/react/components/text-area/text-area.module.css
  • packages/react/components/text-area/text-area.tsx
  • packages/react/figma/badge.figma.ts
  • packages/react/figma/button.figma.ts
  • packages/react/figma/chip.figma.ts
  • packages/react/figma/search.figma.ts
  • packages/react/figma/separator.figma.ts
  • packages/react/figma/tabs.figma.ts
  • packages/react/figma/toolbar.figma.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@975

commit: 5e218a2

@ravisuhag

Copy link
Copy Markdown
Member

@rohanchkrabrty why micro -> xsmall ? for scale.

Auto margins stopped a stretched vertical middle line from growing, so it rendered 0px tall. The upgrading note no longer says middle is always longer than half and small.
|---|---|
| `size="full"` (default) | `variant="full"` (default) |
| `size="half"` | `variant="middle"` |
| `size="small"` | `variant="middle"`, or set the length with a class |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: I think "set the length with a class" won't work as written.
The variant rules are .variant-middle[data-orientation="vertical"] (a class plus an attribute), so a single consumer class loses whatever the load order.
middle also adds insets and sizes from the parent, while small was a fixed 20px line. variant="full" with an inline length gives the old result exactly.

Suggested change
| `size="small"` | `variant="middle"`, or set the length with a class |
| `size="small"` | `variant="full"` with `style={{ width: 20 }}`, or `height` on a vertical line |


/* Size variants */
.large {
.medium {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: AGENTS.md asks for <prop>-<value> variant classes, and the new Separator classes follow it (variant-full).
Since these selectors are being renamed anyway, what do you think about size-medium and size-small here and in Radio and Switch? Fine as a follow-up too, since the tests read styles.medium directly.

Comment thread packages/react/figma/badge.figma.ts Resolved
Badge xsmall becomes mini. Tabs small, medium and large become mini, small and medium, so the 32px segmented Tabs list is medium, like Button and Input. Pixel sizes do not change. The DataView view switcher and CalendarPreview scales keep their sizes.
# Conflicts:
#	apps/www/src/components/dataview-demo.tsx
#	apps/www/src/components/tag/tag.tsx
#	apps/www/src/content/docs/(overview)/upgrading.mdx
#	apps/www/src/content/docs/ai-elements/prompt-input/demo.ts
#	apps/www/src/content/docs/components/button/props.ts
#	packages/react/components/command/command-input.tsx
#	packages/react/components/data-view/components/timeline.tsx
#	packages/react/components/input/input.module.css
#	packages/react/components/input/input.tsx
#	packages/react/components/separator/separator.module.css
#	packages/react/components/text-area/text-area.tsx
Chip small and large become mini and small, so the 24px chip is small, like Input small. Pixel sizes do not change, and mini is the default. The DataView and DataTable display properties keep their size.

This branch was successfully deployed

1 active deployment
Preview — 5e218a21 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants