@andithang/react-ui
v0.1.0
Published
React component library with SCSS tokens, theme switching, and Storybook docs.
Readme
@andithang/react-ui
A reusable React UI component library built with TypeScript, SCSS, CSS variables, and Storybook.
Documentation
- Live docs:
https://react-ui.andithang.org
Tech Stack
- React
- TypeScript
- Vite (library mode + declaration generation)
- SCSS + CSS variables (token-first styling)
- Storybook
What This Package Provides
- Theme-aware components with light/dark mode via
ThemeProvider - Primitive layout components (
Box,Flex,Grid) - Form and feedback components
- Storybook docs and examples for all components
- Package-ready build output (
es,cjs, types, styles)
Installation
npm install @andithang/react-uiPeer dependencies:
react^18.0.0 || ^19.0.0react-dom^18.0.0 || ^19.0.0
Quick Start
import { ThemeProvider, ThemeSwitch, Button, Input } from '@andithang/react-ui';
import '@andithang/react-ui/styles.css';
export function App() {
return (
<ThemeProvider>
<ThemeSwitch />
<Button variant="primary">Save</Button>
<Input label="Name" placeholder="Enter your name" />
</ThemeProvider>
);
}Components
- Primitives:
Box,Flex,Grid,Typography - Form Controls:
Input,InputNumber,Textarea,Select,TreeSelect,Checkbox,Radio,Switch,DatePicker,TimePicker - Actions & Navigation:
Button,Dropdown,Tabs,Breadcrumb,Steps,Tag,CheckableTag,CheckableTagGroup - Feedback & Overlay:
Alert,Modal,Tooltip,Toast,Result,Skeleton,Spinner - Display & Utility:
Icon,Avatar,Form,ThemeSwitch
Docs & Icon Data
- Storybook includes component docs, usage examples, and style states for all components.
Iconexports catalog helpers:ICON_NAMESICON_NAMES_BY_SOURCESOURCE_ICON_NAMESLEGACY_ICON_NAMES
Theme & Styles
- Include package styles once:
import '@andithang/react-ui/styles.css';- Theme mode is handled by
ThemeProvideranduseThemeContext. - Component styles are SCSS-authored and token-driven via CSS variables.
- Light and dark themes are supported through
data-theme.
Development
npm install
npm run devUseful scripts:
npm run lintnpm run lint:fixnpm run typechecknpm run buildnpm run storybooknpm run build-storybook
Storybook Deployment
Build/deploy commands:
npm run deploy:storybookfor project path base (/react-ui/)npm run deploy:storybook:cnamefor custom domain base (/)
Notes:
- Deployment is executed from your current branch (usually
main). - Static files are published to the
gh-pagesbranch automatically. - Deploy step creates
.nojekylland includesCNAME(custom domain flow) to avoid missing underscore-prefixed assets. - Production docs domain:
https://react-ui.andithang.org
Publishing
npm login
npm publishprepublishOnly runs:
npm run typecheck && npm run build