Import components using named imports from @trendmicro/react-styled-ui, as shown below:
import{Button}from'@trendmicro/react-styled-ui';
Recommended setup
Sometimes you may need to apply base CSS styles to your application. Tonic UI exports a CSSBaseline that is used to normalize styles for a wide range of elements, which is based on the normalize.css.
CSSBaseline is recommended to add at the root to ensure all components work correctly.
import{Global, css }from'@emotion/react';
import{
Box,
ColorModeProvider,
ColorStyleProvider,
CSSBaseline,
ThemeProvider,
ToastProvider,
useColorMode,
useTheme,
}from'@trendmicro/react-styled-ui';
importAppfrom'./App';
constLayout=(props)=>{
const[colorMode]=useColorMode();// One of: 'dark', 'light'