![Sam Selikoff](/img/default-banner.jpg)
- Видео 98
- Просмотров 1 425 271
Sam Selikoff
Добавлен 4 мар 2008
Quality videos on frontend development · buildui.com
Building an Elastic Slider with Framer Motion and Radix
Use Framer Motion to add a rubber band effect to a Slider built with Radix UI!
Code from the demo: buildui.com/recipes/elastic-slider
My new Radix course is live! 👉 buildui.com/courses/advanced-radix-ui
TIMESTAMPS:
0:00 - Before + After
0:39 - Moving the icon
5:31 - Animating on release
7:26 - Stretching the bar
12:24 - Animating the right icon
19:36 - Stretching the bar right
22:58 - Refactoring: Removing a MotionValue
26:00 - Refactoring: Removing magic numbers
31:04 - Refactoring: Centralizing business logic
35:52 - Decaying the overflow (Rubber Band effect)
39:37 - Grow on hover
46:51 - Bouncing the icons
48:47 - Final demo
Code from the demo: buildui.com/recipes/elastic-slider
My new Radix course is live! 👉 buildui.com/courses/advanced-radix-ui
TIMESTAMPS:
0:00 - Before + After
0:39 - Moving the icon
5:31 - Animating on release
7:26 - Stretching the bar
12:24 - Animating the right icon
19:36 - Stretching the bar right
22:58 - Refactoring: Removing a MotionValue
26:00 - Refactoring: Removing magic numbers
31:04 - Refactoring: Centralizing business logic
35:52 - Decaying the overflow (Rubber Band effect)
39:37 - Grow on hover
46:51 - Bouncing the icons
48:47 - Final demo
Просмотров: 6 971
Видео
Optimistic UI in Remix
Просмотров 8 тыс.7 месяцев назад
The useSubmit Hook just got an upgrade... let's use it to build some optimistic UI in Remix! 🔗 LINKS Code diff: gist.github.com/samselikoff/1b7d18b0aad30145e2f2a8c899fdf5bc Save 40% on Build UI this week 👉 buildui.com/pricing 🕐 TIMESTAMPS 0:00 - Intro 0:45 - Removing the pending UI 1:46 - Accessing pending form data with useFetchers 6:30 - Adding optimistic data to the feed 8:16 - Immediately c...
Session cookies in Remix
Просмотров 7 тыс.8 месяцев назад
Check out our full Remix course: buildui.com/courses/my-first-remix-app 0:00 - Intro 0:36 - Creating a /login route 2:41 - Creating the action 4:24 - Updating the UI with useActionData 5:13 - Using HTTP Sessions as durable storage 7:54 - Reading the cookie during a request 10:55 - Problems with our first approach 11:31 - Using createCookieSessionStorage 16:18 - Extracting a session.ts module 17...
What is Radix Themes?
Просмотров 18 тыс.8 месяцев назад
Check out the latest project from the team behind Radix UI! This video was made in collaboration with the Radix team. www.radix-ui.com/
6 New Tailwind Techniques in 8 minutes
Просмотров 21 тыс.9 месяцев назад
Highlights from my live-coding talk at Tailwind Connect 2023. 🔗 LINKS My Tailwind course: buildui.com/courses/tailwind-mastery Watch the entire talk: ruclips.net/video/CLkxRnRQtDE/видео.htmlsi=6oLGB6krXvZZ_QdC&t=600 🕐 TIMESTAMPS 0:00 - Intro 0:09 - Text accent 0:39 - Responsive typography 1:35 - Text balance 2:27 - :has() selector 4:26 - Container queries 7:06 - Masonry layout 8:17 - Outro
Fixing a React navigation bug
Просмотров 7 тыс.9 месяцев назад
Watch me and Ryan refactor a real-world codebase! We animate a slideover on back navigation, maintain scroll position when the slideover opens, and ensure a clean initial render based on the URL query params. PR with refactor: github.com/samselikoff/2023-09-16-directory-demo-app/pull/1 Original tweet demo: rthaut/status/1702182717008629936 TIMESTAMPS: 0:00 - Intro 1:31 - App overvie...
Highlight any panel in your dashboard
Просмотров 9 тыс.9 месяцев назад
Build an RSC-compatible Highlight component that can style any element when a prop changes. 🔗 LINKS Highlight code: buildui.com/recipes/highlight Animated Number code: buildui.com/recipes/animated-number 🕐 TIMESTAMPS 0:00 - Intro 0:26 - Highlighting after a change 1:25 - Resetting after a timer 2:19 - Extracting a useHighlight hook 3:57 - Extracting a Highlight component 5:22 - Using data attri...
Responsive Framer Motion with Tailwind CSS
Просмотров 54 тыс.10 месяцев назад
Learn how CSS Variables can bridge the gap between Framer Motion and Tailwind! 🔗 LINKS Demo on CodeSandbox: codesandbox.io/p/sandbox/github/samselikoff/2023-08-07-responsive-framer-motion-with-tailwind/tree/main Source on GitHub: github.com/samselikoff/2023-08-07-responsive-framer-motion-with-tailwind Tailwind Mastery course: buildui.com/courses/tailwind-mastery 🕐 TIMESTAMPS 0:00 - Intro 2:03 -...
What is Radix UI?
Просмотров 29 тыс.10 месяцев назад
Learn how Radix UI's library of unstyled, accessible components help you build better apps. This video was made in collaboration with the team behind Radix! www.radix-ui.com/primitives
Reusable Modals with Radix UI
Просмотров 19 тыс.11 месяцев назад
Learn how to refactor a customized Radix Dialog into a reusable Modal component. This is Part 3 of a series in collaboration with WorkOS. Part 1: ruclips.net/video/KvZoBV_1yYE/видео.html Part 2: ruclips.net/video/3ijyZllWBwU/видео.html Part 3: Reusable Modals with Radix UI 🔗 LINKS Code on GitHub: github.com/samselikoff/2023-05-30-radix-dialog/tree/main/03-reusable-component Demo on StackBlitz: ...
Dismissing a Radix Dialog after a form submission
Просмотров 20 тыс.11 месяцев назад
Learn how to turn our Radix Dialog into a controlled component so that it can be dismissed after a form submission, and use CSS to add mount and unmount animations. This is Part 2 of a series in collaboration with WorkOS. Part 1: ruclips.net/video/KvZoBV_1yYE/видео.html Part 2: Dismissing a Radix Dialog after a form submission Part 3: ruclips.net/video/VM6YRrUsnUY/видео.html 🔗 LINKS Code on Git...
Styling a Radix Dialog with Tailwind CSS
Просмотров 34 тыс.Год назад
Learn how to use Tailwind CSS to style a Radix UI Dialog component to match the look and feel of our app! This is Part 1 of a series in collaboration with WorkOS. Part 1: Styling a Radix Dialog with Tailwind CSS Part 2: ruclips.net/video/3ijyZllWBwU/видео.html Part 3: ruclips.net/video/VM6YRrUsnUY/видео.html 🔗 LINKS Code on GitHub: github.com/samselikoff/2023-05-30-radix-dialog/tree/main/01-sty...
From Pages to the App Directory in Next.js 13 (Nested Layouts)
Просмотров 13 тыс.Год назад
Get a sense of working with nested layouts in Next.js 13 by migrating my Discord clone from the app to the pages directory. 🔗 LINKS Tailwind Mastery course: buildui.com/courses/tailwind-mastery Stackblitz from video: stackblitz.com/github/samselikoff/2023-05-23-discord-nested-routes?file=app/layout.tsx 🕐 TIMESTAMPS 0:00 - Intro 0:30 - Root layout 1:34 - Index page 2:29 - useParams Hook 4:35 - M...
Building an Animated Counter with Framer Motion
Просмотров 13 тыс.Год назад
Learn how to get an animated counter to animate in response to React state changes. 🔗 LINKS Build UI Recipe (updated so each digit stops on a number): buildui.com/recipes/animated-counter CodeSandbox from video: codesandbox.io/p/sandbox/github/samselikoff/2023-05-24-animated-counter/tree/main?file=/app/page.tsx:1,1 🕐 TIMESTAMPS 0:00 - Intro 0:38 - Rendering a column of digits 2:37 - Using a Spr...
Fullstack React Components - with no API
Просмотров 14 тыс.Год назад
Take an early look at how to use Server Actions to build fully reusable full stack components - even ones that accept functions as props! 🔗 LINKS Code from the video: github.com/samselikoff/2023-05-15-server-actions Server Actions docs: nextjs.org/docs/app/building-your-application/data-fetching/server-actions 🕐 TIMESTAMPS 0:00 - Intro 0:56 - Reusable component action 4:30 - Exposing an afterSa...
I built a chart as a React Server Component
Просмотров 10 тыс.Год назад
I built a chart as a React Server Component
Animating a radial gradient with Framer Motion
Просмотров 14 тыс.Год назад
Animating a radial gradient with Framer Motion
Building an iOS Animated Toggle with React Aria Components and Tailwind CSS
Просмотров 9 тыс.Год назад
Building an iOS Animated Toggle with React Aria Components and Tailwind CSS
Why React Strict Mode breaks your app - on purpose
Просмотров 8 тыс.Год назад
Why React Strict Mode breaks your app - on purpose
Building Trello's animated checklist with Framer Motion
Просмотров 9 тыс.Год назад
Building Trello's animated checklist with Framer Motion
Animating a Radix Dropdown with Framer Motion
Просмотров 18 тыс.Год назад
Animating a Radix Dropdown with Framer Motion
6 ideas for animating your app with Framer Motion
Просмотров 105 тыс.Год назад
6 ideas for animating your app with Framer Motion
Building the slider from iOS 16 with Framer Motion
Просмотров 14 тыс.Год назад
Building the slider from iOS 16 with Framer Motion
Using CSS Container Queries with Tailwind CSS
Просмотров 25 тыс.Год назад
Using CSS Container Queries with Tailwind CSS
Parallax scrolling in 3 lines of code!
Просмотров 36 тыс.Год назад
Parallax scrolling in 3 lines of code!
Get a sneak peek of Framer Motion Recipes!
Просмотров 20 тыс.Год назад
Get a sneak peek of Framer Motion Recipes!
I realized that u should have used offsetX and offsetY to find the center and your video can be shorter too.😅
I realized that u should have used offsetX and offsetY to find the center. This way, there's no need for infinity, and your video can be shorter too.
This library is clean! Using it going forward 😎
so for anyone coming back here tryin to figure out how to do this, i figured out a way without having to do any of the magic poor sam had to go through. so table algorithms apply to table elements. important bit of information. key is to have your data in a nested div and if you insist on padding, its gotta be on a div that isn't a motion.div. This is using the latest TanStack Table (An animate present is wrapping the mapped rows within a normal tbody element. exactly like sams. now my expanded rows have some schmexy butter smooth transitions in and out of the dom the styles used are simply tr: "even:bg-surface-content-alt", td: "p-0 m-0", cell: "px-4 py-3", function TableRow<T extends object>({ row }: { row: Row<T> }) { const styles = tableBodyStyles(); return ( <motion.tr initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} className={styles.tr()} > {row.getVisibleCells().map((cell) => { const metaType = cell.column.columnDef.meta?.type || "text"; return ( <td className={styles.td()} key={cell.id}> <motion.div initial={{ height: 0 }} animate={{ height: "auto" }} exit={{ height: 0 }}> <div className={styles.cell({ metaType })}> {flexRender(cell.column.columnDef.cell, cell.getContext())} </div> </motion.div> </td> ); })} </motion.tr> ); }
all ive done is anything that animates height in a table, make sure its in a motion.div. if you want padding, add another nested div and apply the padding on that. bit of a stuff around but keeps things gentlemanly without worrying about fixed widths, absolute positioning, etc...
I discovered radix through the hype surrounding shadcn, radix is exactly what I want.
The useFetcher singleton approach has its applications. E.g.: When clicking a like button, you don't want it to send all the requests, you want just the last input.
I don’t get it, the 1st example of 3 independent loaders seems like a better UX than waiting for a 3 fetches to resolve before rendering all at the same time. Data is rendered as soon as it’s available.
Thank you! I like the way you iterate over the solution to make it robust.
Not interested
Soooo Goood!!!! Thanks Sam!
Loved your content ❤
Great tutorial, but it only works for properties of type string since "var(--..." is a string. How would you make it work for properties of type number, like duration and delay.
This to me seems to take away any creativity from ui building or is that ignorant?
Good custom UI's will always need designers, but sometimes a project needs a UI built quickly that doesn't look like crap. This is definitely a step better than everyone just using MaterialUI or Bootstrap.
Wow, didn't know you could retrive form data just like that. Great tip.
Amazing Sam!
Just found your channel dude, but so far I love it. Your stuff is perfect to have on while you're working , not so much for instructional stuff, but just for new ideas and different approaches.
I'm a fairly experienced developer, and I just finally moved from gsap to framer motion. I always thought I can do everything with gsap so why change, but holy s--t... It's soooooooo much faster and just overall better. I'm actually kind of embarrassed that it took me this long to migrate.
10 lines of code, but you have to know what 10 lines. It always pays to know what you are doing. Thanks for this!
How to revert back if data failed to save in database?
For anyone using Expo (v51), I had to specify a fetcher function on the useSWR hook, otherwise the app would just softlock. Nonetheless great tutorial, thank you!
Hey man, thanks for this video, helped me to solve an issue with a reusable radix dialog size transitions, I even managed to do a back and forth transition for the content in the modal, it looks pretty cool!.
So, now React19, we can use use API with Promise directly?
Yes you can! You just have to make sure the promise is stable; if you create one during render you'll end up in a loop. (See this note about it in one of the recent blog posts from the team: react.dev/blog/2024/04/25/react-19#use-does-not-support-promises-created-in-render). LMK if you have more questions!
I love the content you produce so much
Sam you are a one of a kind teacher! Does this come as natural as it looks? Extremely grateful for your videos
Thank you! I've been teaching in some capacity since college, but there's also plenty of editing :)
огромное спасибо Вам)!
Appreciate these longer format teaching sessions. Your ability to break down and simplify complex problems into easy to digest segments is top tier. Thank you for taking the time to put these videos together man.
how would you handle the activation of other buttons when sliding around?
damn i was JUST looking for ways to make the masonry effect and then this video pops up
you did a great job bruh, earlier I had no idea of this library . Thanks so much
That's great! That's what I need. Thank you very much! You explained everything simply and clearly!
Helpful
Woah.. Didn't know about the event.currenttarget trick for form events. Also, your vim chops are buttery smooth.
Bro, you solved my problem. Thanks so much for this tutorial
Dialog must be outside the list right?
You are a natural teacher.
Just getting into Framer Motion and this is a cool place to kickoff some nice UI updates
thanks bro
i love you, you are the best really , keep publishing more amazing content <3
Thank you! You are making some really good content!
Огромное Вам спасибо, супер урок!)
I really loved this video. Would you be able to describe how to add a tooltip to the graph using your method of react and D3? Not sure how to use the enter method in d3 to link a tooltip to the data. Thanks!
Is the tooltip rendered by D3 or by a React lib like Radix?
@@samselikoff I managed to make a tooltip with just React, but I’m a little stuck. So far, it highlights the section of the x-axis using some JSX/CSS style tricks and mouseover/mouseout functions, and printing the x & y value I hover over in a div below the graph. But I’m still having trouble highlighting the y-axis value to make a crosshair type of tooltip that tracks the data (the dateof intervals using date fns made the x axis highlighting easier than the values found in the y-axis, since the y-axis doesn’t have set intervals to make any CSS rectangle type tricks). For the x axis, I just made equal rectangles that correspond to the date intervals with opacity of 0 and turned opacity = 1 at mouseover. I was trying to see if it’s doable using D3, but in following the tutorial, it seems like React is the framework in control of the DOM for this project, unless there is a way to use D3’s control of the DOM for only the tooltip? I have not tried Radix. Is that an easier and more general solution than what I’m trying to do? I’m graphing monthly S&P 500 data over 1993-2024 using your method. You can check out what I did so far here: github.com/drcasas2/sp500dataviz And the live page for the result here: drcasas2.github.io/sp500dataviz/
Огромное спасибо. Круто
Excellent stuff @Sam, when are you planning for discount on your courses. I am interested in life time subscription.
Great tutorial on Optimistic UI and fetchers, thanks.
the flicker after clicking the button looks more like a small bug in my eyes lol, even though it's not , am I the only one that thinks this?
огромное спасибо Вам!
what vscode theme are you using?
This is nice, I have been looking at dropdown animation lately and I stumbled upon the that of Semantic Ui dropdown animation, which in my opinion is that best dropdown animation out there. However, the downside to it is that it was done using jquery and css. You might want to take a look at their dropdown animation and hopefully make a video on how this can be achieved using Framer Motion. Nice videos and explanation. Keep them coming 🚀
crazy video, really helpful thank you brother
need to check if component is still mounted. if (currentAnimation === animationCounter.current && isMounted.current) { controls.set({ rotate: 0 }) // Reset rotation without animation }