Introducing Tween UI 🎉
A free collection of animated React components and blocks, built with @greensock and @tailwindcss .
Use the shadcn registry command to copy the full code into your project. Own it and modify it to suit your taste.
https://t.co/i89aYFrgRy
css tip
Media queries only know the screen width. A card that sits in both a sidebar and a main column needs the width of its own slot:
.slot { container-type: inline-size; }
Then a container query stacks the card when the slot drops below 300px.
css tip
Focus ring stuck on buttons after a mouse click? Style :focus-visible, not :focus. Keyboard users still get the ring:
button:focus-visible { outline: 2px solid; }
next.js tip
Search forms don't need a full page reload. Swap <form> for <Form>:
import Form from 'next/form'
<Form action="/search"><input name="q" /></Form>
It prefetches the route and navigates on the client.
Elastic Slider: drag past either end and the ruler stretches like an accordion, then springs back. The ticks swell in a wave under the cursor and the digits roll. Now in Tween UI.
https://t.co/75DoHeg2x7
css tip
Inputs and textareas can grow as you type. No JS, no scrollHeight:
input, textarea { field-sizing: content; }
Give them a min-width and max-width. In every major browser since Firefox 152.
Theme Toggle Reveal: the new theme grows out of the icon as a pixelated circle until it fills the screen. 8 reveals to pick from, circle to spiral. Now in Tween UI.
https://t.co/pgLHCNeSUR