1.0.3 โข Published 1 month ago
@sognatore/ui v1.0.3
๐งฉ Sognatore UI
A modern Angular component library built with standalone components, designed for productivity, consistent design, and seamless integration. Create beautiful, accessible, and performant user interfaces with ease.
Made with โค๏ธ by the Adrian Milano.
๐ Documentation
- ๐ Live Documentation Installation and setup guide
๐ Features
- ๐ฏ Standalone Components - Built for Angular 17+ with modern standalone architecture
- ๐ฑ Responsive Design - Mobile-first approach with flexible layouts
- ๐จ Customizable Themes - Easy theming with CSS custom properties
- โฟ Accessibility First - WCAG 2.1 compliant with full keyboard navigation
- ๐ฎ Interactive Playground - Real-time component testing and configuration
- ๐ Comprehensive Examples - Real-world usage patterns and best practices
- ๐ง TypeScript Support - Full type safety and IntelliSense support
- ๐ Performance Optimized - Tree-shakable with minimal bundle impact
๐ฆ Installation
npm install @sognatore/ui
Make sure your Angular project is using version 17 or newer.
๐ Quick Start
Import Standalone Components
import { Component } from '@angular/core';
import {
// Form Components
SognatoreButton,
SognatoreInput,
// Layout Components
SognatoreCard,
SognatoreModal,
SognatoreNavbar,
SognatoreAccordion,
SognatoreTabs,
// UI Components
SognatoreIcon,
SognatoreTooltip,
SognatoreBadge,
SognatoreProgress,
SognatoreChip
} from '@sognatore/ui';
@Component({
standalone: true,
selector: 'app-dashboard',
imports: [
SognatoreButton, SognatoreInput, SognatoreCard,
SognatoreNavbar, SognatoreIcon, SognatoreBadge,
SognatoreProgress, SognatoreTooltip
],
template: `
<!-- Navigation -->
<sog-navbar [items]="navItems" fixed="true">
<div slot="brand">
<sog-icon name="home" size="lg"></sog-icon>
My Dashboard
</div>
<div slot="actions">
<sog-tooltip text="Notifications" position="bottom">
<sog-badge [content]="5" color="danger">
<sog-icon name="bell" size="md"></sog-icon>
</sog-badge>
</sog-tooltip>
</div>
</sog-navbar>
<!-- Main Content -->
<div class="dashboard-content">
<sog-card variant="elevated">
<div slot="header">
<h3>Project Progress</h3>
</div>
<sog-progress
type="linear"
[value]="75"
color="success"
showLabel="true">
</sog-progress>
<div class="skills">
<sog-chip
*ngFor="let skill of skills"
[label]="skill.name"
color="primary"
[clickable]="true"
[selected]="skill.selected"
(chipClick)="toggleSkill(skill)">
</sog-chip>
</div>
<div slot="footer">
<sog-button variant="primary" (click)="updateProgress()">
Update Progress
</sog-button>
</div>
</sog-card>
</div>
`
})
export class DashboardComponent {
navItems = [
{ id: 'dashboard', label: 'Dashboard', icon: 'home' },
{ id: 'projects', label: 'Projects', icon: 'folder' }
];
skills = [
{ name: 'Angular', selected: true },
{ name: 'TypeScript', selected: false }
];
toggleSkill(skill: any) {
skill.selected = !skill.selected;
}
updateProgress() {
console.log('Updating progress...');
}
}
๐งฑ Available Components
Component | Selector | Description | Status |
---|---|---|---|
Button | <sog-button> | Interactive button with multiple variants and sizes | โ |
Input | <sog-input> | Form input with validation, error states, prefix/suffix | โ |
Card | <sog-card> | Content container with header/footer slots, elevation | โ |
Badge | <sog-badge> | Notification badges with dot and content variants | โ |
Chip | <sog-chip> | Interactive tags with selectable and clickable states | โ |
Progress | <sog-progress> | Linear and circular progress indicators with animations | โ |
Tooltip | <sog-tooltip> | Contextual help with smart positioning and rich content | โ |
Modal | <sog-modal> | Dialog overlay with size variants and backdrop controls | โ |
Dialog | <sog-dialog> | Simple confirmation and alert dialogs | โ |
Navbar | <sog-navbar> | Responsive navigation bar with brand and actions slots | โ |
Accordion | <sog-accordion> | Collapsible content panels with keyboard navigation | โ |
Tabs | <sog-tabs> | Tabbed interface with dynamic content and router support | โ |
Icon | <sog-icon> | SVG icon system with built-in and custom icon support | โ |
๐ฎ Interactive Playground
Explore components in real-time with our interactive playground:
ng serve
# Navigate to http://localhost:4200/components/[component]/playground
Available Playgrounds:
/components/tooltip/playground
- Configure tooltip behavior and appearance/components/button/playground
- Test button variants and states/components/input/playground
- Experiment with form inputs- More playgrounds coming soon!
๐ Examples & Patterns
Learn from real-world examples:
# View comprehensive examples
http://localhost:4200/components/[component]/examples
Example Categories:
- Form Patterns - Validation, help text, and user guidance
- Navigation - Responsive menus and icon-based navigation
- Data Display - Tables, lists, and status indicators
- Interactive Elements - Buttons, actions, and user feedback
- Layout Components - Cards, panels, and content organization
๐ก Usage Examples
Navigation with Icons and Badges
<sog-navbar [items]="navItems">
<div slot="brand">
<sog-icon name="home" size="lg" color="primary"></sog-icon>
My App
</div>
<div slot="actions">
<sog-badge [content]="notificationCount" color="danger">
<sog-icon name="bell"></sog-icon>
</sog-badge>
</div>
</sog-navbar>
Interactive Content Panels
<sog-accordion [items]="accordionItems">
<div slot="content-panel1">
<sog-progress type="circular" [value]="85" showLabel="true"></sog-progress>
<p>Project completion status</p>
</div>
</sog-accordion>
Form with Validation
<form [formGroup]="userForm" (ngSubmit)="onSubmit()">
<sog-input
formControlName="name"
placeholder="Full Name"
[required]="true">
</sog-input>
<sog-input
formControlName="email"
placeholder="Email Address"
type="email"
[required]="true">
</sog-input>
<sog-button
type="submit"
variant="primary"
[disabled]="userForm.invalid">
Create Account
</sog-button>
</form>
Tabbed Interface with Rich Content
<sog-tabs [tabs]="tabItems">
<div slot="overview">
<sog-chip label="New Feature" color="success" [clickable]="true"></sog-chip>
</div>
<div slot="settings">
<sog-tooltip text="Save your preferences" position="top">
<sog-button variant="primary">Save Settings</sog-button>
</sog-tooltip>
</div>
</sog-tabs>
๐งช Development
Prerequisites
- Node.js 18+
- Angular CLI 17+
- npm or yarn
Setup
# Clone the repository
git clone https://github.com/arm02/sognatore-workspace.git
cd sognatore-workspace
# Install dependencies
npm install
# Start development server
ng serve
# Open http://localhost:4200
Build Library
# Build the component library
ng build sognatore-ui
# Build documentation site
ng build sognatore-docs
Testing
# Run unit tests
ng test
# Run e2e tests
ng e2e
# Check test coverage
ng test --code-coverage
๐จ Theming
Customize components with CSS custom properties:
:root {
/* Primary colors */
--primary-50: #eff6ff;
--primary-500: #3b82f6;
--primary-900: #1e3a8a;
/* Gray scale */
--gray-50: #f9fafb;
--gray-500: #6b7280;
--gray-900: #111827;
/* Component specific */
--button-border-radius: 6px;
--input-border-radius: 4px;
--card-border-radius: 8px;
}
Component Variants
basic
- Clean, minimalist design (default)outline
- Outlined borders for buttons and inputsghost
- Transparent background with hover effects
Color System
primary
- Main brand color (#3498db)secondary
- Secondary color (#6c757d)success
- Success state (#27ae60)danger
- Error/danger state (#e74c3c)warning
- Warning state (#f39c12)info
- Information state (#17a2b8)
Size Options
small
- Compact size for dense layoutsmedium
- Default size for most use caseslarge
- Prominent size for important actions
Dark Mode Support
[data-theme="dark"] {
--gray-50: #111827;
--gray-900: #f9fafb;
/* Override other variables */
}
๐ง Form Integration
Reactive Forms Support
import { FormControl, FormGroup, Validators } from '@angular/forms';
export class UserFormComponent {
userForm = new FormGroup({
name: new FormControl('', [Validators.required]),
email: new FormControl('', [Validators.required, Validators.email]),
notifications: new FormControl(true)
});
}
๐ฑ Responsive Design
All components are mobile-first and responsive:
<!-- Responsive navbar -->
<sog-navbar [items]="navItems">
<!-- Automatically adapts to mobile screens -->
</sog-navbar>
<!-- Responsive progress -->
<sog-progress
type="linear"
[value]="progress"
size="small"
class="mobile-friendly">
</sog-progress>
<!-- Adaptive tooltips -->
<sog-tooltip
text="Adjusts position on mobile"
position="top"
trigger="click">
<sog-button>Mobile Friendly</sog-button>
</sog-tooltip>
โฟ Accessibility Features
- Keyboard Navigation: All interactive components support Tab, Enter, Space, Arrow keys
- ARIA Labels: Proper
aria-label
,aria-labelledby
,aria-describedby
attributes - Focus Management: Visible focus indicators and logical tab order
- Screen Readers: Semantic HTML and proper role attributes
- Color Contrast: WCAG AA compliant color combinations
- Reduced Motion: Respects
prefers-reduced-motion
settings
๐ Documentation
- ๐ Live Documentation - Interactive component demos
- ๐ฎ Playground - Real-time configuration
- ๐ก Examples - Real-world patterns
- ๐ Getting Started - Installation and setup guide
๐ค Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Contribution Guidelines
- Follow the existing code style and conventions
- Add tests for new features
- Update documentation for any API changes
- Ensure all tests pass before submitting
๐ Roadmap
Upcoming Components
- DataTable - Advanced data grid with sorting and filtering
- DatePicker - Calendar component with range selection
- Dropdown - Flexible dropdown menus and selects
- Slider - Range and value sliders
- Toast - Notification system
- Pagination - Data pagination controls
Planned Features
- ๐จ Theme Builder - Visual theme customization tool
- ๐ฑ Mobile Components - Touch-optimized components
- ๐ i18n Support - Internationalization and localization
- ๐ง CLI Tools - Component generation and scaffolding
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ฌ Support
- ๐ Report Issues - Bug reports and feature requests
- ๐ฌ Discussions - Community support and ideas
- ๐ง Contact - Direct team contact
๐ Acknowledgments
- Angular team for the amazing framework
- Contributors and community members
- Design inspiration from modern UI libraries
โญ Star us on GitHub if you find Sognatore UI helpful!