Typography
List Style Image
Utilities for controlling the marker images for list items.
Quick reference
Class | Properties |
---|---|
list-image-none | list-style-image: none; |
Basic usage
Setting the list style image
Control the marker image for list items using the list-image-{value}
utilities.
Out of the box, list-image-none
is the only available preconfigured list style image utility. And while you can add additional utilities by customizing your theme, you can also use the square bracket notation to generate an arbitrary value on the fly.
<ul class="list-image-[url(checkmark.png)] ...">
<li>5 cups chopped Porcini mushrooms</li>
<!-- ... -->
</ul>
Applying conditionally
Hover, focus, and other states
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:list-image-[url(checkmark.png)]
to only apply the list-image-[url(checkmark.png)]
utility on hover.
<ul class="list-image-none hover:list-image-[url(checkmark.png)]">
<!-- ... -->
</ul>
For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.
Breakpoints and media queries
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:list-image-[url(checkmark.png)]
to apply the list-image-[url(checkmark.png)]
utility at only medium screen sizes and above.
<ul class="list-image-none md:list-image-[url(checkmark.png)]">
<!-- ... -->
</ul>
To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.
Using custom values
Customizing your theme
By default, Tailwind only provides the list-image-none
utility. You can customize these values by editing theme.listStyleImage
or theme.extend.listStyleImage
in your tailwind.config.js
file.
tailwind.config.js
module.exports = {
theme: {
extend: {
listStyleImage: {
checkmark: 'url("/img/checkmark.png")',
},
}
}
}
Learn more about customizing the default theme in the theme customization documentation.
Arbitrary values
If you need to use a one-off list-image
value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.
<ul class="list-image-[url(checkmark.png)]">
<!-- ... -->
</ul>
Learn more about arbitrary value support in the arbitrary values documentation.