CRT Style Guide - Retro Lit component library
npm install @patimweb/crtstyleguide
A modern Web Component Library with retro CRT aesthetic
Built with Lit, TypeScript and Vite
π₯οΈ View Live Demo
---
| Feature | Description |
|---------|-------------|
| π₯οΈ CRT Aesthetic | Retro look with neon glow effects and monospace fonts |
| β‘ Lit Web Components | Modern, performant and lightweight components |
| π¨ Design Tokens | Consistent theming via CSS Custom Properties |
| π¦ NPM-Ready | Publishable as reusable package |
| π TypeScript | Full typing for better DX |
| π Living Style Guide | Interactive documentation of all components |
| βοΈ Vite | Lightning-fast development and optimized builds |
| π¨ Multiple CRT Colors | Green, Amber, and Blue phosphor variants |
| β¨ Authentic Effects | Scanlines, flicker, chromatic aberration |
---
```
crtstyleguide/
βββ src/
β βββ components/
β β βββ atoms/ # Basic building blocks (Button, Input, Badge, etc.)
β β βββ molecules/ # Composite components (Card, Modal, Table)
β β βββ organisms/ # Complex UI areas (MusicStation)
β βββ styles/
β β βββ design-tokens.css # CSS Custom Properties
β β βββ index.css # Global Styles
β βββ utils/ # Helper functions
β βββ index.ts # Library Entry Point
βββ styleguide/ # Living Style Guide App
β βββ index.html
β βββ main.ts
β βββ template.ts
β βββ style.css
βββ public/
β βββ fonts/ # IBM Plex Mono font files
βββ vite.config.ts # Dev & Style Guide Build
βββ vite.lib.config.ts # Library Build
βββ tsconfig.json
---
`bash`
npm install
`bash`
npm run dev
Opens the Style Guide at: http://localhost:5175/styleguide/
---
| Script | Description |
|--------|-------------|
| npm run dev | Start development server |npm run build
| | Build Style Guide + Library |npm run build:lib
| | Build only library for npm |npm run preview
| | Preview production build |npm run type-check
| | TypeScript check without build |npm run lint
| | ESLint code check |
---
| Component | Tag | Description |
|------------|-----|-------------|
| Button | | Interactive button |
| Badge | | Status labels and tags |
| Heading | | Typography headings |
| Text | | Body text |
| Tabs | | Tab navigation |
| Input | | Text fields |
| Textarea | | Multiline input |
| Icon | | Icon rendering |
| Link | | Links |
| FileInput | | File selection input |
| FileUpload | | File upload |
| Calendar | | Date picker |
| Select | | Dropdown selection |
| Search | | Search input |
| Checkbox | | Checkbox input |
| Radio | | Radio button |
| RadioGroup | | Radio group |
| Progress | | Progress bar |
| Tooltip | | Hover hints |
| Breadcrumb | | Breadcrumb navigation |
| Pagination | | Pagination |
| Slider | | Range slider |
| Toggle | | On/Off switch |
| Avatar | | User avatar |
| AvatarGroup | | Grouped avatars |
| Skeleton | | Loading placeholder |
| SkeletonText | | Text placeholder |
| SkeletonCard | | Card placeholder |
| Alert | | Alert banners |
| Spinner | | Loading spinner |
| Komponente | Tag | Beschreibung |
|------------|-----|-------------|
| Card | | Content container |
| Modal | | Dialog modal |
| Table | | Data tables |
| Grid | | Layout grid |
| Accordion | | Collapsible sections |
| AccordionItem | | Accordion item |
| Toast | | Notifications |
| CodeExample | | Code preview |
| MusicPlayer | | Audio player |
| Playlist | | Playlist view |
| Visualizer | | Audio visualization |
| Terminal | | Terminal simulator |
| Log | | Log output panel |
| Navbar | | Navigation bar |
| Header | | Header |
| Footer | | Footer |
| Menu | | Context menu |
| CRTScreen | | CRT screen container (wraps content) |
| CRTOverlay | | CRT visual overlay (non-blocking) |
| Komponente | Tag | Beschreibung |
|------------|-----|-------------|
| MusicStation | | Full music station |
---
Lyrics werden direkt im Track-Objekt ΓΌbergeben:
`html`
{
title: 'VERROSTETE TERMINALS',
artist: 'PATIMWEP',
url: 'patimwep - Verrostete Terminals.mp3',
lyrics: '[INTRO]\nSTATIC IN THE WIRES\nNEON HISS AND SOFT DESIRES\n\n[HOOK]\nVERROSTETE TERMINALS\nSIGNAL LOST, RETURNING CALLS',
},
]}
>
---
Die Library verwendet CSS Custom Properties fΓΌr konsistentes Theming:
`css`
:root {
/ PrimΓ€rfarben /
--crt-primary: #33ff33;
--crt-primary-light: #44ff44;
--crt-primary-dark: #22cc22;
/ HintergrΓΌnde /
--crt-bg-dark: #0a0a0a;
--crt-bg-darker: #000000;
--crt-bg-light: #1a1a1a;
/ Status-Farben /
--crt-success: #00ff00;
--crt-warning: #ffff00;
--crt-error: #ff0000;
--crt-info: #00ffff;
/ Glow-Effekte /
--crt-glow-sm: 0 0 5px rgba(51, 255, 51, 0.3);
--crt-glow: 0 0 10px rgba(51, 255, 51, 0.5);
--crt-glow-lg: 0 0 20px rgba(51, 255, 51, 0.7);
/ Typografie /
--crt-font-family: 'VT323', 'Courier New', monospace;
}
---
`typescript
// src/components/atoms/my-component.ts
import { LitElement, html, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';
@customElement('crt-my-component')
export class MyComponent extends LitElement {
static styles = css
:host {
display: block;
color: var(--crt-text-primary);
font-family: var(--crt-font-family);
}
.container {
padding: var(--crt-spacing-md);
border: var(--crt-border);
box-shadow: var(--crt-glow);
}
;
@property({ type: String }) label = 'Hello CRT';
render() {
return html
;
}
}declare global {
interface HTMLElementTagNameMap {
'crt-my-component': MyComponent;
}
}
`$3
`typescript
// src/components/atoms/index.ts
export { MyComponent } from './my-component';
`$3
FΓΌge die Komponente in
styleguide/components-register.ts hinzu.---
π¦ Als NPM-Paket verΓΆffentlichen
$3
`bash
npm run build:lib
`$3
`bash
npm publish
`$3
Installation:
`bash
npm install @patimweb/crtstyleguide
`JavaScript/TypeScript einbinden:
`typescript
// Alle Komponenten importieren (registriert automatisch die Custom Elements)
import '@patimweb/crtstyleguide';// Oder einzelne Komponenten
import { Button, Card, Modal } from '@patimweb/crtstyleguide';
`CSS einbinden:
`typescript
// In deiner Haupt-JS/TS-Datei
import '@patimweb/crtstyleguide/styles';
// oder
import '@patimweb/crtstyleguide/styles.css';
`Oder direkt im HTML:
`html
`Komponenten verwenden:
`html
Click me
Small Button
Titel
Inhalt der Karte
Erfolgreich gespeichert!
`Mit Framework (z.B. React):
`tsx
import '@patimweb/crtstyleguide';
import '@patimweb/crtstyleguide/styles';function App() {
return (
alert('Clicked!')}>
CRT Button
);
}
``---
- Lit - Web Components Library
- TypeScript - Type-safe JavaScript
- Vite - Build Tool & Dev Server
- ESLint - Code Linting
---
Apache License 2.0 - siehe LICENSE fΓΌr Details.
---
Built with π and lots of neon glow
Β© 2026 Patrick Weppelmann