Installation
Get started with Base UI by installing the package and setting up your project.Install Base UI
Install the package
Install
@base-ui/react using your preferred package manager:All Base UI components are included in a single package. The library is tree-shakable, so your bundle will only contain the components you actually use.
Verify peer dependencies
Base UI requires React as a peer dependency. Make sure you have one of the supported React versions installed:
package.json
TypeScript setup (optional)
If you’re using TypeScript, Base UI provides comprehensive type definitions out of the box. No additional setup is required.The package includes TypeScript definitions for all components and their props:
@types/react is an optional peer dependency. If you’re using TypeScript, make sure to install it for the best development experience.Project Setup
Portals Configuration
Base UI uses portals for components that render popups (Dialog, Popover, Tooltip, Menu, etc.). To ensure portaled components always appear on top of your page content, add this style to your application layout:z-index conflicts.
iOS Safari 26+ Support
Add this style to your global CSS to ensure backdrops cover the entire viewport after scrolling:global.css
position: absolute instead of position: fixed.
Verify Installation
Test your installation by importing and using a simple component:App.tsx
Package Exports
Base UI provides granular exports for optimal tree-shaking. You can import components individually:Next Steps
Quick Start Guide
Build your first styled component with Base UI
Component Library
Explore all available components