List component

The kit:list and kit:list-item components render structured vertical lists. Items are interactive automatically when onclick is attached or href is set.

list.svelte

kit:list is a layout container that sets size tokens consumed by its kit:list-item children. kit:list-item detects its tag automatically: it renders as <a> when href is set, <button> when an onclick is attached, or <div> otherwise.

Examples of list

Variants

Shows visual variants (filled, text, outline) to adapt the overall appearance of the list to graphic needs.

  • filled (default): solid background.

  • outline: visible border.

  • text : transparent background.

  • variant: 'filled' | 'outline' | 'text' = 'filled'

list.svelte

prepend and append

kit:list-item supports prepend and append snippets for icons, avatars, badges, or any inline content.

  • prepend: Snippet | undefined = undefined
  • append: Snippet | undefined = undefined
list.svelte

Add nav to kit:list (and is="nav") for a navigation list. This increases padding and sets role="navigation" on the container.

  • nav: boolean = false
list.svelte

Without preprocess Lapikit

If you aren’t using the Lapikit preprocessor in svelte.config.js, import the components directly:

API Reference

kit:list

propstypedescriptiondefault
isenum'div''nav''ul'HTML element to render.'div'
variantenum'filled''outline''text'Visual style.'filled'
sizeenum'xs''sm''md''lg''xl'Item height, padding, and font size tokens.'md'
densityenum'compact''default''comfortable'Vertical density offset applied to item height.'default'
roundedenum0'xs''sm''md''lg''xl'Border radius.'md'
navbooleanNavigation mode more padding, role="navigation".false
colorstringForeground color override (--kit-list-fg).
backgroundstringBackground color override (--kit-list-bg).
childrenSnippetList items.

kit:list-item

propstypedescriptiondefault
isenum'div''a''button''li'HTML element. Overridden by href or onclick.'div'
hrefstringRenders as <a>. Cleared when disabled.
activebooleanApplies the active background.false
disabledbooleanDims and blocks interaction.false
roundedenum0'xs''sm''md''lg''xl'Per-item border radius override.'sm'
noRipplebooleanDisables the ripple animation.false
colorstringForeground color override (--kit-list-item-fg).
backgroundstringBackground color override (--kit-list-item-bg).
prependSnippetContent before the label.
appendSnippetContent after the label.
childrenSnippetItem label.

A well-structured kit:list can easily be enriched with Separators or elements in a Card.