Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»A Resize Plugin for Alpine.js

    A Resize Plugin for Alpine.js

    July 27, 2024

    Caleb Porzio, creator of Alpine.js, just released a resize plugin that allows you to react easily when an element changes. This plugin is a wrapper around the Resize Observer API, and the impressive part, in my opinion, is how this plugin went from idea to publish in just over an hour!

    [The resize plugin] is useful for: custom size-based animations, intelligent sticky positioning, conditionally adding attributes based on the element’s size, etc.

    Here’s an example of using the x-resize attribute to handle size changes:

    <div
    x-data=”{ width: 0, height: 0 }”
    x-resize=”width = $width; height = $height”
    >
    <p x-text=”‘Width: ‘ + width + ‘px'”></p>
    <p x-text=”‘Height: ‘ + height + ‘px'”></p>
    </div>

    If you want to know the width and height of the entire document instead of a specific element, you can use the .document modifier:

    <div
    x-data=”{ width: 0, height: 0 }”
    x-resize=”width = $width; height = $height”
    >…</div>

    Note that the height is the scroll height, not the viewport’s height. You’ll see a larger height as you change the size of the window and the content is pushed down on smaller screens.

    You can learn more about this plugin in the Alpine.js documentation!

    The post A Resize Plugin for Alpine.js appeared first on Laravel News.

    Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleAPI Versioning in Laravel 11
    Next Article How to Migrate MySQL from DBngin to Laravel Herd

    Related Posts

    Machine Learning

    Salesforce AI Releases BLIP3-o: A Fully Open-Source Unified Multimodal Model Built with CLIP Embeddings and Flow Matching for Image Understanding and Generation

    May 16, 2025
    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Error’d: Three Little Nyms

    Development

    Ukrainian REvil Hacker Sentenced to 13 Years and Ordered to Pay $16 Million

    Development

    Shockingly, ChatGPT doesn’t consume as much power as previously thought — A new study reveals the stats were based on “napkin math” with the assumption that OpenAI powers next-gen models with dated GPUs

    News & Updates

    DSplats: 3D Generation by Denoising Splats-Based Multiview Diffusion Models

    Machine Learning

    Highlights

    News & Updates

    This deal gets you Microsoft 365 for less than half price… from a certain point of view

    February 25, 2025

    This Microsoft 365 deal drops the price of the subscription to just $59.99. That’s an…

    Advanced Testing Techniques with Cypress: Part 2 – Introduction to Advanced Techniques

    April 16, 2024

    Equiniti Trust Company Settles with SEC Over $6.6 Million Cybersecurity Failures

    August 22, 2024

    Fireworks AI 和 MongoDB:依托您的数据,借助优质模型,助力您开发高速 AI 应用

    April 11, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.