Skip to main content

jaspr_daisyui_components 0.3.0 copy "jaspr_daisyui_components: ^0.3.0" to clipboard
jaspr_daisyui_components: ^0.3.0 copied to clipboard

Typed Jaspr components for every daisyUI component, generated from the daisyUI docs.

jaspr_daisyui_components #

pub package showcase

Typed Jaspr components for daisyUI, generated from the daisyUI documentation.

Current daisyUI source: v5.7.50.

Showcase: dazemc.github.io/jaspr_daisyui_components — a jaspr_content docs site built from the official daisyUI markdown, with live previews and matching HTML/Dart tabs Package: pub.dev/packages/jaspr_daisyui_components

The portfolio site uses these components directly, alongside jaspr_lucide for its icon set.

Usage #

import 'package:jaspr/jaspr.dart';
import 'package:jaspr_daisyui_components/jaspr_daisyui_components.dart';

class Example extends StatelessComponent {
  const Example({super.key});

  @override
  Component build(BuildContext context) {
    return Card(classes: 'bg-base-100 w-96 shadow-sm', [
      CardBody([
        CardTitle([Component.text('Card Title')]),
        Component.text('A typed daisyUI card.'),
        CardActions(classes: 'justify-end', [
          Btn(
            color: BtnColor.primary,
            style: [BtnStyle.soft],
            [Component.text('Buy now')],
          ),
        ]),
      ]),
    ]);
  }
}

Regenerating #

The daisyUI source is a git submodule at src/daisyui.

cd tool
uv run main.py   # parse the latest daisyUI docs
./gen.sh         # regenerate lib/src and the library export

main.py writes the normalized component model to components.json; generate.dart turns that model into the typed Dart components. The generator skips JS-only examples such as Cally, React Day Picker, VC, and the quoted drawer variant selectors.

Audit generated files, aliases, and exports at any time:

cd tool
uv run audit_components.py

Showcase #

The GitHub Pages showcase lives in showcase/:

cd showcase
./build.sh

Coverage #

The package is generated from every HTML component/part in the daisyUI v5.7.50 docs. Two docs entries are aliases rather than separate CSS components:

  • Accordion uses the same classes as Collapse.
  • Pagination uses the same classes as Join.

The Calendar docs entry only provides styling hooks for Cally, React Day Picker, and Vanilla Calendar Pro, which are external JS libraries, so it is intentionally not generated as a Dart component.

0
likes
150
points
553
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Typed Jaspr components for every daisyUI component, generated from the daisyUI docs.

Homepage
Repository (GitHub)
View/report issues

Topics

#jaspr #daisyui #tailwind #components #web

License

MIT (license)

Dependencies

build_runner, jaspr, json_annotation, json_serializable

More

Packages that depend on jaspr_daisyui_components