The Heroicons x mark icon depicts a stylized cross, commonly used to represent closing, dismissing, or canceling an action or element.
Common uses
- Close modal windows
- Dismiss notifications
- Cancel form submissions
Use it in React
Install
npm i @heroicons/reactImport & render
import { XMarkIcon } from '@heroicons/react/24/outline';
<XMarkIcon className="size-6" />Styles
Heroicons ships this icon in 4 styles — each its own import:
24/outline
<XMarkIcon className="size-6" />24/solid
<XMarkIcon className="size-6" />20/solid
<XMarkIcon className="size-6" />16/solid
<XMarkIcon className="size-6" />Details
- Library
- Heroicons (324 icons)
- License
- MIT
- viewBox
0 0 24 24- Keywords
- xmarkclosecanceldismisstimes
FAQ
- What is the x mark icon used for?
- It's used to indicate closing, dismissing, or canceling an action or element in a user interface.
- How do I use the x mark icon in React?
- Import it from Heroicons like this: import { XMarkIcon } from '@heroicons/react/24/outline'. Then use it as a React component: <XMarkIcon className="h-6 w-6" />.
- What is the license for Heroicons?
- Heroicons are released under the MIT license, allowing for free usage in both open-source and commercial projects.
Related icons
The same idea in other libraries, and near matches in Heroicons.
Looking for something else? Search Heroicons and 4 more libraries by description →
The search behind these pages runs as a Claude Code skill. What skills are and how I ship them →