UI components shared by different sozialhelden projects.
Check the Storybook for an overview of the available components.
Make sure you have Tailwind CSS installed in your project. If you don't have it yet, you should install and set it up first: https://tailwindcss.com/docs/installation/using-vite
Then install the library:
npm i --save @sozialhelden/uiAdd the following to your main CSS file, make sure to adapt the path to the @sozialhelden/ui package if necessary:
/* Import fonts */
@import "@fontsource/inter/400.css";
@import "@fontsource/inter/400-italic.css";
@import "@fontsource/inter/500.css";
@import "@fontsource/inter/500-italic.css";
@import "@fontsource/inter/600.css";
@import "@fontsource/inter/600-italic.css";
@import "@fontsource/inter/700.css";
@import "@fontsource/inter/700-italic.css";
/* Add tailwind itself and necessary addons */
@import "tailwindcss";
@import "tw-animate-css";
/* Import tailwind config from ui library */
@import "@sozialhelden/ui/style.css";
/* Add ui library as source for class purging */
@source "../../node_modules/@sozialhelden/ui";Check the Storybook for an overview of the available components.
Now you can use tailwind classes and the components provided by the @sozialhelden/ui package in your project, for example:
import { Button } from "@sozialhelden/ui";
export function App() {
return (
<div className="p-4 bg-red-200">
<Button>Click me!</Button>
</div>
);
}Install dependencies:
npm ciRun the storybook dev-server:
npm run devBuild a production version of the library and storybook:
npm run buildRun linter/formatters:
# Run linter
npm run lint
# Run linter and automatically fix fixable issues
npm run lint:fix
# Run formatter
npm run format
# Run formatter and automatically fix fixable issues
npm run format:fix
# Run typecheck
npm run typecheckMIT