Skip to content

AntJanus/cottage-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cottage UI

A React component library built with TypeScript, TailwindCSS, and Vite. Created as part of the Build A React UI Library series.

Demo

Cottage UI Components

Features

  • TypeScript-first component library
  • TailwindCSS utility styling
  • ESM + UMD bundles
  • Vitest + React Testing Library coverage
  • Storybook docs with @storybook/react-vite
  • Bundled type declarations

Installation

npm install cottage-ui

Usage

import { Button, BUTTON_VARIANTS, BUTTON_SIZES } from 'cottage-ui'
import 'cottage-ui/dist/cottage-ui.css'

function App() {
	return (
		<Button
			variant={BUTTON_VARIANTS.PRIMARY}
			size={BUTTON_SIZES.LARGE}
			onClick={() => console.log('Clicked!')}
		>
			Click me
		</Button>
	)
}

Development

This repo uses npm.

npm install
npm run dev
npm run storybook
npm run lint
npm run test -- --run
npm run build

Project Layout

cottage-ui/
├── lib/                  # Published library source
├── src/                  # Local demo app
├── .storybook/           # Storybook config
└── dist/                 # Build outputs

Contributing

  1. Add or update code in lib/
  2. Add/adjust tests and stories
  3. Export new APIs in lib/main.ts
  4. Run lint, tests, and build before opening a PR

Documentation

License

See package.json.

About

Cottage UI

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors