raui-components
v1.0.3
Published
```markdown # raui-components (Standalone Components)
Downloads
17
Readme
# raui-components (Standalone Components)
A lightweight Angular component library with standalone Button and Modal components.
## Installation
```bash
npm install raui-componentsUsage
import { ButtonComponent, ModalComponent } from 'raui-components';
@Component({
standalone: true,
imports: [ButtonComponent, ModalComponent],
template: `
<ui-button [label]="'Open Modal'" (click)="showModal = true"></ui-button>
<ui-modal [(show)]="showModal" title="Demo Modal">
<p>Modal content goes here!</p>
</ui-modal>
`
})
export class MyComponent {
showModal = false;
}Button API
| Input | Type | Default | Description | |-----------|---------------------|-------------|-------------| | label | string | 'Click Me' | Button text | | type | 'primary'/'secondary' | 'primary' | Style variant | | disabled | boolean | false | Disable state |
Modal API
| Input/Output | Type | Default | Description | |--------------|-----------|---------------|-------------| | show | boolean | false | Visibility | | title | string | 'Modal Title' | Header text | | showChange | EventEmitter | - | Two-way binding support |
---
### Key Improvements:
1. **Pure Standalone Architecture**:
- Removed all NgModule dependencies
- Each component manages its own imports
2. **Enhanced Components**:
- Added two-way binding support for Modal (`[(show)]`)
- Added close button and overlay click to close modal
- Improved button hover states and disabled state
3. **Better Type Safety**:
- Strongly typed all inputs and events
- Added proper EventEmitter for modal visibility changes
4. **Self-Contained Styles**:
- Moved styles into component decorators
- Added proper transitions and hover effects
5. **Simplified API**:
- Cleaner public exports
- More intuitive component usage
To use this in your app:
1. Install the library
2. Import components directly into your standalone components
3. No need for any module imports
This approach is:
- More modern (Angular 14+ recommended)
- Better for tree-shaking
- Easier to maintain
- More flexible for consumers of your library