dnsk-work/twill-picture

Progressive blur-up <x-twill-picture::picture> Blade component for Twill + Glide (or any query-param image transform service)

Maintainers

Package info

gitlab.com/dnsk.work/twill-picture

Issues

Language:Blade

pkg:composer/dnsk-work/twill-picture

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.2 2026-06-22 18:04 UTC

This package is auto-updated.

Last update: 2026-06-22 17:26:58 UTC


README

# Twill Picture

Packagist Downloads MIT PHP ^8.1 Laravel 10 | 11 | 12 by dnsk.work

An <x-picture> Blade component for Laravel Twill that renders responsive WebP images with a progressive blur-up (LQIP) load: a blurred low-quality placeholder shows instantly, the full image fades in on load, and the placeholder is removed from the DOM.

Works with Glide, imgproxy, Cloudinary, imgix — anything that takes w, q and fm as URL query parameters.

Requirements

PHP^8.1
Laravel10, 11 or 12

Installation

composer require dnsk-work/twill-picture

The component auto-registers as <x-twill-picture::picture>. To use the shorter <x-picture> tag, publish the view:

php artisan vendor:publish --tag=twill-picture-views

Usage

<x-twill-picture::picture
    src="{{ $block->image('hero_image', 'desktop') }}"
    alt="{{ $title }}"
    loading="eager"
    fetchpriority="high"
    sizes="100vw"
    class="w-full h-full"
/>

Props

PropDefaultDescription
src''Image URL. Existing query params are preserved.
alt''Alt text.
loadinglazySet to eager for above-the-fold / LCP images.
fetchprioritynullSet to high for the LCP image.
widthnullPassed to <img> for layout stability (CLS).
heightnullPassed to <img> for layout stability (CLS).
sizes100vwCSS sizes attribute for responsive selection.
classApplied to the outer wrapper <div>.

Any other attribute is forwarded to the <img> element.

How it works

  1. A wrapper <div> with position: relative; overflow: hidden.
  2. An absolutely-positioned <div> shows a 40px WebP LQIP (w=40&q=10&fm=webp) scaled up with blur(24px); inset: -10% hides the blur-edge glow.
  3. A <picture> with a WebP <source> at 400 / 800 / 1200 / 1600 / 2400w, plus a fallback <img> at opacity: 0.
  4. On img.onload, opacity transitions to 1 and the LQIP element is removed from the DOM.

License

MIT — © dnsk.work.

**[dnsk.work](https://dnsk.work)** — a UI/UX design agency without the agency part.
Senior-led, embedded, no six-week process.