Introduction
Active and focus states help users see which element they are clicking or typing on. This makes websites easier and safer to use.
When you want to show a button is being clicked.
When a user tabs through links or form fields using the keyboard.
To improve accessibility for people who rely on keyboard navigation.
To give visual feedback that an element is ready for interaction.
When designing interactive elements like buttons, links, or inputs.