Skip to content

feat(components): migrate to unified radix-ui package + shadcn v4 RTL classes#1059

Merged
hotlong merged 2 commits intomainfrom
copilot/evaluate-shadcn-v4-upgrade-impact
Mar 10, 2026
Merged

feat(components): migrate to unified radix-ui package + shadcn v4 RTL classes#1059
hotlong merged 2 commits intomainfrom
copilot/evaluate-shadcn-v4-upgrade-impact

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 10, 2026

Aligns @object-ui/components with shadcn v4 (Jan–Feb 2026 changelog): adds logical side animation classes for RTL support and consolidates 27 individual @radix-ui/react-* packages into the unified radix-ui package.

Inline start/end animation classes

Per the January 2026 shadcn update, adds data-[side=inline-start] and data-[side=inline-end] slide-in classes to all floating content components so animations behave correctly in RTL layouts:

  • tooltip.tsx, popover.tsx, hover-card.tsx
  • dropdown-menu.tsx, context-menu.tsx, menubar.tsx, select.tsx

Unified radix-ui package migration

Per the February 2026 shadcn update, replaces 27 individual @radix-ui/react-* dependencies with the single radix-ui package.

Import pattern change (namespace semantics are identical — no usage logic changes):

// Before
import * as DialogPrimitive from "@radix-ui/react-dialog"

// After
import { Dialog as DialogPrimitive } from "radix-ui"

Slot named-import pattern (only case requiring usage updates):

// Before
import { Slot } from "@radix-ui/react-slot"
const Comp = asChild ? Slot : "button"

// After
import { Slot as SlotPrimitive } from "radix-ui"
const Comp = asChild ? SlotPrimitive.Slot : "button"

Covers all 48 UI components plus custom components (button-group, field, item, mobile-dialog-content). command.tsx's DialogProps type is now derived via React.ComponentProps<typeof DialogPrimitive.Root>. shadcn-components.json registry metadata updated to reflect the consolidated dependency.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 10, 2026

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

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Mar 10, 2026 4:31am
objectui-demo Ready Ready Preview, Comment Mar 10, 2026 4:31am
objectui-storybook Ready Ready Preview, Comment Mar 10, 2026 4:31am

Request Review

- Add inline-start/end CSS classes to tooltip, popover, hover-card,
  dropdown-menu, context-menu, menubar, and select components for RTL support
- Migrate all @radix-ui/react-* individual imports to unified radix-ui package
- Update package.json to use radix-ui instead of 27 individual @radix-ui packages
- Update command.tsx to derive DialogProps from Dialog namespace
- Migrate custom components (button-group, field, item, mobile-dialog-content)
- Update shadcn-components.json registry metadata

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Assess impact of upgrading shadcn to v4 feat(components): migrate to unified radix-ui package + shadcn v4 RTL classes Mar 10, 2026
@hotlong hotlong marked this pull request as ready for review March 10, 2026 05:06
Copilot AI review requested due to automatic review settings March 10, 2026 05:06
@hotlong hotlong merged commit ec25603 into main Mar 10, 2026
5 of 6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Aligns @object-ui/components with shadcn v4 updates by (1) migrating Radix imports/deps to the unified radix-ui package and (2) adding logical-side (inline-start / inline-end) animation classes to improve RTL behavior for floating UI primitives.

Changes:

  • Replace per-component @radix-ui/react-* dependencies with a single radix-ui dependency (plus corresponding import updates across UI/custom components).
  • Add data-[side=inline-start] / data-[side=inline-end] slide-in animation classes to popper-based content components (tooltip/popover/hover-card/menus/select).
  • Update shadcn-components.json dependency metadata to reflect the consolidated Radix dependency.

Reviewed changes

Copilot reviewed 38 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-lock.yaml Removes individual @radix-ui/react-* deps for the components package and adds radix-ui lock entries.
packages/components/package.json Swaps 27 individual Radix deps for a single radix-ui dependency.
packages/components/shadcn-components.json Updates component registry dependency lists to use radix-ui.
packages/components/src/ui/accordion.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/alert-dialog.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/aspect-ratio.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/avatar.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/breadcrumb.tsx Migrates Slot usage to radix-ui namespace export.
packages/components/src/ui/button.tsx Migrates Slot usage to radix-ui namespace export.
packages/components/src/ui/checkbox.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/collapsible.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/command.tsx Updates dialog prop typing to derive from radix-ui Dialog root.
packages/components/src/ui/context-menu.tsx Migrates Radix import and adds inline-start/end animation classes.
packages/components/src/ui/dialog.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/dropdown-menu.tsx Migrates Radix import and adds inline-start/end animation classes.
packages/components/src/ui/form.tsx Migrates Label/Slot imports to radix-ui namespace exports and updates Slot typing.
packages/components/src/ui/hover-card.tsx Migrates Radix import and adds inline-start/end animation classes.
packages/components/src/ui/label.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/menubar.tsx Migrates Radix import and adds inline-start/end animation classes.
packages/components/src/ui/navigation-menu.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/popover.tsx Migrates Radix import and adds inline-start/end animation classes.
packages/components/src/ui/progress.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/radio-group.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/scroll-area.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/select.tsx Migrates Radix import and adds inline-start/end animation classes to Select content.
packages/components/src/ui/separator.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/sheet.tsx Migrates Dialog import (Sheet) to radix-ui.
packages/components/src/ui/sidebar.tsx Migrates Slot usage to radix-ui namespace export across sidebar subcomponents.
packages/components/src/ui/slider.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/switch.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/tabs.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/toast.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/toggle-group.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/toggle.tsx Migrates Radix import to radix-ui.
packages/components/src/ui/tooltip.tsx Migrates Radix import and adds inline-start/end animation classes.
packages/components/src/custom/button-group.tsx Migrates Slot usage to radix-ui namespace export.
packages/components/src/custom/field.tsx Migrates Slot usage to radix-ui namespace export.
packages/components/src/custom/item.tsx Migrates Slot usage to radix-ui namespace export.
packages/components/src/custom/mobile-dialog-content.tsx Migrates Dialog import to radix-ui.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +86 to 89
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-select-content-transform-origin]",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

SelectContent adds the new data-[side=inline-start] / data-[side=inline-end] animation classes, but the popper translate offset still only handles left/right (data-[side=left]:-translate-x-1 / data-[side=right]:translate-x-1). In RTL, when Radix emits side=inline-start|inline-end, the translate offset won’t apply, so spacing/positioning can differ from LTR.

Consider adding inline-start/inline-end equivalents using ltr:/rtl: variants (the codebase already uses rtl: in calendar.tsx) or switching to sideOffset props instead of direction-dependent translate classes.

Copilot uses AI. Check for mistakes.

import * as React from 'react';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { Dialog as DialogPrimitive } from "radix-ui";
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This file consistently uses single quotes for imports/strings, but the new radix-ui import uses double quotes. To keep formatting consistent (and avoid noisy future diffs), align the quote style with the rest of this file (or run the standard formatter across the file).

Suggested change
import { Dialog as DialogPrimitive } from "radix-ui";
import { Dialog as DialogPrimitive } from 'radix-ui';

Copilot uses AI. Check for mistakes.
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