Sonar Design System
View Storybook
Usage
Installation
yarn add sonar-design-system
Implementation
import { ThemeProvider, Button } from 'sonar-design-system';
const App = () => (
<ThemeProvider>
<Button variant="primary">Primary Button</Button>
</ThemeProvider>
);
Releases
yarn test
yarn build
yarn publish
Storybook
Start
yarn storybook
Build
yarn build-storybook
Deploy
Commit to master
Theming
Available themes:
Available shades:
Overwrite default theme
import { ThemeProvider, Button } from 'sonar-design-system';
const App = () => (
<ThemeProvider theme="gemini" shade="dark">
<Button />
</ThemeProvider>
);
Get or modify current theme and shade
import { useTheme } from 'sonar-design-system';
const Button = () => {
const { theme, shade, setTheme, setShade } = useTheme();
return <button />;
};
Fonts
Import directly
import 'sonar-design-system/dist/fonts/maven-pro.woff2';
import 'sonar-design-system/dist/fonts/saira.woff2';
Import by CSS
import 'sonar-design-system/dist/css/fonts.css';