Etch component
Close 1
A small close button: an X with a little padding and a soft background on hover, in the color of the text around it.
Documentation
A small close button: an X with a little padding and a soft background on hover, in the color of the text around it. Lightbox 1 uses it.
How to use it
- Leave Text empty for the X alone, or fill it to show a word after the X, such as "Close" or "Done".
- It closes nothing by itself: the component around it does. In a drawer, set the drawer's Close Trigger Selector to
.mac-close-1.
Good to know
- Without Text, screen readers hear "Close", the component's hidden text: change it once per site, for example into Romanian. With Text, they hear the word.
- The CSS variables set its color, icon size, padding, corner radius, hover background and focus ring's color.
Reference
Read from the component's JSON, so it's always current.
Loading the reference