Skip to content

List

Use stable, unique item IDs. Mutate the parent array to add, remove, or reorder. Leaving rows become inert immediately.

Preview

Open in the playground

Usage

ListExample.vueVue / TS
<script setup lang="ts">
import { ref } from 'vue'
import { FzList } from '@chrisdalbano/forza-ui'
const builds = ref([{ id: 1, name: 'Guardian' }])
</script>

<template>
  <FzList :items="builds" label="Builds">
    <template #default="{ item }">{{ item.name }}</template>
    <template #empty>No builds yet.</template>
  </FzList>
</template>
TypeScript exampleSource you can use.

Import the shared stylesheet once and wrap your app in .fz-theme. See installation.

Props

NameTypeRequiredDefault
itemsreadonly T[]YesNone
labelstringYesNone
motionDisabledboolean | undefinedNoNone
durationnumber | undefinedNoNone

Events and state

parent owns mutations

Slots

default({item,index}), empty

Add from source

sh
forza add list

Set up the CLI first. Generated API tables come from the Vue source, using Vue Language Tools.

Released under the MIT License. Independent work.