Combining the UI Foundations theme with your own theme.
theme.ts
file and replacing the ThemeProvider
with the one provided by UI Foundations Kit, but it may also mean extending bits of your own theme instead.
2xs
, xs
, sm
, md
, lg
, xl
, 2xl
, etc.red
, orange
, yellow
, green
, blue
, fuchsia
, violet
, gray
, with more easily added.
Youβll find these declarations in the theme.ts
file that add to the default types.react-icons
.
A few defaults are set in the theme.ts
file to improve the base look of components like checkboxes and radio buttons, but for the most part the icons are imported and used where needed.
However, this means that integrating the theme into your own project will require installing the react-icons
package or removing these overrides.
components
prop on the ThemeProvider
. UI Foundations Kit includes many adjustments for base components like Button
, TextField
, and Select
to make them more consistent with the kit and feel more modern.
These can be ported over by copying over the contents, or merging component styleOverrides
and defaultProps
from the Kitβs theme.ts
file with any youβve set yourself.
body
: Sets a minHeight
focusVisible
: to use a box shadow instead of a borderborder-box
as a nicer default for all elementsglobal.ts
in the Kit, or merging with your own global styles.
TextField
component, but UI Foundations Kit uses labels via the FormLabel
component instead. It also often uses FormControl
and the more low level FilledInput
component instead:
outlined
or filled
variants, but UI Foundations Kit uses filled
by default. This means that youβre encouraged to use the filled variants on all form inputs:
fontSize
on components like Box
and Container
to enforce consistency. Instead, it uses the sx
prop, which is a more powerful and flexible way to style components.
Before | After |
---|---|
![]() | ![]() |
CssVarsProvider
which was merged into itβs main ThemeProvider
. This means that there are a few new props to be aware of that are documented in their migration guide.
If you are still working on a MUI v5 project, be sure to be aware of the following:
extendTheme
is now createTheme
CssVarsProvider
is now ThemeProvider
cssVariables
prop only exists on the v6 provider, and the experimental v5 CssVarsProvider