Тёмный

React & Material UI #19: Tabs + Tabs with React Router 

Anthony Sistilli
Подписаться 83 тыс.
Просмотров 59 тыс.
50% 1

In this video we go over:
- The Material UI Tabs and Tab component documentation and props
- How the Tab Panel in Material ui examples work
- How Tabs work with Tabs
- How Appbar works with Tabs
- An example of Tabs with an About and Contact page
- Setting up react router redirects to make a default url on /home
- Setting up React Router with Material UI Tabs
Code sandbox link: codesandbox.io...
The Forge Coding Tutorials...theforge.ca
Follow me on Social Media:
/ asistilli
/ anthonysistilli
/ asistilli

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 130   
@v0nnyboy
@v0nnyboy 4 года назад
I don't know if you're aware ... but your youtube channel is mentioned on the official Material UI page in the Getting Started ( Free Videos) section. They too realize that the quality here is top-notch! Keep up the good work !!! and yeah, Liked and Subscribed ages ago.
@AnthonySistilli
@AnthonySistilli 4 года назад
I actually found out just recently! I thought it was super cool haha. And thank you for the kind words!!! 🙏
@giordifungula1521
@giordifungula1521 4 года назад
@@AnthonySistilli Anthony, I am glad you are getting the recognition you deserve bro!
@sadhucat4476
@sadhucat4476 4 года назад
Man, Material UI has so many complexities I didn't anticipate. Thanks for the down to earth explanations Anthony!
@capino28
@capino28 Год назад
omg!! I've been much time tryng to do that and you suddenly give a simple way to do it. God bless you bro. and grettings from colombia 🙌
@adityasethi9794
@adityasethi9794 4 года назад
You are too good man. People like you make front-end seem easy.
@the.quirky.kid1.0
@the.quirky.kid1.0 3 года назад
After watching tons of video on material UI this is the best...it helped me a lot..thank you, Anthony...Keep making videos
@mcborov_
@mcborov_ 4 года назад
Clear and nice narrative. A lot of youtubers talk as if they just gotten up from bed
@thingsyounevertriedbefore9825
@thingsyounevertriedbefore9825 3 года назад
Mannnnn i have spent 15 hours searching for this I finally found it Thanks soooo much i love u man
@akofi
@akofi 4 года назад
I have recently started my front end journey and this has been very informative. I like how you break things down to the actual components and then build up from there.
@thesuperiorman8342
@thesuperiorman8342 4 года назад
I can't thank you enough. I'm trying to make a portfolio website to showcase my personal projects and your video tutorials have been very helpful.
@AnthonySistilli
@AnthonySistilli 4 года назад
That is an awesome project! I love looking at portfolio sites - all the best with it!
@Maverick_prbt
@Maverick_prbt 4 года назад
this helped me a lot as I could not find any other detailed/updated resource around this topic ! Thank you good sir :D
@chandnikat
@chandnikat 3 года назад
Great video. Thank you for explaining!
@mandihaase2744
@mandihaase2744 3 года назад
Amazing introduction to Tabs!! Your videos are SO helpful when using Material UI!!
@juancastillo-xc1do
@juancastillo-xc1do 2 года назад
awesome, exactly what i was looking for! lots of thanks
@randalleikelboom2099
@randalleikelboom2099 2 года назад
great video. Thanks Anthony!
@leamon9024
@leamon9024 4 года назад
Thank you Anthony for all the hard work.
@AnthonySistilli
@AnthonySistilli 4 года назад
No worries! I really appreciate the kind words Leamon
@rahulramesh2480
@rahulramesh2480 4 года назад
Thanks for this Anthony. This is by far the most concise MUI Tab tutorial I have seen. I've subscribed, looking forward to your future content :)
@BiniamAsnake
@BiniamAsnake 4 года назад
I learned a lot, as usual. Thanks a bunch. Topic recommendation - Table pagination and sorting.
@AnthonySistilli
@AnthonySistilli 4 года назад
Thank you for your continued support, Biniam :) I will tackle table pagination & sorting in my next video for sure!
@user-qc3ri4qu3t
@user-qc3ri4qu3t 9 месяцев назад
Thank you bro, what you taught came in handy. Even in React Router v6 😅
@LilyZak24
@LilyZak24 4 года назад
Thank you Anthony! You helped to save a lot of time for me! Very useful tutorial!
@jjosephcox3018
@jjosephcox3018 4 года назад
I've been looking all over for a good tutorial on material-ui tabs. This was perfect! Thanks for making it!
@r0mankon
@r0mankon 4 года назад
I just liked the whole playlist and started watching!!!
@AnthonySistilli
@AnthonySistilli 4 года назад
Glad to hear that! haha thank you Roman!
@gyenabubakar
@gyenabubakar 4 года назад
I've been searching for a playlist like this. This is awesome. Thanks Anthony 🙏
@AnthonySistilli
@AnthonySistilli 4 года назад
You’re very welcome - I’m glad the playlist helped!
@vennilapugazhenthi4916
@vennilapugazhenthi4916 3 года назад
Good job explaining every aspect very clearly!
@khondokoralam7810
@khondokoralam7810 4 года назад
Thank you Anthony for your time and efforts, really loved the video. Hoping to see more in future
@AnthonySistilli
@AnthonySistilli 4 года назад
You definitely will! Thank you for your support/
@AquaticB
@AquaticB 4 года назад
Hey man, awesome content. Wanted to find out more about Mui, ended up watching whole series, and subscribing ofc. Clear and concise. Keep up with the good work. (Y)
@AnthonySistilli
@AnthonySistilli 4 года назад
Wow the whole series! Haha thank you!!
@SuperJAIMISH
@SuperJAIMISH 4 года назад
Such an amazing tutorial for a React beginner! Thanks a ton man!
@12sandy1994
@12sandy1994 4 года назад
Thank you for the tutorial!
@jankiel3284
@jankiel3284 4 года назад
Excellent tutorial series, mate, very helpful - if something is unclear for me in official docs (I am kinda new to React and Material UI), I am checking out the episode concerning unclear component or concept. I like your way of teaching, that it is neither just follow-along-but-dont-understand-theory series, nor just "dry" presentation of components, it is well explained. You definitely deserve to be linked in official Material UI docs in section "Learn" :-) Movie liked, channel subscrib'd!
@calvarygildongkids
@calvarygildongkids 2 года назад
very helpful!! Thank you sooooooo much!!
@aadityagadiyar2650
@aadityagadiyar2650 4 года назад
Keep up the good work mate! Love your videos
@RealEstate3D
@RealEstate3D 4 года назад
You should geht in Touch With Brad from Traversy Media. He kind of withdraws a little bit and maybe you have a chance to broadcast via his channel as guest speaker. I appreciate your work.
@giorgos-4515
@giorgos-4515 3 года назад
great video,would love to see you build something making use of material ui components in a complex application and know your recommended practices in React
@mahtabhossain362
@mahtabhossain362 4 года назад
Loved it! Your explanations are so lucid ❤
@AnthonySistilli
@AnthonySistilli 4 года назад
I really appreciate the kind words Sagor!
@yeico80
@yeico80 3 года назад
This is soooo what I needed. Thank you so much!
@samchrist5464
@samchrist5464 3 года назад
This is so sick...learnt so much on this!!!Thanks.please could you do something on select and how it could be used to change external data.Thanks ahead
@workpelb3653
@workpelb3653 2 года назад
godlike tutorial
@MadMunky6682
@MadMunky6682 3 года назад
Loving all these tutorials, been trying to get into MUI for awhile and its never made sense so these really help, one suggestion and I know you have done the Theming and Styles video but it would be good when you do video like these to just do a short this is how to theme/style these components.
@jemwelbeltranlibron2717
@jemwelbeltranlibron2717 3 года назад
update september 8 2021 : import AppBar from '@material-ui/core/AppBar'; import Tabs from '@material-ui/core/Tabs'; import Tab from '@material-ui/core/Tab';
@mostafarafid3593
@mostafarafid3593 3 года назад
commenting here bcz loved your content and want YT algorithm to boost your video...
@delcambrem
@delcambrem 2 года назад
Question, Why would you want the first button to be "About" and for the default behavior of "/" to take you to your "About" page, and not to your"Home" page? I have tried restructuring this a few different ways to suit my needs but I get errors no matter what i do. I want three buttons- the first of which is "Home," then "Button 2" then "Button 3." I'm only a student, however, I looked at your code and I can't for the life of me determine how "Home.jsx" is tied to your App component. Do .jsx files behave differently from .js files, or am I just missing something? Also, i'm on react-router-dom v6, and while I was mostly able to translate your demo at whichever earlier version into v6, I ran into some problems with the params part..
@nhathuynguyen716
@nhathuynguyen716 4 года назад
This is magic man ! Very dope series :D
@laszlonagy153
@laszlonagy153 4 года назад
Great as always. Thanks mate
@user-mj4rh2on3t
@user-mj4rh2on3t 6 месяцев назад
Please wich version of router-dom eas used for this example? Notice error imported Switch and other method from react-router-dom
@venkateshdigicita7165
@venkateshdigicita7165 4 года назад
Facing problem when user clicks on page 1(about) component data its should show page 2(contact) iam using usehistory but cant navigate pls help
@TSIXGaming
@TSIXGaming 3 года назад
can you code the tabs to close instead of open if they are clicked a second time for example: click tab 1 to open it click tab 1 again to close it
@TSIXGaming
@TSIXGaming 3 года назад
i need this feature especially for tabs on mobile
@aishwaryatonpe3190
@aishwaryatonpe3190 4 года назад
Hey Anthony, the hooks call that you use - const [selectedTab, setSelectedTab] = React.useState(indexToTab[page]); Now this is responsible for rendering the needed tab when we refresh the URL right? But hooks work only in functional components, I want to implement the same functionality in a class Component because my code demands so. Basically what happens right now is when I click on the Tabs I can view the pages however if I try to change the URL, it does not work. So, how can I fix that? I am stuck here for the past 3 days. Please help!
@mrgame6584
@mrgame6584 3 года назад
May Allah reward you ❤️️
@ishanjaiswal8825
@ishanjaiswal8825 4 года назад
Thank You so much it helped me a lot
@thomaslee9095
@thomaslee9095 4 года назад
Thanx Buddy
@smithdragon6477
@smithdragon6477 3 года назад
I have a tab with router like this ,but I have many components inside the tab ,for example at the about page I make two about detail component I want to click this component to /home/about/01 and click another about routes to /home/about/02 both item I want to keep the current about tabs how can I achieved this?
@raphaelguedj5671
@raphaelguedj5671 3 года назад
Could you suggest how to change the bottom border color (which is in red in your example) ? I can't find the right element to target to design it ! thanks
@gavin8535
@gavin8535 3 года назад
What if you have two AppBars with each one having their own tabs. How do we differentiate the index then?
@blanchenuit6709
@blanchenuit6709 3 года назад
wow, I fully understand!!
@giancarlozabaleta3518
@giancarlozabaleta3518 3 года назад
How do you make each tab have it's own scrollbar? If i have a long list on one page that i was scrolling, when i switch tabs, the scroll stays in the same place.
@pradonelson
@pradonelson 3 года назад
It would be nice to have a tutorial of a more common design, live left hand side menu with collapsible buttons and then the content on the right. All responsive of course! :)
@vuongqtvn
@vuongqtvn 2 года назад
nice tutorial
@artsiomkaliaha5578
@artsiomkaliaha5578 4 года назад
many thx for the video!!!
@thisnicknamelee1799
@thisnicknamelee1799 4 года назад
Pure awesome!!!
@kamranasif9279
@kamranasif9279 4 года назад
Hi Anthony you are doing amazing work, kindly make a video on state managment plzzz!!
@AnthonySistilli
@AnthonySistilli 4 года назад
Hey Kamran! I have made videos on React State + Redux :) Check it out in my react playlist
@padhminitp8209
@padhminitp8209 2 года назад
I have three tabs in my component, routing is working on tab click, but when I click browser back button the routing is not working. url is changing but the particular tab content is not displaying . pls suggest if any changes needed
@AnthonySistilli
@AnthonySistilli 2 года назад
That's weird! I recently had someone else say the same thing - was it on codesandbox? I was thinking it might have been an issue with it
@abhijittripathi4660
@abhijittripathi4660 3 года назад
The codesandbox shows blank, could you please add it to fix it.. Appreciate the content and explanation.
@beccaowens5765
@beccaowens5765 3 года назад
Thanks for that fix!
@adamwoolf9993
@adamwoolf9993 3 года назад
super nice. thanks. One question: why not use useParams/useHistory hook? (innocent question)
@ivan_off
@ivan_off 3 года назад
Thank you for this video, I’ve got a question though, regarding the URLs of tabs: in my project I have quite the same situation as described here but I need to get the ID of tab displayed in the url when clicking on it as well, so that it would look something like this: home/contact#phone or home/contact#email What else do I need to add to the code in the example so that the ID would get passed too?
@beataochowska5797
@beataochowska5797 4 года назад
Hi Anthony, great tutorial, but I've found a bug and I can't deal with it. In your example browser button back doesn't work. Url changes but the page doesn't rerender. Any ideas how to deal with it?
@thierryfavier3411
@thierryfavier3411 4 года назад
The problem is that selectedTab shouldn’t be a state because top history element should be the element deciding which tab is to be displayed. Correction consists in removing this state variable and adding following statement instead: const selectedTab = indexToTabName[page]. Also, replacing redirect element by avoids entering manually url ending part. Working code in my fork: codesandbox.io/s/zealous-feistel-lv4zk
@himanshudonadkar6551
@himanshudonadkar6551 3 года назад
@@thierryfavier3411 Thanks, this works.
@wesleyau
@wesleyau 2 года назад
@@thierryfavier3411 Thanks, This was really helpful!
@iamkiddilam
@iamkiddilam 4 года назад
Thanks! I was stuck for a bit finding my way around routing. Thought giving every routes in a single component like was bad practice lol
@ahmedtitan3598
@ahmedtitan3598 3 года назад
I found one issue. If the user clicked browser back button, Tab is not getting chenged
@asajnani
@asajnani 3 года назад
Great Video! Thank you. I think there is a small issue when you add the tab to the history and hit the back button the tab is not shown. Any idea how to fix?
@dolevdo
@dolevdo 3 года назад
how can i add some logic to my tabs i want to show a Login tab if the user is not logged in like that {user.login ? ( ) : ( )} but it doesnt like it inside a fragment and i cant think about a solution to this problem codesandbox.io/s/serene-rosalind-qstrl?file=/src/Home.jsx this is the example please help!
@pirozhok2097
@pirozhok2097 4 года назад
It was awesome) You saved my life)) Thanks)
@AnthonySistilli
@AnthonySistilli 4 года назад
Glad you liked it!!
@changemaker2909
@changemaker2909 4 года назад
very love it .And Thank you
@AnthonySistilli
@AnthonySistilli 4 года назад
I appreciate the kind words!
@srikanthg8006
@srikanthg8006 4 года назад
When i tried, AppBar with "position static" didn't took any margin or space at the beginning.
@mayankarya511
@mayankarya511 2 года назад
Hi Anthony, Your Content is very useful for me. I have one doubt that can we render more than one component with different url in specific tab. For Example If I go to About Tab and currently it is displaying component inside it with home/about Suppose I have and also which I need to show in About Tab but with separate urls like home/about1 and home/about2 respectively. Hope I'm able to explain my problem statement. Looking Forward for positive reply. Thanks !!
@archilkumar
@archilkumar 4 года назад
Hi, thanks for this video! You're amazing! I had a question. Can I achieve the same use case if I use the component to route between the paths instead of using history.push? Are both equivalent or is one better over the other?
@antsii
@antsii 3 года назад
Does it still work? I get Error: Invalid hook call
@HoangNguyen-pg9td
@HoangNguyen-pg9td 2 года назад
Thank you for the video. So if we're doing the routing in the home.jsx that means we don't have to do in the app.js like a regular React app?
@AnthonySistilli
@AnthonySistilli 2 года назад
You can do it in any place pretty much! As long as whatever you're routing to is nested within it :)
@romac9516
@romac9516 4 года назад
A very useful and instructive video, I like you how didn't assume I'm a genius with tons of background knowledge! Just subbed. I am still stuck on one thing however. Using your exact code, I have added a separate component containing links to invoke /about and /contact tabs but can't find out how to fire the handleTabChange function from this separate file.
@AnthonySistilli
@AnthonySistilli 4 года назад
Awesome, thank you! And you should be able to pass the function in as a prop to the component in the separate file!
@phylliskan1828
@phylliskan1828 4 года назад
i am not sure what happened, there's an error says "TypeError: Cannot destructure property 'params' of 'match' as it is undefined.", what is it that can be wrong?
@samchrist5464
@samchrist5464 3 года назад
@rupindamanalu8297
@rupindamanalu8297 4 года назад
Awesome...
@AnthonySistilli
@AnthonySistilli 4 года назад
😊 🙏
@rathanatheang3298
@rathanatheang3298 4 года назад
Thank you much
@AnthonySistilli
@AnthonySistilli 4 года назад
Glad it was of value :)
@vinniemac189
@vinniemac189 3 года назад
While you don't "have to" learn the a11y part, it's better to get used to doing it. Make it part of your default process, and maybe one day accessibility will be the default rather than something "inconvenient" or "low priority".
@1funk
@1funk 3 года назад
Hi and congratulations for this awesome course! I'm tryng to integrate tabs with a appbar following your example but there's some problem about links. Do you know some example that are structered with appbar and tabs? Is it possible to drive tabs beahaviour from link in a main navbar (including active point tabs selector)? Thanks, Regards.
@user-cn8uu9zq4r
@user-cn8uu9zq4r 4 года назад
how can you change the colour under the selected tab? i cant find any doc about that and the answers at SOF simply doesn't work... =(
@AnthonySistilli
@AnthonySistilli 4 года назад
It's the color prop for tabs - it's initally set to primary, you can set it to secondary as well. To get a color that's not primary or secondary, you can either use the classes CSS override, or change primary / secondary color in your theme!
@user-cn8uu9zq4r
@user-cn8uu9zq4r 4 года назад
@@AnthonySistilli thanks i overrided it by indicator css class at the end and it worked thanks! =)
@khairulbasar4798
@khairulbasar4798 4 года назад
First of all thanks a lot for your great Question and also thanks to sistilli for these great tutorial...
@giancarlozabaleta3518
@giancarlozabaleta3518 4 года назад
Great videos! I'm trying to implement this feature mixed with the pokedex/pokemon and i can't figure out how to pass history to the pokemon component for routing. It says that history is undefined. I used the tab method here. So if there was a pokedex tab and you click on a pokemon in that pokedex. How do you make the route for the individual pokemon? Thanks for all the help!!
@AnthonySistilli
@AnthonySistilli 4 года назад
That's a great idea! The pokemon page would be the same - it sounds like you want something like a Drawer on the right hand side that switches what's displayed in the middle (the Pokemon) - I just did an example in my most recent video for drawers if that is the case :)
@TheHenry0127
@TheHenry0127 3 года назад
love the part cat meowing🐱
@AnthonySistilli
@AnthonySistilli 3 года назад
hahaha
@mattmarkus4868
@mattmarkus4868 4 года назад
Nothing is showing up on the codesanbox. Is it supposed to?
@AnthonySistilli
@AnthonySistilli 4 года назад
Still works for me! Do you have a file selected? codesandbox.io/s/festive-moon-unrou?file=/src/Home.jsx
@huydo9054
@huydo9054 2 года назад
how can we make a Tab with Image ??
@vabhavi1
@vabhavi1 2 года назад
Can you make a video using Tabpanel also
@Vijaysharma-cg9tb
@Vijaysharma-cg9tb 4 года назад
Hi could you please provide an example of having a dropdown with multiple select and list the pokemons where we can select the multiple pokemons using checkbox on the dropdown and then it shows up on the component. I needed for my project and was having hard time doing that . Please help and also your videos are awesome.
@skyblaze6687
@skyblaze6687 4 года назад
how can we put tabs inside tab docs.google.com/document/d/1AJHAdKQJugm0iLjIAk7B2V4dPtyf8oFvg4lMpXSt_iI/edit?usp=sharing my issue i cant see inside tab anything but tab inside tab working properly only text remain hidden dont know why this issue is with children props is their any other way ?
@eseesela1
@eseesela1 4 года назад
MUI tabs are not that great right now. It has few bugs and not flexible enough. You can have tab scroll arrows for example, but no way to make clean use of it with variable number of tabs. Also it has width issues in some scenarios.
@alisayed_95
@alisayed_95 4 года назад
Great!!!!! please make for Drawers
@AnthonySistilli
@AnthonySistilli 4 года назад
Great idea! Will do that either next video or the one after :)
@andrewbistroff1199
@andrewbistroff1199 4 года назад
Hello thank you for great tutorials!!! I ask you to take the same detailed course on Ant-design,we really need it, thank you in advance.(don't forget about responsive design!)
@AnthonySistilli
@AnthonySistilli 4 года назад
I actually haven't used Ant-design yet! I'll take a look at it - thank you for the suggestion :)
@fuadabdullah1158
@fuadabdullah1158 3 года назад
What are you doing, I got headaches from the frequent back and forth on the page
@shishirarora8808
@shishirarora8808 2 года назад
You could have just use url for state, instead of doing this tab state syncing stuff
@juancastillo-xc1do
@juancastillo-xc1do 2 года назад
Is anyone else having routing issues after deploying it ?
@21agdmnm
@21agdmnm 4 года назад
this is why sometimes I hate using Material UI..
@ylioo
@ylioo 4 года назад
The examples in the Material UI docs are absolutely horrible for the most part, compared to the docs of any other component ui library for React or Angular. They make the simplest thing look a like a Google interview question about Graphs.
@dmytrodev4631
@dmytrodev4631 4 года назад
Thanks for your work!
Далее
React & Material UI #20: Table Pagination
14:35
Просмотров 52 тыс.
Introducing iPhone 16 | Apple
02:00
Просмотров 4,5 млн
Cute
00:16
Просмотров 3 млн
iPhone 16 для НИЩЕБРОДОВ!
00:51
Просмотров 610 тыс.
Material UI with React in 2023
19:57
Просмотров 30 тыс.
React & Material UI #28: MUI Forms + Formik
25:40
Просмотров 33 тыс.
React & Material UI #24: Snackbars + Snackbars & Redux
20:49
How I Write Clean Code in React
16:36
Просмотров 29 тыс.
Simple Frontend Pagination | React
19:13
Просмотров 479 тыс.
Introducing iPhone 16 | Apple
02:00
Просмотров 4,5 млн