Introducing <NumberFlow/> for React:
Transition, format, and localize numbers.
Built on Intl.NumberFormat and Web Animations. Dependency-free. Accessible. Customizable.
Introducing MotionNumber for
@Framer
Motion: a ~3kb component to transition, format, and localize numbers.
Built on Intl.NumberFormat. Accessible. Customizable.
fluid-tailwind 🌊⚡️
Smoother responsive styles in less code.
• Works with every Tailwind utility
• Full IntelliSense
• Checks accessibility of fluid type
👉
This slider is MotionNumber's final boss. The approach here worked well but relied on 3d transforms which seemed to trash performance in Chrome 🫤. Back to the drawing board
.
@jaffathecake
's linear() easing generator is invaluable for emulating springs with CSS alone (necessary for i.e. View Transitions). Same syntax as Framer Motion!
finding it heartwarming seeing a lot of people recreate this animation. it's relatively simple and approachable, so watching how others break it down into it's components is fun to see
This is the successor to MotionNumber, rewritten to address tricky bugs and drop the dependencies. It should work just as well with Framer Motion and handle far more use cases 👍
Introducing MotionNumber for
@Framer
Motion: a ~3kb component to transition, format, and localize numbers.
Built on Intl.NumberFormat. Accessible. Customizable.
Tailwind CSS pro tip⭐️
Reduce bundle size and increase performance with the config option:
experimental: { optimizeUniversalDefaults: true }
(Doesn't work if you're using scoped CSS, i.e. CSS modules, Vue, Svelte, etc.)
For the curious, this is the 3d transform I was referring to. I wrapped the numbers in 3d space so I could rotateX the container and apply a bunch of composited WAAPI animations to handle interruptions. Any advice to get this working better in Chrome would be greatly appreciated
@KevinJPowell
I add this on basically every new project (stack children on top of each other). Here's an example where the top and bottom captions overlap, ensuring the pages in the middle are always properly aligned:
fluid-tailwind 🌊⚡️
Smoother responsive styles in less code.
• Works with every Tailwind utility
• Full IntelliSense
• Checks accessibility of fluid type
👉
@jh3yy
So cool! How did you break the images out of the list items? I did the same thing with this slider but hit some bugs when the list item was close to 100% the width of the container (not pictured)
@branmcconnell
@framer
@family
That's sweet! I actually went out of my way to support variable-width fonts, but unfortunately the kerning is a little worse when every char is wrapped in an element. Haven't seen a way to correct that:
fluid-tailwind users: which syntax would you prefer?
A) ~md/lg:~text-4xl/7xl
B) fluid-md/lg:text-fluid-4xl/7xl
(For B, the "fluid" keyword could be changed with a plugin option and there'd be no need for the custom extractor)
📢 Parcel v2.12.0 brings support for macros, a new web-based REPL, improved CSS bundling, and manual code splitting!
Macros are JS/TS functions that run at build time instead of being bundled. They can generate constants, code, and even assets (eg css)!
@UnoDwicho
@codrops
They definitely work better with a trackpad! It *should* still work with a scroll wheel as long you scroll horizontally. Scroll snapping for me gets pretty jumpy with a scroll wheel, though 😐
@ibnlanre
Thanks for the honest feedback; I agree with all of it. I've begun an experimental rewrite in vanilla JS/WAAPI to improve performance and address some lingering issues I have with it.