0
Drop-in components that automatically handle viewport-aware positioning, smooth animations, and dynamic sizing without writing brittle CSS or JavaScript
Added Dec 2, 2025
7 signals
Frontend developers waste hours debugging complex CSS layout issues: dropdowns that overflow viewports, animations that break responsive designs, and dynamic content that doesn't transition smoothly. Current solutions require manual JavaScript calculations and deep CSS expertise, leading to brittle code that breaks across devices and browsers.
A component library/SDK providing intelligent, framework-agnostic web components for common UI patterns (dropdowns, modals, animated containers). Components automatically detect viewport boundaries, animate between layout states using FLIP techniques, and adapt to dynamic content sizes while exposing simple props instead of complex CSS.
Modern web applications demand sophisticated, app-like UIs with perfect responsiveness and smooth animations. As apps grow more complex, developers need higher-level abstractions that eliminate CSS layout debugging, especially with the rise of component-driven development and cross-platform web apps.
I'm building an autocomplete (enter text into an input, do a API call, show matching content in a drop down div). I've got it mostly working (I'm sure there are issues, but not too important for this question). In the context of the page I'm making, on a mobile view, there could potentially be enough rows containing these inputs where the drop down could be at the bottom of the screen, which if I'm correct, as an absolute object, could go below the viewport? Even if not, it would extend the view port, but you couldn't scroll down without closing the drop down if I set it to close when clicked outside (which I obviously would). I know in the future, we'll have anchor name to help with this problem, but how could I have the drop down appear above the element if it goes below the viewport? I feel like there's probably some math-y thing I could do in JS, but what that is isn't coming to me.
Hi everyone, I'm working on a welcome screen for a Laravel Blade project. I have an animated SVG (it draws itself and flickers with internal animations). What I want to achieve is: Initially, the SVG should appear centered on the screen, occupying most of the viewport (around 75%-85% of the size, as a “loading”). Let it fully complete its internal animation (drawing lines and flickering). After that, the SVG should smoothly move to the top-left corner and scale down to act like a small logo or button. I'm currently embedding the SVG directly into the Blade view (using file_get_contents()) and controlling the size and movement with JavaScript. Here’s a bit the code I'm using (if requested I can send other parts of the code, such as the one in layout, or what I am using for the base.blade. <x-app-layout> <x-self.base> <div class="relative w-screen h-screen overflow-hidden"> <div id="logo-container" class="absolute inset-0 flex items-center justify-center"> <div id="logo-svg" class="w-[90vw] h-auto"> {!! file_get_contents(public_path('storage/media/Gamora-gradient-faster.svg')) !!} </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', () => { const logoContainer = document.getElementById('logo-container'); const logoSvg = document.getElementById('logo-svg'); // Ajustar tamaño inicial al 75% de viewport function setInitialSize() { const screenWidth = window.innerWidth; const screenHeight = window.innerHeight; const size = Math.min(screenWidth, screenHeight) * 0.50; logoSvg.style.width = size + 'px'; logoSvg.style.height = 'auto'; } setInitialSize(); window.addEventListener('resize', setInitialSize); // Esperamos 4 segundos para mover y escalar setTimeout(() => { logoContainer.style.transition = 'all 1.5s ease-in-out'; logoContainer.style.transformOrigin = 'top left'; logoContainer.style.transform = 'translate(5%, 5%) scale(0.2)'; }, 4000); // 4 segundos después }); </script> </x-self.base> </x-app-layout> The problem: I'm struggling to control the initial size properly (it doesn’t cover enough screen space) and later, when scaling down, it becomes way too small or moves awkwardly. Question: How would you structure this so that: The SVG is correctly centered and large on load, It smoothly moves to the top-left corner after its animation finishes (the 4 seconds await), And stays nicely visible and proportionate across different screen sizes? I'm open to using CSS, JavaScript, or any better approach! Thanks so much in advance! Extra: is there a way to do that when the svg moves to the top-left corner, the whole screen appears in like reverse fading? (I don’t know if I’m explaining myself correctly)
I have a componant that is fixed absolutely within the full screen and requires a scoll bar. I know the scroll bar is customizable to a point, but is it possible to have an image on the outside, next to the scroll bar, that indicates where it is? For example, if the bar is near the top, so would the image, on the right. But if it's near the bottom, the image is near the bottom as well. [A drawn hand pointing at the scroll bar.](https://preview.redd.it/g05p43e0pr7f1.png?width=235&format=png&auto=webp&s=fbedc17f7c7de208576e2dee4605b70768a97be4) In the image I made (attached in a comment), I would like the drawn hand to move up and down with the scroll bar. Thanks to any help!
I am learning how to make an animated dropdown on my sidebar. The one I did was a fixed height value, then changed the height value using javascript, which will then be animated using transition height on the css. The problem with that is I want it to have a scalable height so that when I add another link in the dropdown, it will automatically adjust the height to fit all links. So I used height: auto; so that it would be responsive. The problem with that is that height: auto; doesn't get animated by transition height. HTML: <div class="nav_dropdown"> <span class="dd_icon_title"> <i class="fa-solid fa-folder-open nav_icon"></i> <div class="nav_title">Projects</div> </span> <i class="fa-solid fa-chevron-right dropdown_arrow"></i> </div> <div class="dropdown_container" style="height: 0px;"> <a href="?p=p01" class="db_link">Link One</a> <a href="?p=sc" class="db_link">Link Two</a> <a href="?p=vvvlt" class="db_link">Link Three</a> </div> CSS: .dropdown_container { /* background-color: red; */ display: flex; flex-wrap: wrap; gap: 0px; /* width: 100%; */ margin-top: 4px; margin-left: 47px; margin-right: 4px; /* width: 100%; */ /* height: 0px; */ overflow-x: hidden; overflow-y: hidden; transition: height 0.4s; } JAVASCRIPT: let nav_dropdown = document.querySelectorAll(".nav_dropdown"); let sidebar = document.getElementById("the_sidebar"); for (let i=0; i < nav_dropdown.length; i++) { nav_dropdown[i].addEventListener('click', function() { let dropdown_container = this.nextElementSibling; let dropdown_arrow = this.querySelector(".dropdown_arrow"); if (sidebar.style.width =="20%") { let dropdown_container = this.nextElementSibling; if (dropdown_container.style.height == "0px") { dropdown_container.style.height = "auto"; dropdown_arrow.style.transform = "rotate(90deg)"; dropdown_arrow.style.marginTop = "10px"; console.log("container is now showing"); console.log(dropdown_container.style.height); } else { dropdown_container.style.height = "0px"; dropdown_arrow.style.transform = "rotate(0deg)"; dropdown_arrow.style.marginTop = "0px"; console.log("container is now close"); console.log(dropdown_container.style.height); } } }); }
i really dont understand how minmax() work, in this html for example: <div style=" height: 700px; background-color: #0096FF; "> <div style=" display: grid; grid-template-rows: 3rem 3rem 1fr minmax(0, 3rem); gap: 0.5rem; background-color: #d1d5db; /* gray-300 */ height: fit-content; padding: 1rem; "> <div style="background-color: #ef4444; display:flex; align-items:center; justify-content:center;">Row 1</div> <div style="background-color: #22c55e; display:flex; align-items:center; justify-content:center;">Row 2</div> <div style="background-color: #3b82f6; display:flex; align-items:center; justify-content:center;">Row 3</div> <!-- <div style="background-color: #facc15; height:1rem; width:100%;"></div> --> </div> </div> i expected the grid to shrink last row to 0 when it is empty, but no, you can clearly see it still have 3rem height by its gray background. Even when you uncomment the last row, which have 1rem only, the height of the grid is still 3rem, it doesnt shrink to 1rem! Im really confused
+11 more signals