List Item
Represents an <li> element.
Designed to place within a List slot.

Properties
Text. The text to display.
Nested List
Show Slot. Makes the hidden slot for nested lists visible and accessible.
Slot. Used for placing nested lists.
Variants
Consider slotted variant for semantic constructions.
Styling
For consideration.
Here’s what styling you can apply specifically to list items (<li>):
Text styling:
colorfont-sizefont-weightfont-familytext-transform(uppercase, lowercase, capitalize)text-decoration(underline, line-through, etc.)line-heightletter-spacingtext-align
Spacing and layout:
margin→ space outside the list itempadding→ space inside the list itemheight/min-height/max-heightwidth/min-width/max-widthdisplay→ block, inline, flex, grid, etc.gap→ spacing between children if flex/gridfloat/clear
Background and borders:
background-colorbackground-imageborderborder-radiusbox-shadow
Positioning:
position→ relative, absolute, etc.top,right,bottom,left
Custom markers (modern browsers):
::markerpseudo-element:colorfont-sizecontent(custom symbol or text)font-family
Example:
Interactivity:
cursorhover/focusstylesanimations / transitions
Everything that applies to a block element can generally be applied to <li>. They’re flexible containers for any HTML content (text, images, divs, etc.).
Last updated