How To Create Skeleton Loading Animation With CSS

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น • 213

  • @solvedfyi
    @solvedfyi 3 ปีที่แล้ว +6

    I'm just here to give props for when the topic is specific, straightforward, and not clickbait. We can't just comment on the negative

  • @Zeilar
    @Zeilar 3 ปีที่แล้ว +138

    This is precisely what I needed, was just about to make some of these tomorrow lol!

  • @krux02
    @krux02 3 ปีที่แล้ว +7

    The most important part to get your site fast is to bundle everything in a static page. Do not send an empty page to the end user with lots of javascrit that then starts to incrementally load one element at a time with many API requests. That is how you get to 90s internet performance.

  • @cleaningspy
    @cleaningspy 3 ปีที่แล้ว +4

    Thanks kyle. Before I have no idea about Skeleton!

  • @edwardyakovich2053
    @edwardyakovich2053 3 ปีที่แล้ว +12

    Cool tutorial, I dig it. I've been using something pretty similar for years, which has worked great. I use a "data-attibute" approach and the :empty CSS pseudo-class.
    So, on the parent DIV that you're loading stuff into, have a data-attr, examples such as: data-skeleton-load="full" or data-skeleton-load="table" or data-skeleton-load="card" or data-skeleton-load="form".
    Basically just keep the parent DIV empty until the data loads in, and while empty, the css loading animation will occur from one of your loading templates.
    Kinda same idea, just a little different.

  • @ayushniroula1781
    @ayushniroula1781 3 ปีที่แล้ว +31

    Exactly what I needed to know right now. Thank you you are awesome

  • @brijspy
    @brijspy 3 ปีที่แล้ว +16

    Wow!! haven't thought it was so simple. Thanks for this Kyle :)

  • @husseinkizz
    @husseinkizz 3 ปีที่แล้ว +1

    I wanted this kind of stuff from your channel a year ago, but now I have it. I have been doing it the hard way, thanks for simplfying the web!

  • @arneg4588
    @arneg4588 3 ปีที่แล้ว +5

    funny how this is the last thing to a big intranet dashboard page where sometimes its good to have something like a skeleton loading, perfect timing master web :D

  • @colinm3130
    @colinm3130 3 ปีที่แล้ว +1

    After watching this video I just implemented it on an app I am working on at work. I used some very different settings, but this video inspired me to give it a whirl. Because it's an internal tool and there is a very fast load time it wasn't totally needed, but I had a fun time trying it out. Thanks for this video!

  • @camc6864
    @camc6864 3 ปีที่แล้ว +11

    Your consistent new videos are so refreshing. I knew I made the right decision subscribing mate. Thank you Kyle ❤️

  • @pauljohn3898
    @pauljohn3898 3 ปีที่แล้ว

    This is absolutely great, I noticed youtube video has a loading animationa and wondered how it works and your video is recommended by TH-cam. So GREAT.

  • @lucienchu9649
    @lucienchu9649 2 ปีที่แล้ว

    I was eager to know how it does previously. Then the trick part is that, you better know how many contents (cards) you gonna populate, or simply fill the view port with cards, kind of brutal. Great content !

  • @blankdeepspace1488
    @blankdeepspace1488 3 ปีที่แล้ว +1

    Just thought about it yesterday and today it's here. Thanks Kyle 👍

  • @recoder1111
    @recoder1111 3 ปีที่แล้ว +148

    Isn't leaving the animation still on after the contents have loaded bad for the performance? I thought animation increases CPU usage.

    • @justpatrick_
      @justpatrick_ 3 ปีที่แล้ว +7

      I agree. Css animation use a lot of cpu

    • @Italiafani
      @Italiafani 3 ปีที่แล้ว +123

      @@OdyssME Emptying the grid only clears out the placeholder cards. There are no animations on the grid element itself. The skeleton text animations are not a problem, since he replaced the contents of the title and body of the card, clearing the animated placeholder divs. However, the image still has the animation going on after it's loaded. To disable this behaviour, you could do something like:
      const img = div.querySelector('img')
      img.addEventListener('load', () => {
      img.classList.remove('skeleton')
      }, { once: true })

    • @jamjam3448
      @jamjam3448 3 ปีที่แล้ว +4

      @@Italiafani excellent bro!

    • @OdyssME
      @OdyssME 3 ปีที่แล้ว

      @@Italiafani You're right, I have omitted the skeleton class left in the image.

    • @narudesigns
      @narudesigns 3 ปีที่แล้ว +6

      Exactly what I was thinking. Maybe we can toggle the class the classList method in javascript before and after the actual data has been loaded like
      element.classList.toggle("skeleton");

  • @TheDmNtd
    @TheDmNtd 3 ปีที่แล้ว +2

    Couldn't have come at a better time, I needed this at work! :D

  • @avivperets7360
    @avivperets7360 7 หลายเดือนก่อน

    As allways you coming right on time, exactly when i wonder how to implement it well haha,
    Thanks again man!

  • @teyjingwoon
    @teyjingwoon 3 ปีที่แล้ว +1

    Thanks the great content. I’m doing some page content loading this works better then loading bar

  • @quickwebtutorials4312
    @quickwebtutorials4312 3 ปีที่แล้ว

    I didn't even know how to search this thing. Thank you Kayle.

  • @PythonExploratorium
    @PythonExploratorium ปีที่แล้ว

    Love your video man!
    From Nigeria...

  • @lethe_yoon
    @lethe_yoon ปีที่แล้ว

    I exactly understood your video and implemented skeleton UIs myself. Thank you

  • @Jolterix20
    @Jolterix20 3 ปีที่แล้ว

    Okay I'm sure you're reading my mind. First with stripe and now this. Thanks so much man!!

  • @paulreyesdigital
    @paulreyesdigital 3 ปีที่แล้ว +3

    I was just thinking about this one, Thank you for this ❤

  • @bhattaraitheaxe
    @bhattaraitheaxe 3 ปีที่แล้ว

    Awesome 😎
    Love From Nepal 🇳🇵

  • @adnanahad
    @adnanahad 3 ปีที่แล้ว +1

    Wonderful
    Waiting for long time for the right video....

  • @darkmift
    @darkmift 3 ปีที่แล้ว +1

    Very nice and concise.
    Would love to see more css shorts like this.

  • @TecheremHizz
    @TecheremHizz 3 ปีที่แล้ว +2

    This is what I was searching for Thankx bro❤️

  • @braumski2
    @braumski2 ปีที่แล้ว

    I didn't know you could throttle the speed, that is awesome

  • @anticsBack
    @anticsBack 3 ปีที่แล้ว +5

    Awesome content as always, thank you Kyle!

  • @peter9759
    @peter9759 ปีที่แล้ว

    Easy Tutorial thanks really helped . Makes UX really better

  • @chetan3283
    @chetan3283 3 ปีที่แล้ว +5

    Looked so simple yet so effective! Thanks for sharing this.. keep doing these things!
    So much to learn on every topic :)

  • @NNNedlog
    @NNNedlog 3 ปีที่แล้ว +2

    Thanks a lot for this. I was legit thinking about learning how to implement this on my site

  • @questionable-cf1tt
    @questionable-cf1tt 3 ปีที่แล้ว +1

    Another great video, thanks man!

  • @Ayydos
    @Ayydos 3 ปีที่แล้ว +1

    amazing, thanks!

  • @95jugal
    @95jugal 3 ปีที่แล้ว +2

    That was a smooth implementation.

  • @iamreg1965
    @iamreg1965 3 ปีที่แล้ว

    Neat idea but I still like a splash screen. Diff'rent strokes and all that eh?
    Nice work Kyle, always look forward to new content from you man.

  • @the_full_stack_junkie
    @the_full_stack_junkie 3 ปีที่แล้ว +1

    You are great dud thanks!

  • @yusiff
    @yusiff 2 ปีที่แล้ว

    Thanks Kyle. But it killed me when you typed "Lorem1" 😂😂

  • @omrajeshkbangalore2092
    @omrajeshkbangalore2092 11 หลายเดือนก่อน

    I've been looking for it, Thank you so much

  • @Skalexsong
    @Skalexsong 3 ปีที่แล้ว +8

    Exactly what I need, very simple, understandable and so accurate. Thank you so much !

  • @jajcarzek
    @jajcarzek 3 ปีที่แล้ว

    Thanks for idea for loading screen for my frontend!

  • @juststudying1019
    @juststudying1019 2 ปีที่แล้ว

    It looks professional, thanks man

  • @youcefg9760
    @youcefg9760 3 ปีที่แล้ว +1

    Thanks a lot for this video!

  • @srinathsathyanath7435
    @srinathsathyanath7435 3 ปีที่แล้ว

    Kyle is on 🔥. Awesome job bro 👍👏

  • @cryptogap5559
    @cryptogap5559 3 ปีที่แล้ว +1

    Your videos are awesome! Thank you for doing these. I’ve watched so many of them.

  • @StarOnCheek
    @StarOnCheek 3 ปีที่แล้ว +3

    5:27 there is a problem, you are making the image transparent too

    • @preciousadeyinka2786
      @preciousadeyinka2786 3 ปีที่แล้ว

      Yeah I noticed, but good thing he said in his opinion, so it's personal preference matter I guess.

    • @contradictio
      @contradictio 3 ปีที่แล้ว

      You can add opacity property on the image

  • @prasannanaik1023
    @prasannanaik1023 3 ปีที่แล้ว +1

    Great content 👍

  • @keremardicli4013
    @keremardicli4013 3 ปีที่แล้ว

    So simple so nice. Well done

  • @T3hIluvatar
    @T3hIluvatar 3 ปีที่แล้ว

    These videos are incredibly helpful.

  • @developersharif
    @developersharif 3 ปีที่แล้ว +2

    *0 dislike u deserve it!* ♥♥

  • @kybkap8686
    @kybkap8686 2 ปีที่แล้ว

    nice its so easy to do lol. thank you
    also nice trick for dealing with data coming from the server by using cloneNode

  • @gopalloharnew5948
    @gopalloharnew5948 2 ปีที่แล้ว +1

    Great Man

  • @resolutionAgha
    @resolutionAgha 3 ปีที่แล้ว

    High quality information. Thank you so much

  • @peterativacationonline5203
    @peterativacationonline5203 3 ปีที่แล้ว +1

    "one of the best loading experiences a user can experience" - is a reminder of what we are really telling the user: you cannot yet interact with this site. I'm glad Kyle effectively acknowledges this upfront since I have "front end devs" who think they are adding some sort of functionality to the site by using this. Still, this is good info for when it is appropriate to use.

  • @ayedabboushi7221
    @ayedabboushi7221 3 ปีที่แล้ว

    Many Thanks, this was really helpful.

  • @xKond3i
    @xKond3i 3 ปีที่แล้ว +2

    As always - great tutorial. 😍
    Thank You so much, it might be useful in future projects.

  • @prabhakarmishra2182
    @prabhakarmishra2182 3 ปีที่แล้ว

    You explained it very well

  • @AdarshSingh-qd6mq
    @AdarshSingh-qd6mq 3 ปีที่แล้ว +1

    Eagerly waiting to see right approach about preloader / skeleton loader...

    • @Hafsa0526
      @Hafsa0526 2 ปีที่แล้ว

      Hey Adarsh. Are you looking out for opportunities in software development currently? Did you work on projects related to React/Node?

    • @AdarshSingh-qd6mq
      @AdarshSingh-qd6mq 2 ปีที่แล้ว

      @@Hafsa0526 Not intrested...

  • @alexkail3
    @alexkail3 3 ปีที่แล้ว +1

    Excellent video! Thanks for sharing this. Very handy. 👍🏼👍🏼

  • @vengeance9047
    @vengeance9047 3 ปีที่แล้ว +1

    This man is 🔥🔥🔥🔥🔥🔥🔥

  • @dmytrokravtsov5745
    @dmytrokravtsov5745 3 ปีที่แล้ว

    Looks great! Thank you very much.

  • @powerseostrategy
    @powerseostrategy 2 ปีที่แล้ว

    I like your Jackson. I have 5 of them!

  • @Tayyab-g9l
    @Tayyab-g9l 4 หลายเดือนก่อน

    bro that is amazing and i realy need that

  • @jamjam3448
    @jamjam3448 3 ปีที่แล้ว +1

    Thanks a lot!

  • @dheemanthm.d3836
    @dheemanthm.d3836 3 ปีที่แล้ว +1

    Thanks for this 👍❤️

  • @mohitkumar-vm6zl
    @mohitkumar-vm6zl 3 ปีที่แล้ว

    really amazing bro how we simply we can create a skeleton loading in just few minutes

  • @oldclient
    @oldclient 3 ปีที่แล้ว

    It's way better than those circle or linear loaders, because this will not flicker html containers when the real content will be rendered.

  • @aytacg26
    @aytacg26 ปีที่แล้ว

    Thank you very much, great explanation, I like it

  • @slowprogrammer
    @slowprogrammer 3 ปีที่แล้ว +1

    Good one

  • @tabdig
    @tabdig 3 ปีที่แล้ว +1

    Thanks mate 😄

  • @Arabian_Abomination
    @Arabian_Abomination 3 ปีที่แล้ว +2

    Thanks again

  • @riajmazumder4434
    @riajmazumder4434 3 ปีที่แล้ว

    I was thinking about how to do that from long time. Thank you 💓

  • @qwerty-wk4pz
    @qwerty-wk4pz 3 ปีที่แล้ว +1

    Thank you

  • @atishchandole
    @atishchandole 3 ปีที่แล้ว +1

    You are awesome, can you make a video on Lazy Loading with image?

  • @SharkBait_ZA
    @SharkBait_ZA 3 ปีที่แล้ว

    Awesome stuff, thank you Sir.

  • @daveglad3554
    @daveglad3554 3 ปีที่แล้ว

    TOP 👌🏽...dependent dropdown in react js 🙏

  • @Fooljuice
    @Fooljuice 3 ปีที่แล้ว

    Ay thanks. Very helpful

  • @7h476uy
    @7h476uy 3 ปีที่แล้ว +1

    Async UI FTW!!!

  • @insideTheDiv
    @insideTheDiv 3 ปีที่แล้ว

    Cool content bro ❤️❤️

  • @adrienguylagrange4453
    @adrienguylagrange4453 ปีที่แล้ว

    Thank you very much my friend, this is exactly what I was looking for. Very understandable and simple. You have just gained a new subscriber

  • @konstantinkirichenko9863
    @konstantinkirichenko9863 3 ปีที่แล้ว

    Cool vid. Thanks bro.

  • @_slier
    @_slier 2 ปีที่แล้ว +1

    thats a lot of boilerplate code just for the placeholder.. can you put the content of the boilerplate code in css itelsef? like using css *content* property?

    • @CodingAbroad
      @CodingAbroad 2 ปีที่แล้ว +1

      I’ve made a generator for this. No html needed

  • @toluwanimiadeyemo8099
    @toluwanimiadeyemo8099 3 ปีที่แล้ว +1

    great video, thanks. What if I am not using javascript to prepopulate the fields, the loader won't work

  • @AreebAmir
    @AreebAmir 3 ปีที่แล้ว +1

    Hello Sir! I am Areeb. I watched your video. Appreciate it because your videos help me to make different project. But I googled a lot about how to make web hosting machine or web server. Can you tell us more about web server.

  • @AlexandreTriche
    @AlexandreTriche 3 ปีที่แล้ว

    Material-UI v5 (to be released on September 1st) will include a skeleton component for all React Developers, with almost the same styles as Kyle's demo.

  • @Dev.prashant.k
    @Dev.prashant.k หลายเดือนก่อน

    Thanks Kyle

  • @NNNedlog
    @NNNedlog 3 ปีที่แล้ว +1

    Thanks a lot Kyle:)

  • @Dan-p7f
    @Dan-p7f 3 ปีที่แล้ว

    Thank you so much! Awesome content

  • @TheFirefox1948
    @TheFirefox1948 3 ปีที่แล้ว

    That is very slick!

  • @bosmertheincredible
    @bosmertheincredible 3 ปีที่แล้ว

    Ty. Good that I subbscribed on channel a while ago =)

  • @h.nazmulhassanrakib5058
    @h.nazmulhassanrakib5058 3 ปีที่แล้ว

    Awesome video .. thank you kyle..

  • @anandlimbu6633
    @anandlimbu6633 3 ปีที่แล้ว +2

    How can I add eventListener to all the elements and show different data when the elements are clicked?

    • @Dev_Abdulrehman
      @Dev_Abdulrehman 3 ปีที่แล้ว +2

      button 1
      button 2
      button 3
      let all_btn = document.querySelectorAll("button");
      all_btn.forEach(function(btn) {
      btn.addEventListener("click", function() {
      console.log(this.innerHTML + " is clicked")
      });
      });

    • @Hafsa0526
      @Hafsa0526 2 ปีที่แล้ว

      Hey Anand. I hope you have found a solution to your query. Are you looking out for job/internship opportunities in web development?

  • @zahid-n8p
    @zahid-n8p หลายเดือนก่อน

    Thanks, really helpful.
    Can you please explain, how did you hide the "Skeleton Text" and display "actual text"?

  • @AH-cf9cv
    @AH-cf9cv 3 ปีที่แล้ว +1

    👍👍👍 Thank u.

  • @bayuidhamfathurachman1276
    @bayuidhamfathurachman1276 3 ปีที่แล้ว

    I think you just read my mind!

  • @arunkumarmathivaanan5700
    @arunkumarmathivaanan5700 3 ปีที่แล้ว

    Thanks for sharing.

  • @truongpm2144
    @truongpm2144 3 ปีที่แล้ว

    Awesome, thanks you very much

  • @tariqmezeik
    @tariqmezeik 3 ปีที่แล้ว

    Amazing content thanks

  • @jhmesseroux
    @jhmesseroux 2 ปีที่แล้ว

    amazing content crack ✔✔🙌

  • @shaikshavalisyed2012
    @shaikshavalisyed2012 3 ปีที่แล้ว +1

    Excellent