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