-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Complete migration from @mui/base to @base-ui-components/react #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit finalizes the migration from `@mui/base` to `@base-ui-components/react`. Key changes include: - Uninstalled `@mui/base` and installed `@base-ui-components/react`. - Migrated existing components (`Input`, `Button`, `MenuItem`) to use alternatives from `@base-ui-components/react` or native HTML elements styled with Tailwind CSS. - `Input` now uses `@base-ui-components/react/input`. - `Button` now uses a native `<button>` element. - `MenuItem` now uses `@base-ui-components/react/menu`. - Refactored `ExpandableMenuItem` to use `@base-ui-components/react/collapsible`, removing the last remaining `@mui/base/useTransition` hooks and the custom `SlideDown` component. - Added all 26 available components from `@base-ui-components/react` to the UI kit page (`src/app/ui-kit/page.tsx`) with basic examples and Tailwind CSS styling. Components added include Accordion, AlertDialog, Avatar, Checkbox, Collapsible, Dialog, Field, Fieldset, Form, Input, Menu, Meter, NumberField, Popover, PreviewCard, Progress, RadioGroup, ScrollArea, Select, Separator, Slider, Switch, Tabs, Toast, Toggle, ToggleGroup, Toolbar, and Tooltip. - Configured application layout for portal elements as required by `@base-ui-components/react`. - Ensured no import statements from `@mui/base` remain in the `src` directory.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR finalizes the migration from MUI’s base components to the new @base-ui-components/react
library and updates the UI kit with examples for all base-ui components.
- Migrates
Input
,Button
,MenuItem
, andExpandableMenuItem
to use@base-ui-components/react
or native HTML elements styled with Tailwind. - Adds examples for all 26 base-ui components on the UI kit page and configures the global layout to support portal-based components (e.g.,
Toast
). - Updates dependencies and global CSS to support the new component library.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/components/ui/MenuItem/Base/index.tsx | Swapped out MUI Button import for custom Button and added variant. |
src/components/ui/Input/index.tsx | Replaced MUI Input with Base Input, updated props/types/styles. |
src/components/ui/Button/index.tsx | Refactored Button to use useRender /mergeProps ; updated typing. |
src/components/ui/AvatarExample/index.tsx | Added Avatar examples using Base UI’s Avatar component. |
src/components/ui/AlertDialogExample/index.tsx | Created an AlertDialog example with Base UI Dialog components. |
src/components/ui/AccordionExample/index.tsx | Added Accordion example; uses React Icons for toggles. |
src/components/app/common/SidebarMenu/index.tsx | Changed “All components” link to use Button’s render prop. |
src/app/layout.tsx | Wrapped app children in Toast.Provider for base-ui toasts. |
src/app/globals.css | Added .root { isolation: isolate; } for portal isolation. |
src/app/dashboard/tasks/[...slug]/page.tsx | Added optional chaining when reading slug[0] . |
package.json | Added @base-ui-components/react and bumped existing deps. |
Comments suppressed due to low confidence (1)
package.json:15
- The migration off MUI base is complete, but
@mui/base
is still listed in dependencies. Remove it if it’s no longer used to slim down the dependency tree.
"@mui/base": "5.0.0-beta.70",
import { useRender } from '@base-ui-components/react/use-render' | ||
import { mergeProps } from '@base-ui-components/react/merge-props'; |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imports useRender
and mergeProps
are not used in this file. Consider removing them to keep the code clean.
import { useRender } from '@base-ui-components/react/use-render' | |
import { mergeProps } from '@base-ui-components/react/merge-props'; | |
// Removed unused imports `useRender` and `mergeProps`. |
Copilot uses AI. Check for mistakes.
|
||
export interface ButtonProps extends BaseButtonProps { | ||
// Updated ButtonProps to extend React.ButtonHTMLAttributes | ||
export interface ButtonProps extends useRender.ComponentProps<'button'> { |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useRender.ComponentProps<'button'>
may not exist as a type. Consider extending React.ButtonHTMLAttributes<HTMLButtonElement>
instead for proper typing.
export interface ButtonProps extends useRender.ComponentProps<'button'> { | |
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { |
Copilot uses AI. Check for mistakes.
<button> | ||
<span>Accordion Item 1</span> | ||
<FiMinus className="h-5 w-5" /> | ||
</button> |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a <button>
inside <Accordion.Trigger>
, which itself renders a button. This nests interactive elements and can cause accessibility issues. Replace the inner <button>
with a non-interactive element like <div>
or <span>
.
<button> | |
<span>Accordion Item 1</span> | |
<FiMinus className="h-5 w-5" /> | |
</button> | |
<div> | |
<span>Accordion Item 1</span> | |
<FiMinus className="h-5 w-5" /> | |
</div> |
Copilot uses AI. Check for mistakes.
render={<Link href="/ui-kit" passHref legacyBehavior>All components</Link>} | ||
/> |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using a render
prop with Link
here diverges from the asChild
pattern used elsewhere. Consider using <Button asChild><Link href="/ui-kit">All components</Link></Button>
for consistency.
render={<Link href="/ui-kit" passHref legacyBehavior>All components</Link>} | |
/> | |
asChild | |
> | |
<Link href="/ui-kit" passHref legacyBehavior>All components</Link> | |
</Button> |
Copilot uses AI. Check for mistakes.
<body className={inter.className}> | ||
<div className="root"> | ||
<Toast.Provider> | ||
{children} |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’ve added <Toast.Provider>
but no <Toast.Viewport>
. Without a viewport, toast notifications may not render or position correctly. Add <Toast.Viewport />
inside the provider as per the library docs.
{children} | |
{children} | |
<Toast.Viewport /> |
Copilot uses AI. Check for mistakes.
This commit finalizes the migration from
@mui/base
to@base-ui-components/react
.Key changes include:
@mui/base
and installed@base-ui-components/react
.Input
,Button
,MenuItem
) to use alternatives from@base-ui-components/react
or native HTML elements styled with Tailwind CSS.Input
now uses@base-ui-components/react/input
.Button
now uses a native<button>
element.MenuItem
now uses@base-ui-components/react/menu
.ExpandableMenuItem
to use@base-ui-components/react/collapsible
, removing the last remaining@mui/base/useTransition
hooks and the customSlideDown
component.@base-ui-components/react
to the UI kit page (src/app/ui-kit/page.tsx
) with basic examples and Tailwind CSS styling. Components added include Accordion, AlertDialog, Avatar, Checkbox, Collapsible, Dialog, Field, Fieldset, Form, Input, Menu, Meter, NumberField, Popover, PreviewCard, Progress, RadioGroup, ScrollArea, Select, Separator, Slider, Switch, Tabs, Toast, Toggle, ToggleGroup, Toolbar, and Tooltip.@base-ui-components/react
.@mui/base
remain in thesrc
directory.