{"id":366266,"date":"2022-06-10T07:26:06","date_gmt":"2022-06-10T14:26:06","guid":{"rendered":"https:\/\/css-tricks.com\/?p=366266"},"modified":"2023-08-27T17:43:52","modified_gmt":"2023-08-28T00:43:52","slug":"single-element-loaders-the-spinner","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/single-element-loaders-the-spinner\/","title":{"rendered":"Single Element Loaders: The Spinner"},"content":{"rendered":"\n

Making CSS-only loaders is one of my favorite tasks. It\u2019s always satisfying to look at those infinite animations. And, of course, there are lots<\/em> of techniques and approaches to make them \u2014 no need to look further than CodePen<\/a> to see just how many. In this article, though, we will see how to make a single element loader writing as little code as possible.<\/p>\n\n\n\n\n\n\n\n

I have made a collection of more than 500 single div loaders<\/a> and in this four-part series, I am going to share the tricks I used to create many of them. We will cover a huge number of examples, showing how small adjustments can lead to fun variations, and how little code we need to write to make it all happen!<\/p>\n\n\n\n

Single-Element Loaders series:<\/h4>\n\n\n
    \n
  1. Single Element Loaders: The Spinner \u2014 you are here<\/em><\/li>\n\n\n\n
  2. Single Element Loaders: The Dots<\/a><\/li>\n\n\n\n
  3. Single Element Loaders: The Bars<\/a><\/li>\n\n\n\n
  4. Single Element Loaders: Going 3D<\/a><\/li>\n<\/ol>\n<\/div><\/div>\n\n\n\n

    For this first article, we are going to create a one of the more common loader patterns: spinning bars:<\/p>\n\n\n\n