Vue.js Live 2026 is the annual London conference for Vue.js and Nuxt practitioners. UUID v7 patterns — composables, Pinia integration, and Nuxt server-side generation — were central to the data management track. The community aligned on using UUID v7 for both server-generated and client-generated IDs, with the timestamp prefix enabling natural list ordering. See UUID in Vue and Nuxt for the full guide.

Event details

ConferenceVue.js Live 2026
DateMay 11–12, 2026
LocationLondon, UK
FocusUUID v7 in Vue 3 composables, Pinia, Nuxt server routes, and SSR hydration

Key sessions

Vue 3 composable — useUuidV7

// composables/useUuidV7.ts
import { v7 as uuidv7 } from 'uuid';

export function useUuidV7() {
  function generate(): string {
    return uuidv7();
  }

  function extractTimestamp(id: string): Date {
    const hex = id.replace(/-/g, '').slice(0, 12);
    return new Date(parseInt(hex, 16));
  }

  return { generate, extractTimestamp };
}

Pinia store with UUID v7

// stores/items.ts
import { defineStore } from 'pinia';
import { v7 as uuidv7 } from 'uuid';

interface Item {
  id:       string;  // UUID v7
  name:     string;
  pending?: boolean;
}

export const useItemsStore = defineStore('items', {
  state: () => ({ items: [] as Item[] }),

  actions: {
    async addItem(name: string) {
      const id = uuidv7(); // client-generated UUID v7

      // Optimistic insert — UUID v7 sorts chronologically
      this.items.push({ id, name, pending: true });

      try {
        const saved = await $fetch('/api/items', { method: 'POST', body: { id, name } });
        const idx = this.items.findIndex((i) => i.id === id);
        this.items[idx] = saved; // replace optimistic item with server response
      } catch {
        this.items = this.items.filter((i) => i.id !== id); // rollback
      }
    },
  },
});

Nuxt server route with UUID v7

// server/api/items.post.ts
import { v7 as uuidv7 } from 'uuid';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);

  // Accept client UUID v7 or generate server-side
  const id = body.id ?? uuidv7();

  const item = await db.items.create({ data: { id, name: body.name } });
  return item;
});

Vue template with UUID v7 list keys

<template>
  <ul>
    <!-- UUID v7 as :key — stable, time-ordered, no index reuse issues -->
    <li
      v-for="item in sortedItems"
      :key="item.id"
      :class="{ pending: item.pending }"
    >
      {{ item.name }}
      <span class="age">{{ relativeAge(item.id) }}</span>
    </li>
  </ul>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { useItemsStore } from '~/stores/items';

const store = useItemsStore();
const { extractTimestamp } = useUuidV7();

// UUID v7 sort = chronological — no secondary sort column needed
const sortedItems = computed(() =>
  [...store.items].sort((a, b) => a.id.localeCompare(b.id))
);

function relativeAge(id: string): string {
  const ms = Date.now() - extractTimestamp(id).getTime();
  return ms < 60_000 ? 'just now' : `${Math.floor(ms / 60_000)}m ago`;
}
</script>

Conference takeaways

  1. Composable pattern — useUuidV7() encapsulates generation and timestamp extraction
  2. Pinia optimistic UI — client UUID v7 sorts correctly in the local store before server confirmation
  3. Nuxt server routes — accept client UUID v7 or generate server-side; both are valid patterns
  4. SSR hydration — server and client must agree on the same UUID v7 to avoid hydration mismatches
  5. :key attribute — UUID v7 is more stable than indexes and more ordered than UUID v4

Further reading

External references

Frequently asked questions

How do I use UUID v7 as a Vue component key?

In Vue 3, use UUID v7 as the :key attribute for list items: <li v-for="item in items" :key="item.id"> where item.id is a UUID v7 string. UUID v7 is stable (unlike index-based keys) and time-ordered (unlike UUID v4 or Math.random()). Generate new UUIDs with import { v7 as uuidv7 } from 'uuid'. See UUID in Vue and Nuxt.

How does UUID v7 work in Nuxt server routes?

In Nuxt server routes (server/api/), generate UUID v7 server-side using the uuid npm package before persisting to the database. Return the UUID v7 in the JSON response — the client uses it as the item's stable identifier. This avoids client-side UUID generation in SSR environments where crypto.randomUUID() may not be available on the initial server render. See UUID v7 in SvelteKit for a comparable pattern.

How does UUID v7 improve optimistic UI in Pinia?

In Pinia, add items to the local store with a client-generated UUID v7 before the server confirms. The UUID v7 timestamp makes the optimistic item sort correctly among existing items — since UUID v7 is time-ordered, the new item appears at the end of the list without resorting. On server confirmation, replace the optimistic item's ID with the server-assigned UUID v7 (or keep the client UUID if the server accepts it). See UUID in React and Next.js for a similar React pattern.