![]() |
VOOZH | about |
Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. It is a system that assists us to build consistent user experiences efficiently with enough flexibility. This systematic approach ensures that our styles are consistent and interoperable with each other. It features a highly composable spacing scale, customizable typography, and meaningful colors. It is highly reusable and flexible and is created with GitHubโs design system.
A button is an important component in any website which is used for generating events whenever the user clicks the button. Primer CSS provides us with various states of buttons. This functionality is known as the Button States in Primer CSS.
Primer CSS Button States Classes:
Syntax:
<button class="btn" type="button" aria-selected="true"> ... </button>
The above syntax is for a selected button. In order to create a disabled button replaced aria-selected="true" with aria-disabled="true".
Example 1: The following example demonstrates the use of the aria-selected="true" attribute in order to create a button having a selected state.
Output:
Example 2: The following example demonstrates the use of the aria-disabled="true" attribute in order to create a button having a disabled state.
Output:
Reference: https://primer.style/