SVG Line Animation: The Ultimate Guide
Let's dive into the world of SVG line animation, guys! Ever wondered how to make those cool, hand-drawn-like animations on websites? Well, you're in the right place. We're going to break down everything you need to know, from the basics to some advanced techniques. Trust me, it's easier than it looks, and the results are seriously impressive. This guide will cover everything from setting up your SVG to writing the CSS or JavaScript that brings it to life. So, buckle up, and let's get animating!
Understanding SVG Basics for Animation
Before we jump into animating, let's cover some SVG basics for animation. First, SVG stands for Scalable Vector Graphics. This means it's a vector-based image format, perfect for web use because it stays sharp at any size. Now, when it comes to animation, understanding the structure of your SVG is key. Each element, whether it's a <line>
, <path>
, or <circle>
, can be manipulated using CSS or JavaScript. The most important attributes for line animation are stroke-dasharray
and stroke-dashoffset
. stroke-dasharray
defines the pattern of dashes and gaps in your line, while stroke-dashoffset
controls the starting point of that pattern. By animating these attributes, we can create the illusion of a line drawing itself. Understanding these basic building blocks is crucial for creating smooth and visually appealing SVG line animation. So, take your time to familiarize yourself with these concepts, and you'll be animating like a pro in no time!
Creating a Simple Animated Line with CSS
Okay, let's get our hands dirty and create a simple animated line with CSS. First, you'll need an SVG containing a <line>
element. You can create this in a vector graphics editor like Adobe Illustrator or Inkscape, or you can simply write the SVG code directly. Once you have your line, the magic happens with CSS. We'll use stroke-dasharray
to set the length of the dashes to be equal to the total length of the line, effectively making the line invisible. Then, we'll use stroke-dashoffset
to hide the line completely. By animating stroke-dashoffset
from the line's length to zero, we create the drawing animation. Here's a snippet to get you started:
.line {
stroke-dasharray: 1000; /* Adjust to your line's length */
stroke-dashoffset: 1000;
animation: draw 5s linear forwards;
}
@keyframes draw {
to {
stroke-dashoffset: 0;
}
}
Remember to adjust the stroke-dasharray
value to match the actual length of your line. This is crucial for the animation to work correctly. And that's it! With just a few lines of CSS, you can bring your SVG line animation to life. Feel free to tweak the animation duration and easing to get the perfect look and feel.
Advanced Techniques: Animating Complex SVG Paths
Ready to take things up a notch? Let's explore some advanced techniques for animating complex SVG paths. Instead of simple lines, we can animate intricate shapes and illustrations. The key here is working with the <path>
element, which allows you to define complex shapes using a series of commands. The same principles of stroke-dasharray
and stroke-dashoffset
apply, but calculating the path length can be a bit trickier. Luckily, JavaScript can help! You can use getTotalLength()
method to get the length of any path element. Once you have the length, you can apply the same CSS animation techniques we discussed earlier. For more complex animations, consider using CSS transitions to control the timing and easing of the animation. Experiment with different easing functions to create unique and engaging effects. With a little practice, you'll be able to animate even the most complex SVG paths with ease. Remember, the possibilities are endless, so don't be afraid to get creative and push the boundaries of what's possible with SVG line animation.
Animating SVG Line Color
Now, let's talk about animating the SVG line color. While animating stroke-dasharray
and stroke-dashoffset
creates the drawing effect, changing the line color can add another layer of visual interest. You can achieve this using CSS animations or transitions. For a simple color change, use the stroke
property in your CSS. Here's an example:
.line {
stroke: blue;
animation: colorChange 5s linear forwards;
}
@keyframes colorChange {
to {
stroke: red;
}
}
This will animate the line color from blue to red over 5 seconds. For more complex color animations, you can use multiple keyframes or even JavaScript to dynamically change the color based on user interaction or other factors. Experiment with different color combinations and animation timings to create visually stunning effects. Animating the SVG line color is a great way to add depth and dynamism to your animations.
Controlling Animation Speed and Timing
Controlling the animation speed and timing is crucial for creating polished and professional-looking animations. CSS provides several properties that allow you to fine-tune the animation's timing, including animation-duration
, animation-delay
, animation-timing-function
, and animation-iteration-count
. animation-duration
sets the length of time an animation takes to complete one cycle. animation-delay
specifies a delay before the animation starts. animation-timing-function
defines the easing function, which controls how the animation progresses over time. And animation-iteration-count
specifies how many times the animation should repeat. By combining these properties, you can create a wide range of animation effects, from slow and gradual transitions to fast and snappy movements. Experiment with different values to find the perfect timing for your SVG line animation. Remember, the goal is to create an animation that feels natural and engaging to the user.
Using JavaScript for Interactive SVG Animations
While CSS is great for simple animations, using JavaScript for interactive SVG animations opens up a whole new world of possibilities. With JavaScript, you can respond to user events, such as clicks and mouseovers, and dynamically update the SVG based on those interactions. For example, you could trigger an animation when the user hovers over an SVG element, or you could create a button that starts and stops the animation. JavaScript also allows you to create more complex animations that are difficult or impossible to achieve with CSS alone. For instance, you could use JavaScript to calculate the path length of an SVG element and dynamically update the stroke-dasharray
and stroke-dashoffset
properties. To get started with JavaScript SVG animation, you'll need to select the SVG element using document.querySelector()
or document.getElementById()
. Then, you can use the addEventListener()
method to listen for user events and the setAttribute()
method to update the SVG's attributes. With a little practice, you'll be able to create interactive and engaging SVG line animation that responds to user input.
SVG Line Animation with CSS Transitions
SVG line animation with CSS transitions offers a smoother, more controlled approach compared to keyframe animations, especially for simpler effects. Instead of defining multiple keyframes, transitions allow you to specify the starting and ending values of a property and let the browser handle the in-between steps. To use CSS transitions with SVG line animation, you'll need to define the transition
property on the SVG element. This property specifies which properties should be transitioned, how long the transition should take, and the easing function to use. For example, to transition the stroke-dashoffset
property over 2 seconds with a linear easing function, you would use the following CSS:
.line {
transition: stroke-dashoffset 2s linear;
}
Then, you can trigger the transition by changing the value of the stroke-dashoffset
property, either through CSS or JavaScript. CSS transitions are particularly useful for creating hover effects and other simple animations that respond to user interaction. They're also a great way to add subtle movement and visual interest to your SVG line animation without the complexity of keyframe animations.
Best Practices for Optimizing SVG Animations
To ensure your SVG animations run smoothly and efficiently, it's important to follow some best practices for optimizing them. First, keep your SVG code as clean and concise as possible. Remove any unnecessary attributes or elements, and use CSS classes to style your SVG elements instead of inline styles. This will make your code easier to read and maintain, and it will also reduce the file size of your SVG. Second, optimize your SVG paths. Use a vector graphics editor like Adobe Illustrator or Inkscape to simplify your paths and reduce the number of anchor points. This will improve the rendering performance of your SVG, especially on mobile devices. Third, use CSS transforms instead of directly manipulating the SVG's attributes. CSS transforms are hardware-accelerated, which means they're much faster and more efficient than JavaScript-based animations. Finally, test your animations on different devices and browsers to ensure they work correctly and perform well. By following these best practices, you can create SVG line animation that are both visually stunning and highly performant.
Common Mistakes to Avoid in SVG Line Animation
Even experienced developers can stumble when creating SVG line animations. Let's highlight common mistakes to avoid. One frequent error is not calculating the stroke-dasharray
correctly. It should match the exact length of the line or path. If it's off, your animation will either cut off prematurely or leave a gap at the end. Another mistake is neglecting to set the fill
attribute to 'none' if you only want to animate the stroke. Otherwise, you might see unexpected fill behavior during the animation. Furthermore, be mindful of browser compatibility, especially with older versions. Use prefixes where necessary, or consider using a library like GreenSock (GSAP) for cross-browser consistency. Lastly, overcomplicating your SVG structure can lead to performance issues. Keep your SVG code clean and efficient, and avoid unnecessary nesting or complex shapes if possible. By being aware of these potential pitfalls, you can create smoother, more reliable SVG line animations.
SVG Line Animation for Beginners
If you're just starting out, SVG line animation might seem daunting, but it's totally achievable for beginners! The key is to start with simple projects and gradually build your skills. Begin by creating basic shapes like lines, circles, and rectangles in a vector editor or directly in code. Then, experiment with the stroke-dasharray
and stroke-dashoffset
properties to create the drawing effect. Don't be afraid to copy and modify existing examples to get a feel for how things work. There are tons of free resources and tutorials online that can guide you through the process. Focus on understanding the fundamental concepts before moving on to more complex techniques. And most importantly, don't get discouraged if things don't work perfectly at first. Practice makes perfect, and with a little persistence, you'll be creating amazing SVG line animations in no time!
SVG Line Animation Examples and Inspiration
Looking for SVG line animation examples and inspiration? The web is full of them! Sites like CodePen, Dribbble, and Awwwards showcase tons of creative and innovative SVG animations. Browse through these sites to see what's possible and get ideas for your own projects. Pay attention to how different animators use timing, easing, and color to create unique effects. You can also find open-source SVG animation libraries and frameworks that provide pre-built animations and tools. These can be a great starting point for your own projects, and they can save you a lot of time and effort. Remember, the best way to learn is by doing, so don't be afraid to experiment with different techniques and styles. With a little inspiration and practice, you'll be creating your own stunning SVG line animation in no time!
SVG Line Animation Tools and Resources
Creating stunning SVG line animations requires the right tools and resources. Luckily, there are plenty of options available to help you along the way. For creating SVG graphics, popular choices include Adobe Illustrator, Inkscape (a free, open-source alternative), and Sketch. These tools allow you to design your shapes and paths visually, then export them as SVG code. For animating your SVGs, you can use CSS, JavaScript, or dedicated animation libraries like GreenSock (GSAP) and Anime.js. GSAP is a powerful and versatile library that provides a wide range of animation tools and effects. Anime.js is a lightweight and easy-to-use library that's perfect for simple animations. In addition to these tools, there are also many online resources available, such as tutorials, articles, and forums. These resources can help you learn the basics of SVG animation, troubleshoot problems, and find inspiration for your own projects. With the right tools and resources, you'll be creating amazing SVG line animation in no time!
Cross-Browser Compatibility for SVG Line Animation
Ensuring cross-browser compatibility for SVG line animation is crucial for delivering a consistent experience to all users. While SVG is widely supported by modern browsers, there can still be some differences in how animations are rendered. To address these issues, it's important to test your animations on different browsers and devices. Use browser developer tools to identify any rendering issues or performance problems. Consider using CSS prefixes for properties that are not fully supported by all browsers. For example, you might need to use -webkit-
prefixes for some CSS animations on older versions of Safari and Chrome. You can also use JavaScript libraries like Modernizr to detect browser features and apply different code based on the browser's capabilities. Another approach is to use a polyfill, which is a piece of code that provides missing functionality in older browsers. By taking these steps, you can ensure that your SVG line animation looks great and performs well on all major browsers.
Optimizing SVG Line Animation Performance
Optimizing SVG line animation performance is essential for creating smooth and responsive user experiences. Slow or jerky animations can be frustrating for users and can negatively impact your website's overall performance. To optimize your SVG animations, start by minimizing the complexity of your SVG code. Remove any unnecessary elements or attributes, and simplify your paths as much as possible. Use CSS transforms instead of directly manipulating the SVG's attributes. CSS transforms are hardware-accelerated, which means they're much faster and more efficient than JavaScript-based animations. Avoid using excessive keyframes in your CSS animations. The more keyframes you have, the more work the browser has to do to render the animation. Use the will-change
property to inform the browser that an element's properties will be changing, allowing it to optimize the animation in advance. Finally, test your animations on different devices and browsers to identify any performance bottlenecks. By following these tips, you can create SVG line animation that are both visually stunning and highly performant.
SVG Line Animation and Accessibility
When creating SVG line animation, it's important to consider accessibility. Animations can be visually appealing, but they can also be distracting or even harmful to users with certain disabilities. To make your animations accessible, start by providing a way for users to pause or stop the animation. This is especially important for users with vestibular disorders, who can experience dizziness or nausea from excessive movement. Use the prefers-reduced-motion
media query to detect whether the user has requested reduced motion in their operating system settings. If the user has requested reduced motion, disable or simplify your animations. Provide alternative text descriptions for your SVG elements so that users who are using screen readers can understand the content. Use ARIA attributes to provide additional information about the animation's purpose and behavior. By following these guidelines, you can create SVG line animation that are both visually appealing and accessible to all users.
SVG Line Animation for Data Visualization
SVG line animation can be a powerful tool for data visualization, allowing you to bring your data to life in an engaging and informative way. You can use line animations to create dynamic charts and graphs that respond to user interaction. For example, you could animate the lines in a line chart to show how data changes over time. You could also use line animations to highlight specific data points or trends. When using line animations for data visualization, it's important to keep the animations simple and clear. Avoid using excessive animation or complex effects that could distract from the data. Use color and timing to emphasize important information and guide the user's eye. Make sure your animations are accessible to all users, including those with disabilities. Provide alternative text descriptions for your SVG elements and use ARIA attributes to provide additional context. By following these guidelines, you can create SVG line animation that effectively communicate your data and engage your audience.
Advanced JavaScript Techniques for SVG Line Animation
For more intricate and dynamic SVG line animations, advanced JavaScript techniques come into play. One powerful technique is using requestAnimationFrame for smoother animations. Instead of relying on setInterval or setTimeout, requestAnimationFrame synchronizes your animation with the browser's refresh rate, resulting in a more fluid visual experience. Another technique involves using easing functions to control the animation's speed over time. Easing functions can create effects like acceleration, deceleration, and bouncing, adding a more natural feel to your animations. You can also use JavaScript to dynamically calculate the path length of your SVG elements and update the stroke-dasharray
and stroke-dashoffset
properties accordingly. This allows you to create animations that adapt to different screen sizes and orientations. Furthermore, consider using JavaScript frameworks like React or Vue.js to manage the complexity of your SVG animations. These frameworks provide tools for creating reusable components and managing state, making it easier to build and maintain complex animations. By mastering these advanced JavaScript techniques, you can create truly stunning and interactive SVG line animations.
Creating Interactive SVG Line Animation with User Input
Making your SVG line animation respond to user input can significantly enhance the user experience. By allowing users to interact with your animations, you can create more engaging and informative experiences. One common technique is to use JavaScript to listen for mouse events, such as clicks and hovers, and trigger animations in response. For example, you could animate a line when the user hovers over it, or you could create a button that starts and stops the animation. You can also use form inputs, such as sliders and text fields, to control the animation's parameters. For example, you could use a slider to adjust the animation's speed or a text field to change the line's color. When creating interactive SVG animations, it's important to provide clear visual cues to the user. Let them know what actions are possible and what to expect when they interact with the animation. Use tooltips, labels, and other visual aids to guide the user's interaction. Also, make sure your animations are accessible to all users, including those with disabilities. Provide alternative input methods for users who cannot use a mouse or keyboard. By following these guidelines, you can create SVG line animation that are both interactive and accessible.
SVG Line Animation and Scroll-Based Triggers
SVG line animation triggered by scroll-based events can create captivating and immersive web experiences. As the user scrolls down the page, the animation unfolds, revealing content and guiding the user's attention. To implement scroll-based animations, you'll need to use JavaScript to listen for the scroll event and calculate the user's scroll position. Then, you can use this information to control the animation's progress. One common technique is to use the scroll position to update the stroke-dashoffset
property of an SVG line, creating the illusion of the line drawing itself as the user scrolls. You can also use scroll-based triggers to animate other SVG properties, such as the line's color, width, or opacity. When creating scroll-based animations, it's important to optimize performance. Scroll events can fire very frequently, so it's crucial to avoid performing expensive operations in the scroll event handler. Use techniques like debouncing and throttling to limit the number of times the animation is updated. Also, test your animations on different devices and browsers to ensure they perform well. By following these best practices, you can create SVG line animation that are both visually stunning and performant.
Advanced CSS Animation Techniques for SVG Lines
Taking your SVG line animations to the next level often involves mastering advanced CSS animation techniques. One powerful technique is using CSS variables (custom properties) to control animation parameters. By defining variables for things like line color, width, and animation duration, you can easily update these values dynamically using JavaScript or CSS. This makes it easier to create reusable and customizable animations. Another advanced technique is using CSS filters to add visual effects to your SVG lines. For example, you can use the blur
filter to create a soft, glowing effect or the drop-shadow
filter to add depth and dimension. You can also use CSS blend modes to create interesting color interactions between your SVG lines and the background. Furthermore, consider using CSS transforms in combination with animations to create more complex and dynamic effects. For example, you can rotate, scale, or skew your SVG lines while they're animating. By experimenting with these advanced CSS animation techniques, you can create truly unique and visually stunning SVG line animations.
SVG Line Animation and Mobile Responsiveness
Ensuring SVG line animation is mobile responsive is critical for delivering a consistent user experience across all devices. SVG's inherent scalability makes it well-suited for mobile, but careful consideration is still needed to optimize animations for smaller screens. Start by using relative units, such as percentages and ems, for your SVG's dimensions and attributes. This will allow your SVG to scale automatically to fit different screen sizes. Use media queries to adjust the animation's parameters based on the screen size. For example, you might want to reduce the animation's duration or simplify the animation's effects on smaller screens. Optimize your SVG code for mobile by removing any unnecessary elements or attributes. Use CSS classes to style your SVG elements instead of inline styles. This will reduce the file size of your SVG and improve its rendering performance on mobile devices. Test your animations on different mobile devices and browsers to ensure they work correctly and perform well. By following these guidelines, you can create SVG line animation that are both visually appealing and mobile responsive.
Debugging and Troubleshooting SVG Line Animations
Even the most experienced developers encounter snags when working with SVG line animations. Debugging and troubleshooting are crucial skills. Start by inspecting your SVG code for errors. Use a code editor with SVG validation to catch syntax errors and invalid attributes. Use your browser's developer tools to examine the SVG element and its properties. Pay close attention to the stroke-dasharray
and stroke-dashoffset
values, as these are often the source of problems. Check for CSS conflicts that might be interfering with your animations. Use the browser's computed styles panel to see which CSS rules are being applied to your SVG element. If you're using JavaScript to control your animations, use the browser's debugger to step through your code and identify any errors. Use console.log statements to print out the values of variables and properties to help you understand what's happening. When debugging SVG animations, it's often helpful to simplify your code and isolate the problem. Remove any unnecessary elements or attributes and focus on the core animation logic. By following these debugging techniques, you can quickly identify and fix problems with your SVG line animations.
Future Trends in SVG Line Animation
The world of SVG line animation is constantly evolving, with new techniques and technologies emerging all the time. Staying up-to-date on future trends is essential for creating cutting-edge and engaging web experiences. One trend to watch is the increasing use of WebAssembly for creating high-performance SVG animations. WebAssembly allows you to run code written in languages like C++ and Rust in the browser at near-native speed. This can be especially useful for complex animations that require a lot of processing power. Another trend is the integration of SVG animations with virtual and augmented reality (VR/AR) experiences. SVG's scalability and flexibility make it well-suited for creating interactive and immersive VR/AR content. We can expect to see more sophisticated SVG animation tools and libraries emerge, making it easier for developers to create complex and dynamic animations. Finally, as accessibility becomes increasingly important, we can expect to see more focus on creating accessible SVG animations that are usable by everyone. By staying informed about these future trends, you can position yourself at the forefront of SVG line animation innovation.
SVG Line Animation in UI/UX Design
SVG line animation plays a significant role in modern UI/UX design. When used thoughtfully, it can enhance user engagement and improve the overall experience. Subtle animations can guide the user's eye, provide feedback on interactions, and create a sense of delight. For example, you can use line animations to highlight important elements on the page, to reveal content as the user scrolls, or to provide visual confirmation when a user clicks a button. However, it's important to use animations sparingly and purposefully. Excessive or distracting animations can be annoying and can detract from the user's experience. Make sure your animations are consistent with your brand's style and tone. Use animations to reinforce your brand's message and to create a cohesive visual experience. When designing SVG animations for UI/UX, always prioritize accessibility. Ensure that your animations are usable by people with disabilities. Provide alternative text descriptions for your SVG elements and use ARIA attributes to provide additional context. By following these guidelines, you can create SVG line animation that enhance your UI/UX design and improve the overall user experience.
Monetizing SVG Line Animation Skills
If you've mastered the art of SVG line animation, you might be wondering how to monetize your skills. There are several avenues you can explore. One option is to offer your services as a freelance SVG animator. Many businesses and organizations need custom SVG animations for their websites, apps, and marketing materials. You can find freelance opportunities on websites like Upwork, Fiverr, and Guru. Another option is to create and sell SVG animation templates and assets. You can sell your templates on marketplaces like Creative Market, Envato Elements, and UI8. You can also create and sell online courses and tutorials on SVG line animation. Share your knowledge and expertise with others and earn money while doing it. Platforms like Udemy and Skillshare make it easy to create and sell online courses. Consider creating and selling your own SVG animation library or framework. This can be a more ambitious project, but it can also be very lucrative. Finally, you can use your SVG animation skills to create your own products and services. For example, you could create an animated explainer video service or a custom SVG icon design service. By exploring these monetization options, you can turn your SVG line animation skills into a profitable business.
The Impact of SVG Line Animation on Website Loading Speed
While SVG line animation can greatly enhance a website's visual appeal, it's crucial to consider its impact on website loading speed. Overly complex or poorly optimized animations can significantly slow down your site, leading to a negative user experience. To mitigate this, start by optimizing your SVG code. Remove unnecessary elements, reduce the number of points in your paths, and use CSS classes for styling instead of inline styles. Compress your SVG files using tools like SVGO to reduce their file size. Use CSS animations instead of JavaScript animations whenever possible. CSS animations are typically more performant because they're handled by the browser's rendering engine. Avoid using excessively long or complex animations. Keep your animations short and sweet to minimize their impact on loading speed. Test your website's loading speed using tools like Google PageSpeed Insights and WebPageTest. These tools can help you identify any performance bottlenecks and provide recommendations for improvement. By following these optimization techniques, you can ensure that your SVG line animation don't negatively impact your website's loading speed and user experience.
How to Choose the Right SVG Animation Library
Selecting the right SVG animation library is crucial for efficient and effective development. Several excellent libraries are available, each with its strengths and weaknesses. How to choose the best one for your project? Consider GreenSock Animation Platform (GSAP) if you need powerful, versatile, and highly performant animations. GSAP is a professional-grade library with a wide range of features and plugins. Opt for Anime.js if you're looking for a lightweight, easy-to-use library with a simple API. Anime.js is great for creating simple to moderately complex animations. Consider Velocity.js if you need a fast and performant library with a jQuery-like syntax. Velocity.js is a good choice if you're already familiar with jQuery. Look into Mo.js if you want a library specifically designed for creating motion graphics on the web. Mo.js offers a unique set of features and tools for creating stunning visual effects. Evaluate the library's documentation, community support, and licensing terms before making a decision. By carefully considering your project's requirements and the features of different SVG animation libraries, you can choose the one that best meets your needs.
Combining SVG Line Animation with Other Animation Techniques
Combining SVG line animation with other animation techniques can lead to truly stunning and engaging visual experiences. Don't limit yourself to just line animations; explore how they can complement and enhance other animation styles. For example, you can combine SVG line animation with CSS transitions to create smooth and subtle effects. Use CSS transitions to animate properties like opacity, color, and position, while using SVG line animation to draw attention to specific elements. Consider integrating SVG line animation with JavaScript-based animations to create more complex and interactive effects. Use JavaScript to control the timing, sequencing, and triggering of your animations. Experiment with combining SVG line animation with 3D animations to create immersive and visually rich experiences. Use CSS transforms or WebGL to create 3D effects, and then use SVG line animation to add details and highlights. Explore the possibilities of combining SVG line animation with video animations to create dynamic and engaging content. Use video editing software to create short video clips, and then use SVG line animation to add graphics, text, and annotations. By creatively combining SVG line animation with other animation techniques, you can create truly unique and memorable visual experiences.
Accessibility Considerations for Animated SVGs
Accessibility considerations for animated SVGs are paramount to ensure inclusivity for all users. Animated SVGs, while visually appealing, can pose challenges for individuals with certain disabilities. To create accessible animated SVGs, provide controls to pause, stop, or hide animations. This is crucial for users with vestibular disorders or those sensitive to motion. Use the prefers-reduced-motion
media query to detect if the user has requested reduced motion in their system settings and adjust animations accordingly. Ensure animations don't flash rapidly, as this can trigger seizures in individuals with photosensitive epilepsy. Provide alternative text descriptions (alt
attribute) for SVG elements to convey their purpose to screen reader users. Use ARIA attributes to enhance the semantic meaning of SVG elements and provide additional information about their role in the animation. Test your animated SVGs with assistive technologies like screen readers to identify and address any accessibility issues. By prioritizing accessibility in your animated SVG designs, you can create inclusive and engaging experiences for all users.