跪拜 Guibai
← All articles
JavaScript · Frontend · TypeScript

Lost Poem, Found Library: ew-solid-ui's 84 Solid Components

By 夕水 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

SolidJS now has a viable alternative to assembling headless components into a design system, covering admin, content, and AI use cases with styled components and built-in i18n. This project demonstrates that a single developer's practical needs can fill ecosystem gaps that React and Vue solved years ago.

Summary

When a developer couldn't locate a poem he wrote years ago because it was scattered across dead apps, he consolidated everything into a website. That site demanded an admin backend, and he chose Solid for its fine-grained reactivity. But the Solid ecosystem's UI libraries were either headless, leaving styling and theming to the user, or too incomplete to cover tables, date pickers, and admin layouts. So he built his own, starting with four components and growing to 84 across six packages.

The library spans base inputs, media players, layout, forms, data display, feedback overlays, navigation, and AI chat components. It uses CSS variables for theming with no CSS-in-JS runtime, offers composition-first design so buttons are reused in menus and dropdowns, treats accessibility as a default, and ships bilingual Chinese/English support. Version 0.0.5 includes 566 tests, a live playground, a theme lab, and a CLI that scaffolds admin or chat projects. The next targets are tree tables, editable tables, virtual lists, and a Vite plugin.

Takeaways
— ew-solid-ui has 84 core components, 5 themes, and 566 tests.
— The library ships as six packages: ew-solid-ui, ew-solid-pro, ew-solid-bits, ew-solid-charts, ew-solid-ui-admin, and create-ew-solid-ui.
— Theming uses CSS variables like --ew-* with no CSS-in-JS runtime, enabling SSR and Tailwind coexistence.
— i18n is built-in with a single LocaleProvider toggling all component copy, including pagination and date panels.
— Accessibility is a default behavior, with focus management and ARIA attributes integrated into components.
— A CLI generates admin or chat projects: `pnpm create ew-solid-ui my-admin` and `pnpm create ew-solid-ui my-chat --template chat`.
— The PcMobData component automatically switches tables to card lists under 768px.
— The AI chat state machine is exposed as a headless `createChat` hook with send/abort/reload/clear.
Conclusions

The Solid ecosystem's need for a full-featured, styled component library is real enough that a single developer built one in his spare time, suggesting headless-only distribution doesn't suit every team.

No CSS-in-JS is a deliberate trade-off: it simplifies SSR and static analysis but caps theming expressiveness, which is a pragmatic choice for content-heavy sites.

Composition-first enforcement, where dropdown menus and chat prompts reuse the same Button component, shows that design consistency is an architectural decision, not a guideline.

The PcMobData pattern, switching tables to cards on mobile, is a practical solution to a common admin pain point and highlights the value of dogfooding.

Concepts & terms
Headless UI
A UI library approach where components handle logic, state, and accessibility but leave all styling to the user. This gives flexibility but requires consumers to build their own design system.
CSS-in-JS
A styling technique that generates styles at runtime using JavaScript. The library avoids this in favor of CSS variables for better performance and simpler static analysis.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗