A collection of React components
Forms
Typography
Display content
Check out Storybook for visual look of the components.
- Spotify Playlists with
Button
,Card
,Heading
andText
components - Twitter Card with
Avatar
,Button
,Card
, and typography components - YouTube Side Menu with
Button
component
npm install spartak-ui
yarn add spartak-ui
There are ThemeProvider
and useTheme
hook to add dark theme to your app. Wrap your app component in ThemeProvider
.
import { ThemeProvider } from "spartak-ui";
function Example() {
return (
<ThemeProvider>
<App />
</ThemeProvider>
);
}
For switching themes let's add a component that utilizes useTheme
hook.
import { useTheme, Button } from "spartak-ui";
import { IconSun, IconMoon } from "@tabler/icons-react";
export const Switch = () => {
const { theme, setTheme } = useTheme();
const isThemeDark = theme === "dark";
return (
<Button
onClick={
() => setTheme(
isThemeDark ?
"light" :
"dark")
}
icon={
isThemeDark ?
<IconSun /> :
<IconMoon />
}
variant="text"
/>
);
};
Import and add Switch
component into your <App />
and that's it.
Sergei Cherniaev (@shdq)
- Logo icon designed by Sam Smith
- Font designed by Omnibus-Type