Themes
_
□
✕
Themes
Learn how to customize the look and feel of Rohit UI components.
Built-in Themes
Rohit UI comes with two built-in themes:
Windows 98 Theme
The default theme that recreates the classic Windows 98 look and feel.
<RohitUIProvider theme="windows98">
/* Your app */
</RohitUIProvider>
Rohit Special Theme
A funky, colorful variation that adds unnecessary complexity to your UI.
<RohitUIProvider theme="rohitSpecial">
/* Your app */
</RohitUIProvider>
Custom Themes
You can create your own custom theme by extending the default theme:
import { createTheme } from 'rohit-ui';
const myTheme = createTheme({
colors: {
primary: '#FF00FF',
secondary: '#00FFFF',
// ... other color overrides
},
fonts: {
family: {
base: "'Comic Sans MS', cursive",
// ... other font overrides
}
}
});
function App() {
return (
<RohitUIProvider theme={myTheme}>
/* Your app */
</RohitUIProvider>
);
}
Theme Properties
The theme object supports the following properties:
Colors
primary: Primary brand colorsecondary: Secondary brand colorsuccess: Success state colorerror: Error state colorwarning: Warning state colorinfo: Information state color
Typography
fontFamily: Font family for different text stylesfontSize: Font sizes for different text stylesfontWeight: Font weights for different text styleslineHeight: Line heights for different text styles
Spacing
spacing: Spacing scale for margins and paddingborderRadius: Border radius valuesshadows: Box shadow values