@piramesse/ui
v1.1.0
Published
A modern Vue 3 UI component library built with Tailwind CSS and TypeScript
Maintainers
Readme
@piramesse/ui
A modern Vue 3 UI component library built with Tailwind CSS and TypeScript.
Features
- 🎨 Themeable - CSS custom properties for easy customization
- 📦 Tree-shakeable - Import only what you need
- 🔷 TypeScript - Full type support out of the box
- ♿ Accessible - ARIA attributes and keyboard navigation
- 🎭 Two themes - Default and Editorial (zero border-radius)
- 🧱 Blocks - Pre-built UI sections for rapid development
Installation
pnpm add @piramesse/uiPeer Dependencies
pnpm add vue@^3.5.0 tailwindcss@^4.0.0Setup
1. Import Styles
Import the CSS file in your main entry point:
// main.ts
import '@piramesse/ui/style.css'2. Configure Tailwind (Optional)
If you want to use Tailwind utilities alongside the library, make sure your app.css imports Tailwind:
@import "tailwindcss";Usage
Components
<script setup lang="ts">
import { Button, Input, Card, Modal } from '@piramesse/ui'
</script>
<template>
<Card>
<Input v-model="email" label="Email" type="email" />
<Button variant="primary" @click="submit">Submit</Button>
</Card>
</template>Blocks
Pre-built UI sections for common patterns:
<script setup lang="ts">
import { HeaderWithNav, HeroCentered, FooterWithLinks } from '@piramesse/ui/blocks'
</script>
<template>
<HeaderWithNav :nav-items="navItems" @login="handleLogin" />
<HeroCentered
title="Welcome"
subtitle="Get started today"
primary-action="Sign Up"
/>
<FooterWithLinks :link-groups="links" copyright="© 2024" />
</template>Shell Layouts
Structural layouts with slots for content:
<script setup lang="ts">
import { BlogLayout, BlogPostLayout } from '@piramesse/ui/blocks'
</script>
<template>
<BlogLayout>
<template #header>
<h1>Our Blog</h1>
</template>
<PostCard v-for="post in posts" :key="post.id" :post="post" />
<template #sidebar>
<SearchWidget />
</template>
</BlogLayout>
</template>Theming
CSS Custom Properties
The library uses CSS custom properties for theming. Override them in your CSS:
:root {
--pui-primary: #3b82f6;
--pui-primary-hover: #2563eb;
--pui-bg: #ffffff;
--pui-text: #0f172a;
--pui-text-muted: #64748b;
--pui-border: #e2e8f0;
--pui-radius: 0.5rem;
/* ... and more */
}Dark Mode
Apply dark mode with the .dark class on a parent element:
<html class="dark">
<!-- Dark theme applied -->
</html>Editorial Theme
A zero border-radius, black & white theme:
<div data-theme="editorial">
<!-- Editorial theme applied -->
</div>Or use the class:
<div class="theme-editorial">
<!-- Editorial theme applied -->
</div>Components
Form Components
| Component | Description |
|-----------|-------------|
| Button | Primary action trigger with variants |
| Input | Text input with validation states |
| Textarea | Multi-line text input |
| Select | Dropdown selection |
| Checkbox | Binary selection |
| Radio | Single selection from group |
| Switch | Toggle for boolean values |
Feedback
| Component | Description |
|-----------|-------------|
| Alert | Inline message for contextual feedback |
| Toast | Temporary notification popup |
| Progress | Linear/circular progress indicator |
| Spinner | Loading indicator |
| Skeleton | Placeholder while loading |
Overlay
| Component | Description |
|-----------|-------------|
| Modal | Dialog overlay |
| Drawer | Slide-in panel |
| Dropdown | Dropdown menu |
| Tooltip | Information on hover |
Data Display
| Component | Description |
|-----------|-------------|
| Table | Data table with sorting |
| List | Structured list |
| Avatar | User representation |
| AvatarGroup | Stacked avatars |
| Badge | Count or status indicator |
| Tag | Categorization label |
| Accordion | Collapsible panels |
| Timeline | Chronological events |
| Tree | Hierarchical data |
| Statistic | Numeric value display |
| Empty | Empty state placeholder |
| Result | Outcome page |
| Descriptions | Key-value pairs |
Navigation
| Component | Description |
|-----------|-------------|
| Tabs | Tabbed navigation |
Layout
| Component | Description |
|-----------|-------------|
| Container | Centered container |
| Grid | CSS Grid layout |
| Flex | Flexbox utility |
| Stack | Vertical/horizontal stack |
| Divider | Visual separator |
| Spacer | Flexible space |
| AspectRatio | Maintain ratio |
| Center | Center content |
Media
| Component | Description |
|-----------|-------------|
| Image | Responsive image with loading states |
| Card | Container component |
Blocks
Pre-built UI sections (import from @piramesse/ui/blocks):
Headers
HeaderSimple- Logo/title + actionsHeaderWithNav- Full navigation with mobile menu
Footers
FooterSimple- Copyright + social linksFooterWithLinks- Multi-column with link groups
Auth Forms
LoginForm- Email/password + social loginRegisterForm- Registration + termsForgotPasswordForm- Password reset
Heroes
HeroCentered- Centered headline + CTAsHeroSplit- Two-column with image
Marketing
FeatureGrid- Feature showcasePricingCards- Pricing comparisonCTASection- Call-to-action
Layouts (Shell)
BlogLayout- Blog listing page structureBlogPostLayout- Article page structure
Development
Prerequisites
- Node.js 18+
- pnpm 8+
Setup
# Install dependencies
pnpm install
# Start Storybook
pnpm storybook
# Build library
pnpm buildProject Structure
src/
├── components/ # UI components
│ ├── Button/
│ │ ├── Button.vue
│ │ ├── Button.stories.ts
│ │ └── index.ts
│ └── ...
├── layout/ # Layout components
├── blocks/ # Pre-built UI sections
│ ├── headers/
│ ├── footers/
│ ├── forms/
│ ├── heroes/
│ ├── features/
│ ├── pricing/
│ ├── cta/
│ └── layouts/
├── styles/ # CSS files
│ ├── variables.css
│ ├── base.css
│ ├── themes/
│ ├── components/
│ ├── data-display/
│ └── layout/
├── index.ts # Main entry (components)
├── blocks/index.ts # Blocks entry
└── style.css # CSS entry pointScripts
| Command | Description |
|---------|-------------|
| pnpm dev | Start Vite dev server |
| pnpm build | Build library for production |
| pnpm storybook | Start Storybook on port 6006 |
| pnpm build-storybook | Build static Storybook |
CSS Architecture
The library uses a modular CSS architecture:
variables.css- CSS custom properties (colors, spacing, etc.)base.css- Animations and utility classesthemes/editorial.css- Editorial theme overridescomponents/*.css- Individual component stylesdata-display/*.css- Data display component styleslayout/*.css- Layout component styles
All styles are assembled in style.css via @import rules.
Naming Convention
All CSS classes are prefixed with pui- (Piramesse UI):
.pui-button { }
.pui-button-primary { }
.pui-button-lg { }TypeScript
All components export their prop types:
import type { ButtonProps, InputProps, CardProps } from '@piramesse/ui'Browser Support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
License
ISC
