Introducing Deepyr: A Type-Safe DaisyUI Component Library for Jaspr

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:

  • :bullseye: Type Safety: Eliminate styling errors before you even run your code.
  • :wrench: Fluent API: Write readable and chainable style modifications.
  • :artist_palette: 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

Thanks for taking the time to check it out. I’m really looking forward to any thoughts or feedback!

4 Likes

This is really terrific work, thanks for putting it out there!

1 Like

Thanks so much, @craigomac - really appreciate your kind words!

Since I first posted this, Deepyr has evolved quite a bit. It now covers about 95% of all DaisyUI components, all implemented with full type safety and a consistent, fluent API.

A quick note: Deepyr is still a proof of concept at the moment. Once the API stabilises I plan to publish concrete examples and templates, plus a clear step-by-step guide showing how to integrate Tailwind and DaisyUI into a Jaspr project - aimed at making adoption as painless as possible.

If you (or anyone else) want to take a look, the live demo and docs are up to date here:
https://deepyr-doc.web.app/

Feedback and ideas are still super welcome.

Thanks again for the encouragement! :rocket: