Typography

List Style Type

Utilities for controlling the bullet/number style of a list.

Quick reference

Class
Properties
list-nonelist-style-type: none;
list-disclist-style-type: disc;
list-decimallist-style-type: decimal;

Basic usage

Setting the list style type

To create bulleted or numeric lists, use the list-disc and list-decimal utilities.

List Style Type - 图1

  1. <ul class="list-disc">
  2. <li>Now this is a story all about how, my life got flipped-turned upside down</li>
  3. <!-- ... -->
  4. </ul>
  5. <ol class="list-decimal">
  6. <li>Now this is a story all about how, my life got flipped-turned upside down</li>
  7. <!-- ... -->
  8. </ol>
  9. <ul class="list-none">
  10. <li>Now this is a story all about how, my life got flipped-turned upside down</li>
  11. <!-- ... -->
  12. </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-disc to only apply the list-disc utility on hover.

  1. <ul class="list-none hover:list-disc">
  2. <!-- ... -->
  3. </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-disc to apply the list-disc utility at only medium screen sizes and above.

  1. <ul class="list-none md:list-disc">
  2. <!-- ... -->
  3. </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 provides three utilities for the most common list style types. You change, add, or remove these by editing the theme.listStyleType section of your Tailwind config.

tailwind.config.js

  1. module.exports = {
  2. theme: {
  3. listStyleType: {
  4. none: 'none',
  5. disc: 'disc',
  6. decimal: 'decimal',
  7. square: 'square',
  8. roman: 'upper-roman',
  9. }
  10. }
  11. }

Learn more about customizing the default theme in the theme customization documentation.

Arbitrary values

If you need to use a one-off list-style-type 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.

  1. <ul class="list-[upper-roman]">
  2. <!-- ... -->
  3. </ul>

Learn more about arbitrary value support in the arbitrary values documentation.