Dados e tabelas

VTimeline

Componente5 exemplos5 propsA2UI · Timeline

Linha do tempo vertical. `steps` mostra o andamento de um processo (concluído, atual, próximo, erro); `feed` é um log de atividade agrupado por período. Slots: `marker`, `title`, `description`, `extra` (recebem `item`).

Importação
<script setup lang="ts">
import { VTimeline } from 'vueui-nova-kit'
</script>

Uso

Exemplo
<VTimeline :items="steps" />
<VTimeline variant="feed" :items="activity" />

Playground

Os controles abaixo são gerados a partir das props declaradas em VTimeline.types.ts; o código acompanha cada mudança.

Exemplos

Variantes, tamanhos e estados, extraídos das stories da biblioteca.

Default

Variação Etapas (Claim timeline).

Ver código
vue
<script setup lang="ts">
import { VTimeline } from 'vueui-nova-kit'

const items = [
  {
    id: 1,
    title: 'Compressor replaced',
    description: 'Job #4821 · 4.5 h labor · R-410A recharged.',
    time: 'Sep 18',
  },
  {
    id: 2,
    title: 'Claim prepared',
    description: 'Warranty matched, 9 of 10 evidence items, priced to the Carrier labor guide.',
    time: 'Sep 21',
  },
  {
    id: 3,
    title: 'Submitted to Carrier',
    description: 'Confirmation CW-7730418, filed as Copperline Home Services.',
    time: 'Today, 9:14 AM',
  },
  {
    id: 4,
    title: 'Carrier review',
    description: 'Clawback checks the Carrier portal every morning.',
    time: 'By Oct 13',
    state: 'current',
  },
  {
    id: 5,
    title: 'Payment',
    description: 'Credit memo, usually 6 days after approval.',
    time: 'About Oct 19',
    state: 'upcoming',
    icon: {
      width: 24,
      height: 24,
      body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9H12M8 13H16M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V20L16 22L12 20L8 22L4 20V5Z"/>',
    },
  },
]
</script>

<template>
  <VTimeline :items="items" aria-label="Claim timeline" />
</template>

Activity Feed

Variação Feed agrupado (Today / Earlier).

Ver código
vue
<script setup lang="ts">
import { VTimeline } from 'vueui-nova-kit'

const items = [
  {
    id: 1,
    group: 'Today',
    title: 'You completed Launch readiness checklist',
    time: '4h ago',
    avatar: { initials: 'AM' },
  },
  {
    id: 2,
    group: 'Today',
    title: 'Lena Fischer commented on Launch readiness checklist',
    time: '7h ago',
    avatar: { initials: 'LF' },
  },
  {
    id: 3,
    group: 'Earlier',
    title: 'You created project Product Launch',
    time: 'Sep 2',
    avatar: { initials: 'AM' },
  },
]
</script>

<template>
  <VTimeline :items="items" variant="feed" aria-label="Activity" />
</template>

With Error

Variação Com erro em uma etapa.

Ver código
vue
<script setup lang="ts">
import { VTimeline } from 'vueui-nova-kit'

const items = [
  { id: 1, title: 'Claim prepared', time: 'Sep 21' },
  { id: 2, title: 'Submitted to Carrier', time: 'Sep 22' },
  {
    id: 3,
    title: 'Denied — missing failure photo',
    description: 'Add the photo and resubmit within 7 days.',
    time: 'Sep 30',
    state: 'error',
  },
]
</script>

<template>
  <VTimeline :items="items" aria-label="Claim timeline" />
</template>

With Extra Slot

Variação Slot extra: ação inline na etapa atual.

Ver código
vue
<script setup lang="ts">
import { VTimeline, VButton } from 'vueui-nova-kit'

const args = {
  items: [
    {
      id: 1,
      title: 'Compressor replaced',
      description: 'Job #4821 · 4.5 h labor · R-410A recharged.',
      time: 'Sep 18'
    },
    {
      id: 2,
      title: 'Claim prepared',
      description: 'Warranty matched, 9 of 10 evidence items, priced to the Carrier labor guide.',
      time: 'Sep 21'
    },
    {
      id: 3,
      title: 'Submitted to Carrier',
      description: 'Confirmation CW-7730418, filed as Copperline Home Services.',
      time: 'Today, 9:14 AM'
    },
    {
      id: 4,
      title: 'Carrier review',
      description: 'Clawback checks the Carrier portal every morning.',
      time: 'By Oct 13',
      state: 'current'
    },
    {
      id: 5,
      title: 'Payment',
      description: 'Credit memo, usually 6 days after approval.',
      time: 'About Oct 19',
      state: 'upcoming',
      icon: {
        width: 24,
        height: 24,
        body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M8 9H12M8 13H16M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V20L16 22L12 20L8 22L4 20V5Z\'/>'
      }
    }
  ],
  variant: 'steps',
  size: 'md',
  ariaLabel: 'Claim timeline'
}
</script>

<template>
  <VTimeline v-bind="args">
        <template #extra="{ item }">
          <div v-if="item.state === 'current'" style="margin-top:8px"><VButton size="sm" variant="secondary">View in Carrier portal</VButton></div>
        </template>
      </VTimeline>
</template>

Small

Variação Compacta. Props: size="sm".

Ver código
vue
<script setup lang="ts">
import { VTimeline } from 'vueui-nova-kit'

const items = [
  {
    id: 1,
    title: 'Compressor replaced',
    description: 'Job #4821 · 4.5 h labor · R-410A recharged.',
    time: 'Sep 18',
  },
  {
    id: 2,
    title: 'Claim prepared',
    description: 'Warranty matched, 9 of 10 evidence items, priced to the Carrier labor guide.',
    time: 'Sep 21',
  },
  {
    id: 3,
    title: 'Submitted to Carrier',
    description: 'Confirmation CW-7730418, filed as Copperline Home Services.',
    time: 'Today, 9:14 AM',
  },
  {
    id: 4,
    title: 'Carrier review',
    description: 'Clawback checks the Carrier portal every morning.',
    time: 'By Oct 13',
    state: 'current',
  },
  {
    id: 5,
    title: 'Payment',
    description: 'Credit memo, usually 6 days after approval.',
    time: 'About Oct 19',
    state: 'upcoming',
    icon: {
      width: 24,
      height: 24,
      body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9H12M8 13H16M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V20L16 22L12 20L8 22L4 20V5Z"/>',
    },
  },
]
</script>

<template>
  <VTimeline :items="items" size="sm" aria-label="Claim timeline" />
</template>

Props

PropTipoDefaultDescrição
itemsVTimelineItem[]——
variantVTimelineVariant"steps"—
sizeVTimelineSize"md"—
ariaLabelstring——
dataTestIdstring——

Events

Não emite eventos.

Slots

SlotProps do slot
#markeritem
#titleitem
#descriptionitem
#extraitem

Fonte: src/components/data/VTimeline/VTimeline.vue · tipos: src/components/data/VTimeline/VTimeline.types.ts