MigsLab UIVue 3 component workshop

Components

Chip

A compact label, optionally removable. Used by TagInputComponent and FileUploadComponent.

import { ChipComponent } from '@/MigsLab/shared'

Colors

primarysecondarysuccessdanger
<ChipComponent label="primary" />
<ChipComponent label="secondary" color="secondary" />
<ChipComponent label="success" color="success" />
<ChipComponent label="danger" color="danger" />

Closable

VueTypeScriptVite
<ChipComponent
  v-for="chip in chips"
  :key="chip"
  :label="chip"
  color="secondary"
  closable
  @remove="Chip_Remove(chip)"
/>

API

Props

NameType Default Description
labelstring''Chip text (ignored when the default slot is used).
color'primary' | 'secondary' | 'success' | 'danger''primary'Color variant.
closablebooleanfalseShow a remove button.

Events

EventPayloadDescription
remove—The remove button was clicked.

Slots

NameDescription
defaultCustom chip content; falls back to label.