Tailwind CSS List Style Type

The list-style-type utility class in Tailwind CSS allows you to customize the appearance of list item markers (bullets or numbers) in unordered and ordered lists. With Tailwind's list-style-type class, you can easily change the style of list item markers to match your design requirements.

Applying List Style Type

To apply a specific list style type to a list, you can use the list-{value} utility class, where {value} represents the desired list style type. Here are some common list style types you can use:

  • list-disc: Sets the list item markers as filled discs (default for unordered lists).
  • list-circle: Sets the list item markers as hollow circles.
  • list-square: Sets the list item markers as squares.
  • list-decimal: Sets the list item markers as decimal numbers (default for ordered lists).
  • list-decimal-leading-zero: Sets the list item markers as decimal numbers with leading zeros.
html
<ul class="list-disc">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>

Preview

  • List item 1
  • List item 2
  • List item 3

Changing List Style Type

If you want to change the list style type for a specific list or override the default style, you can simply apply the desired list-{value} class. For example, to use decimal numbers as list item markers in an unordered list, you can use the list-decimal class.

html
<ul class="list-decimal">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>

Preview

  • List item 1
  • List item 2
  • List item 3

Responsive List Style Type

Tailwind CSS allows you to apply list style type classes responsively at different breakpoints. To use responsive list style type classes, you can append the breakpoint prefix to the utility class. For example, md:list-circle sets the list item markers as hollow circles starting from the medium breakpoint and above.

html
<ul class="list-disc md:list-circle">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>

In the above example, the list item markers are set as filled discs by default (list-disc), but starting from the medium breakpoint and above, they change to hollow circles (md:list-circle).

Tailwind List Style type Class Table

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

Windframe Tailwind blocks

blog

Build modern projects using Bootstrap 5 and Contrast

Trying to create components and pages for a web app or website from scratch while maintaining a modern User interface can be very tedious. This is why we created Contrast, to help drastically reduce the amount of time we spend doing that. so we can focus on building some other aspects of the project.

Contrast Bootstrap PRO consists of a Premium UI Kit Library featuring over 10000+ component variants. Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.

ad-banner