Hey fellow Jaspr & Dart developers,
I’ve been working on a project to solve a pain point I’m sure some of you have felt: managing Tailwind and DaisyUI classes as “magic strings” in a type-safe language like Dart. I’d like to introduce the result: Deepyr.
The Problem: Silent Errors and No Autocomplete
While I love the power of Jaspr and the aesthetics of DaisyUI, the traditional string-based approach felt a bit out of place. A simple typo can lead to silent failures, and there’s no help from the IDE to discover available styles.
Traditional approach:
// A typo in "btn-primry" would break styling without a warning.
div(classes: "btn btn-primry lg:btn-lg", [
text('Click Me')
])
Deepyr’s Approach: Type-Safety and a Fluent API
Deepyr wraps DaisyUI components and their modifiers in strongly-typed Dart objects. This means you get compile-time checking and full IDE autocomplete for everything.
The same component with Deepyr:
// 100% type-safe, compile-time checked, and discoverable.
Button(
[text('Click Me')],
style: [
Button.primary,
Button.lg.at(Breakpoint.md), // Fluent API for responsive design
],
)
The core principles are simple:
Type Safety: Eliminate styling errors before you even run your code.
Fluent API: Write readable and chainable style modifications.
DaisyUI Faithful: A 1:1 mapping of DaisyUI’s components and options.
Current Status & Feedback I’m Looking For
The project is still in its early stages (v0.1.0). I’d consider it a solid foundation rather than a production-ready library. The main focus so far has been to create a clean and extensible API.
The best way to get a feel for it is to check out the live demo. I’m posting here to gather feedback from the community, especially on these points:
- API Feel & DX: Does the API feel intuitive? Is this a developer experience you’d prefer over string-based classes?
- Practicality: Can you see this being useful in a real project? Are there any obvious gaps or deal-breakers you notice from the demo?
- Component Gaps: What are the must-have DaisyUI components you’d need to see implemented next to consider it for a project?
Links
- Live Demo & Documentation: https://deepyr-doc.web.app/
- GitHub Repository: https://github.com/PhilippHGerber/ui_components
- Pub.dev Package: https://pub.dev/packages/deepyr
Thanks for taking the time to check it out. I’m really looking forward to any thoughts or feedback!