@totango-app-team/totango-ui
v0.3.15
Published
//TODO: Migrate to this in the future: https://github.com/web-infra-dev/rslib
Downloads
3,250
Readme
Totango UI Library
//TODO: Migrate to this in the future: https://github.com/web-infra-dev/rslib
This project is a React component library built with TypeScript, Vite, and Material-UI. It provides a set of reusable UI components and utilities for building Totango applications.
Features
- React components built with Material-UI
- TypeScript support
- Vite for fast development and building
- Storybook for component documentation and testing
- Modular exports for flexible usage
Getting Started
Running Storybook
To start Storybook and view the component documentation:
Make sure you have all dependencies installed:
npm install
Run the following command:
npm run storybook
Open your browser and navigate to
http://localhost:6006
to view the Storybook interface.
Local Development with other Repos:
Run the following command to start vite in watch mode:
npm run build:watch
Create a link to the library in the other repo:
npm link
Run the following command in the other repo to link to the library:
npm link @totango-app-team/totango-ui
Using the UI Library
To use the UI library in your project, follow these steps:
Install the library:
npm install @totango-app-team/totango-ui
Import the theme first thing in your entry file (before your app root):
import { ThemeProvider } from '@totango-app-team/totango-ui/themes';
You can then import and use the components in your project from the corresponding folder it's exported from:
import { Button } from '@totango-app-team/totango-ui/ui';
If you want to use the core components from MUI that haven't been modified (like
ThemeProvider
,GlobalStyles
, etc.), you can import them from the@totango-ui/core
folder:import { ThemeProvider } from '@totango-app-team/totango-ui/core';