Chip component

The kit:chip component displays small interactive labels, perfect for representing status, categories, filters or actions. Compact, stylable and highly flexible, it can be clicked, disabled, loaded, closed or enriched with snippets. It supports different variants, states, densities and sizes, to suit all UI contexts. It can be used alone, in groups, or as the basis for a tag or filter system.

chip.svelte

kit:chip renders as a <div> by default. It becomes interactive automatically when onclick is attached, href is set, or is="button". Unlike kit:btn, it has no rounded prop the pill shape is fixed.

Examples of chip

Variants

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

  • filled (default): solid background.

  • outline: visible border.

  • text : transparent background.

  • link: styled as a hyperlink, ideal for navigation or less prominent actions.

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

chip.svelte

size

With size, adjust the chip’s height and font size. From compact tags to larger status indicators, this prop allows you to create chips that fit perfectly into different contexts.

  • size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md'
chip.svelte

prepend and append snippets

Use prepend for an icon before the label, and append for an action typically a remove button.

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

States

disabled dims and blocks interaction. readonly blocks interaction without the dim. active applies the pressed background useful for toggled filter chips.

  • active: boolean = false
  • disabled: boolean = false
  • readonly: boolean = false
chip.svelte

labelStyle

labelStyle applies uppercase, bold, and slight letter-spacing suited for category or status badges.

  • labelStyle: labelStyle = false
chip.svelte

Without preprocess Lapikit

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

API Reference

kit:chip

propstypedescriptiondefault
isenum'div''a''button''input'HTML element. Overridden by href or event handlers.'div'
variantenum'filled''outline''text''link'Visual style.'filled'
sizeenum'xs''sm''md''lg''xl'Height and font size.'md'
densityenum'compact''default''comfortable'Padding and height multiplier.'default'
hrefstringRenders as <a>. Cleared when disabled or readonly.
activebooleanApplies the pressed background.false
disabledbooleanDims and blocks all interaction.false
readonlybooleanBlocks interaction without disabled styling.false
labelStylebooleanUppercase, bold, letter-spacing for badges and categories.false
loadingbooleanShows a spinner, hides content.
noRipplebooleanDisables the ripple animation on click.
prependSnippetContent before the label.
appendSnippetContent after the label.
loadSnippetCustom spinner content shown while loading.
childrenSnippetChip label.

kit:chip are often used in a Toolbar or as a complement in a Card to structure information and List.