Astro Preact Widget Architect

•
44
•

Builds and embeds interactive Preact-based widgets into Astro MDX blog pages using standardized responsive design patterns.

This skill automates the creation of high-performance client-side components like calculators, decoders, and visualizers specifically for Astro-based technical blogs. It enforces a consistent Preact + container-query pattern, ensures correct integration versions to avoid Vite version conflicts, and provides specific styling guidance using Starlight design tokens. By managing complex state patterns like two-way synchronization and offering shared utilities for metric prefixes, it enables developers to build complex, responsive UI elements that integrate seamlessly into technical documentation without bloating the global component registry.

Key Features

01Starlight Design Tokens: Native support for light/dark mode using system CSS variables for colors and typography.
02Metric Utility Support: Built-in parsing and formatting for SI prefixes and engineering notation like 4k7 or 2u2.
03State Sync Patterns: Standardized logic for two-way synchronization between text editors and structured data models.
0444 GitHub stars
05Preact & Astro Integration: Automated setup and version-safe installation to prevent Vite resolution errors.
06Responsive Container Queries: Implements sidebar-aware layouts using @container queries instead of viewport media queries.

Use Cases

01Creating an embedded engineering calculator for component values like parallel resistance or capacitor charging.
02Adding a live configuration 'playground' that generates hex strings or code snippets based on user input.
03Building an interactive hardware protocol decoder or bit-field visualizer for an electronics blog post.