Advanced Sortable Drag and Drop with React & TailwindCSS

  Рет қаралды 37,164

Tom Is Loading

Tom Is Loading

Күн бұрын

Animated UI components for React, Tailwind CSS, Framer Motion & More ✨ www.hover.dev
Today we're going to a build a Notion inspired drag and drop kanban board using React, TailwindCSS, and Framer Motion. We'll do this entirely from scratch, this way you can take these same skills and build other drag and drop experiences.
#javascript #reactjs #webdevelopment
📚 Video Links
Source code: www.hover.dev/components/boards
🔗 My Links
TikTok: / tomisloading
Instagram: / tomisloading
GitHub: github.com/TomIsLoading
Twitter: / tomisloading
Discord & more: linktr.ee/tomisloading
Portfolio templates: tomisloading.gumroad.com/
0:00 - Introduction
0:34 - Layout and style columns
3:37 - Layout and style cards
5:50 - Style drop indicators
7:20 - Layout and style delete section
8:46 - Setup form
11:24 - Deleting cards
13:09 - Add layout animations
14:11 - Column highlighting
15:01 - Highlight indicators
17:25 - Moving cards between columns
19:18 - Persisting cards on page refresh

Пікірлер: 62
@tomisloading
@tomisloading 4 ай бұрын
!!QUICK NOTE!! If anyone is having issues on mobile, try adding ontouch events along with your ondrag events! According to caniuse, the drag API SHOULD be supported on all modern browser's, but after a bit of googling it looks like some devices won't listen for drag. Touch events should work though! I've been unable to replicate as this works as expected on all devices I have access to, so if this solution works for anyone, please let me know so that I can update the source code 😂😂
@FlintBits
@FlintBits 4 ай бұрын
For any juniors - pay attention to his mental approach when going through this exercise. The order, code layout, how functions are introduced, is the most valuable thing in this video.
@DanZ-fq2qs
@DanZ-fq2qs 27 күн бұрын
I like how you present the building process by not typing everything, this vid will easily become a 5 hours course in some other channel. Thank you for saving our time.
@alvaroaquije2572
@alvaroaquije2572 4 ай бұрын
Damn this is gold here guys!
@justhrthings
@justhrthings 4 ай бұрын
this is awesome really appreciated for these tutorials looking forward for more.
@ruturajreddy1
@ruturajreddy1 4 ай бұрын
Tom is loading ❌ legend ✅. Thanks for this absolutely simple explanation.
@EnriqueDominguezProfile
@EnriqueDominguezProfile 4 ай бұрын
This is simply brilliant. The way you used data-attributes, and storing the ID on the event itself! I learnt a ton from this tutorial. Thank you very much.
@tomisloading
@tomisloading 4 ай бұрын
Thank you so much! :)
@Lifad2562
@Lifad2562 18 күн бұрын
Awesome !
@iuliancarnaru954
@iuliancarnaru954 4 ай бұрын
Great content, keep the good work up
@ismael3s
@ismael3s 4 ай бұрын
Dude, you're amazing
@FreeCodeArena
@FreeCodeArena 4 ай бұрын
Awesome content 🎉
@karthikraju6225
@karthikraju6225 3 ай бұрын
You should change the channel name to Tom Is Cooking. Thank you for making this!
@tomisloading
@tomisloading 3 ай бұрын
😂😂😂
@zinter716
@zinter716 4 ай бұрын
This tutorial is worth moneyy
@tomisloading
@tomisloading 4 ай бұрын
Thank you!! Took a while longer than most of my videos, hoping people find it more useful 😂
@Muhammed-nani964
@Muhammed-nani964 4 ай бұрын
Noice bro keep it up
@DanteMishima
@DanteMishima 2 ай бұрын
No shadcn - Here take your like
@Dom-zy1qy
@Dom-zy1qy 4 ай бұрын
For things like this, it might be better to use react context to provide the methods for setting cards and reading cards associated with each column. It does couple your components to context though, but I'd imagine its a lot more efficient. If you store a hashmap in the context, using column IDs as keys, and storing the associated cards in an array, you'd be able to instantly look up all card associated with that column. Instead of doing linear search on all cards for every column. That method would require a bit of boilerplate and probably not the best content, maybe even overkill for a non performance intensive app like a todolist.
@iukys3889
@iukys3889 4 ай бұрын
I agree, react context feels better here
@sumonchandra5992
@sumonchandra5992 4 ай бұрын
OMG!!!!! That's amazing 🤩
@tomisloading
@tomisloading 4 ай бұрын
Thank you!! 😁
@estebanmutis2386
@estebanmutis2386 4 ай бұрын
Thank u!!
@tomisloading
@tomisloading 4 ай бұрын
Happy to help!
@duoctran9069
@duoctran9069 4 ай бұрын
I wish I had known about this sooner
@Solo_playz
@Solo_playz 4 ай бұрын
That is the next project in my queue and after that in my resume also you are just amazing bro what an easy tutorial you have created for such an advanced project(KANBAN BOARD) 🔥🔥 Also please let me know which VSCode theme you are using that looks very cool!
@tomisloading
@tomisloading 4 ай бұрын
Thank you!! Happy to help! :) and my theme is called Andromeda 😁
@Solo_playz
@Solo_playz 4 ай бұрын
@@tomisloading Thank you
@sahilverma_dev
@sahilverma_dev 4 ай бұрын
Great
@freakinmonkey85
@freakinmonkey85 4 ай бұрын
The result is solid but it gives me ticks that you instantiate variables descending order. E.g. when you start building the kanban and you have “Board” and “Column” AFTER the Kanban, but still use them inside. That should be illegal 😅
@tomisloading
@tomisloading 4 ай бұрын
LOL well I mean I’d generally have them in their own files, just easier to do it in one for a video 😂😂
@aghileslounis
@aghileslounis 4 ай бұрын
Your components are incredible I checked your website, and it's generous with a lot of free components! So talented! Design and being creative is my biggest issue as software engineer, like when I see a design or an animation I can replicate it without looking at the code most of the time (not all of them, you have some intriguing and difficult animations) but come up with the design or animation it's nearly impossible I find that task so difficult 😅
@tomisloading
@tomisloading 4 ай бұрын
Thank you for the kind words!! 🙂
@yassinesafraoui
@yassinesafraoui 4 ай бұрын
It would be really helpful if you make another video about improving the accessibility of this, or at least show how migrating it to something like shadcn would improve accessibility I suppose
@user-qf5be9km6o
@user-qf5be9km6o 4 ай бұрын
would be awesome if nesting was covered too.
@DavidConnerCodeaholic
@DavidConnerCodeaholic 4 ай бұрын
Your code is readable and I can follow the video very well. I haven’t done much with React, but all those functions returning JSX returning functions make me a bit nervous … about React. Does code like this GC alright? Typescript’s type system would help React out quite a bit.
@tomisloading
@tomisloading 4 ай бұрын
One thing I’ll note is that I would generally never have all of these functions in the same file, it’s just easier to follow (and record) in a video. TypeScript ABSOLUTELY helps, I never work without it, but I recognize some haven’t learned it yet so I generally make videos without it just so it’s easier for beginners to follow
@vaibhavchauhan3741
@vaibhavchauhan3741 4 ай бұрын
css is not loading so what should i do,also i have npm install react framer-motion react-icons in my react app please help!!
@godofwar8262
@godofwar8262 4 ай бұрын
Bro please make a video on your website how you create it and can we create it using on react
@beodan9219
@beodan9219 4 ай бұрын
wow
@megamind452
@megamind452 4 ай бұрын
Would this also work on touch devices? As far I know you can't pass data using dataTransfer on touch devices. Please let me know if it is possible. Nice vid 👍
@tomisloading
@tomisloading 4 ай бұрын
Yes, it should work the same! Possible there’s edge cases I’m unaware of but I can say that the demo in this video works as expected :)
@megamind452
@megamind452 4 ай бұрын
@@tomisloading it's not working, I tried on your website using my phone. Is there any way to make it work.would really appreciate that.
@tomisloading
@tomisloading 4 ай бұрын
@@megamind452 Hmm, try adding onTouch events as well as the onDrag events (named similarly, so onTouchStart etc). I was under the impression you didn't need to do this, but Googling around a bit, looks like that could be an issue for some devices. If not, I'd try googling for issues with whatever browser you're using. caniuse shows support for pretty much every modern browser outside of firefox for android heh.
@guptaashwanee
@guptaashwanee 4 ай бұрын
It is a nice and clear tutorial, could you please help me to create a nesting drag and drop, where items may have sub items and subitems can be drag and drop inside an item along with it's parent
@CowMeCow
@CowMeCow Ай бұрын
is there ways to impliment your components in WordPress?
@redcastle1745
@redcastle1745 3 ай бұрын
Why didn't you use framer motion reorder?
@tomisloading
@tomisloading 3 ай бұрын
I find it to be a bit buggy
@redcastle1745
@redcastle1745 3 ай бұрын
@@tomisloading thank you for reply, I always learn from your work
@Cypekeh
@Cypekeh 3 ай бұрын
2:33, how can you accept ${headingColor} prop as a Tailwind class? Shouldn't tailwind classes be typed out explicitly for them to properly compile?
@tomisloading
@tomisloading 3 ай бұрын
They’re typed out explicitly higher up in the file, you are correct in a sense though, if you tried to do something like ‘text-${color}-500’ it would not work
@Cypekeh
@Cypekeh 3 ай бұрын
@@tomisloading Thanks for a quick reply
@SanthoshKumar-dev
@SanthoshKumar-dev 4 ай бұрын
Any tutorials on Gsap ?
@tomisloading
@tomisloading 4 ай бұрын
Haven’t done any yet, but definitely will in the future!
@PrinceKumarDhankhar-oc1gf
@PrinceKumarDhankhar-oc1gf 23 күн бұрын
There is one bug. How to reproduce? 1. Add a new card. 2. Again Add a new card without typing anything. It will take title from older state. As you forgot to clear the state on submit.
@tomisloading
@tomisloading 23 күн бұрын
Good callout!
@ndivij
@ndivij 4 ай бұрын
This is not working well for phone devices its going out of the page 😊 do have a look at it thanks for the tutorial
@xczm225
@xczm225 4 ай бұрын
im so far from it, even tho coding for two years...
@ifindev
@ifindev 4 ай бұрын
Awesome!!!
Staggered Text Animations with React and Framer Motion
11:59
Tom Is Loading
Рет қаралды 8 М.
8 TailwindCSS Classes I Wish I Found Earlier
4:48
Tom Is Loading
Рет қаралды 70 М.
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 222 М.
FOOTBALL WITH PLAY BUTTONS ▶️❤️ #roadto100million
00:20
Celine Dept
Рет қаралды 35 МЛН
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 35 МЛН
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 2,8 МЛН
React Drag and Drop List Sort Tutorial
9:54
Darwin Tech
Рет қаралды 15 М.
This React Drag and Drop Component Is Magic
9:56
developedbyed
Рет қаралды 77 М.
react-beautiful-dnd: where to from here?
5:00
Alex Reardon
Рет қаралды 6 М.
React Drag And Drop (dnd-kit) | Beginners Tutorial
17:27
Code Complete
Рет қаралды 26 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 416 М.
Master JavaScript Drag and Drop with Chess Example!
28:44
Code with Ania Kubów
Рет қаралды 10 М.
How To Build A Drag & Drop Kanban Board With JavaScript
21:00
Tom Is Loading
Рет қаралды 32 М.
Complex Animations with Framer Motion & React || useAnimate Hook
13:48
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 7 МЛН
Lid hologram 3d
0:32
LEDG
Рет қаралды 6 МЛН
Какой ПК нужен для Escape From Tarkov?
0:48
CompShop Shorts
Рет қаралды 265 М.
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 1 МЛН