Uniform::HTMX::Dancer2

CPAN version License: MIT

A lightweight, seamless HTMX integration plugin for Dancer2 applications, built on the Uniform::HTMX base layer.

Features

Installation

Install directly from CPAN using cpanm:

cpanm Uniform::HTMX::Dancer2

Or from a checkout of this distribution:

cpanm --installdeps .
perl Makefile.PL
make
make test
make install

Synopsis

use Dancer2;
use Uniform::HTMX::Dancer2;

get '/items' => sub {
    if (is_htmx) {
        htmx->res_retarget('#item-list');
        htmx->res_trigger('itemsLoaded', { count => 10 });
        return template 'partials/items' => {}, { layout => undef };
    }

    return template 'full_page';
};

start;

A runnable demo app lives in examples/app.pl.

Documentation

Full method documentation lives in the module's POD:

perldoc Uniform::HTMX::Dancer2

or on MetaCPAN once released.

Testing

prove -Ilib -v t/

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

This software is Copyright (c) 2026 by Joshua S. Day.

This is free software, licensed under the MIT License.