Feedback e status

VNotificationCenter

Componentev-model5 exemplos18 props

Centro de notificações in-app para mensagens, alertas e atualizações sem sair do fluxo de trabalho. Agrupa e filtra notificações (tabs All/Unread/Mentions/Updates), sinaliza não-lidas com badge e pontos, oferece gestão rápida ("Mark all as read", "View all notifications →") e agrupa por tempo ("Today", "Yesterday").

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

Uso

Exemplo
<script setup lang="ts">

</script>

<template>
  
</template>

Playground

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

Exemplos

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

Default

Variação Padrão. Estado padrão do componente; use a aba Controls para experimentar as props ao vivo.

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

const notifications = [
  {
    id: '1',
    title: 'Design file shared with you',
    preview: 'Sarah shared "Landing Page v2.fig" with you.',
    time: '2m ago',
    unread: true,
    group: 'Today',
    tab: 'mentions',
  },
  {
    id: '2',
    title: 'Build completed',
    preview: 'Deploy preview is ready for review.',
    time: '5h ago',
    unread: false,
    group: 'Yesterday',
    tab: 'updates',
  },
]
</script>

<template>
  <VNotificationCenter v-model="value" :notifications="notifications" />
</template>

Grouped

Variação Grouped. Props: variant="grouped".

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

const notifications = [
  {
    id: '1',
    title: 'Design file shared with you',
    preview: 'Sarah shared "Landing Page v2.fig" with you.',
    time: '2m ago',
    unread: true,
    group: 'Today',
    tab: 'mentions',
  },
  {
    id: '2',
    title: 'Build completed',
    preview: 'Deploy preview is ready for review.',
    time: '5h ago',
    unread: false,
    group: 'Yesterday',
    tab: 'updates',
  },
]
</script>

<template>
  <VNotificationCenter
    v-model="value"
    variant="grouped"
    :notifications="notifications" />
</template>

Feed

Variação Feed. Props: variant="feed".

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

const notifications = [
  {
    id: '1',
    title: 'Design file shared with you',
    preview: 'Sarah shared "Landing Page v2.fig" with you.',
    time: '2m ago',
    unread: true,
    group: 'Today',
    tab: 'mentions',
  },
  {
    id: '2',
    title: 'Build completed',
    preview: 'Deploy preview is ready for review.',
    time: '5h ago',
    unread: false,
    group: 'Yesterday',
    tab: 'updates',
  },
]
</script>

<template>
  <VNotificationCenter
    v-model="value"
    variant="feed"
    :notifications="notifications" />
</template>

Open By Default

Variação Aberto por padrão. Interativo: o estado é mantido na própria story (v-model).

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

const args = {
  size: 'md',
  variant: 'default',
  notifications: [
    {
      id: '1',
      title: 'Design file shared with you',
      preview: 'Sarah shared \'Landing Page v2.fig\' with you.',
      time: '2m ago',
      unread: true,
      group: 'Today',
      tab: 'mentions'
    },
    {
      id: '2',
      title: 'Build completed',
      preview: 'Deploy preview is ready for review.',
      time: '5h ago',
      unread: false,
      group: 'Yesterday',
      tab: 'updates'
    }
  ]
}
const open = ref(true)
</script>

<template>
  <VNotificationCenter v-bind="args" v-model="open" variant="grouped" />
</template>

Loading

Variação Carregando. Props: loading=true, variant="grouped". Interativo: o estado é mantido na própria story (v-model).

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

const args = {
  size: 'md',
  variant: 'grouped',
  notifications: [
    {
      id: '1',
      title: 'Design file shared with you',
      preview: 'Sarah shared \'Landing Page v2.fig\' with you.',
      time: '2m ago',
      unread: true,
      group: 'Today',
      tab: 'mentions'
    },
    {
      id: '2',
      title: 'Build completed',
      preview: 'Deploy preview is ready for review.',
      time: '5h ago',
      unread: false,
      group: 'Yesterday',
      tab: 'updates'
    }
  ],
  loading: true
}
const open = ref(true)
</script>

<template>
  <VNotificationCenter v-bind="args" v-model="open" />
</template>

Acessibilidade

Semântica nativa primeiro, foco visível, labels acessíveis e teclado conforme o padrão WAI-ARIA correspondente.

Estados

Default · Hover · Focus-visible · Pressed/Active quando aplicável · Disabled · Loading quando aplicável.

Motion

TriggerPropertyDurationEasing
Hoverbackground/transform100msstandard
Focusoutline/box-shadow100msstandard
Enter/Exitopacity/transform160msstandard

Respeitar prefers-reduced-motion.

Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.

Props

PropTipoDefaultDescrição
modelValueboolean——
notificationsVNotificationCenterItem[][]—
sizeVNotificationCenterSize"md"—
variantVNotificationCenterVariant"default"—
placementVNotificationCenterPlacement"bottom-end"—
activeTabVNotificationCenterTab"all"—
searchQuerystring""—
disabledbooleanfalse—
loadingbooleanfalse—
ariaLabelstring——
triggerLabelstring——
headerTitlestring——
markAllLabelstring——
viewAllLabelstring——
emptyLabelstring——
closeLabelstring——
motionVMotionLevelV_MOTION_DEFAULT ("expressive")—
expressiveLabelstring—Expressive pill label shown when the bell toggle is open.

Events

EventoPayloadDescrição
@update:modelValuevalue: boolean—
@mark-all-read——
@view-all——
@item-clickid: string—
@update:activeTabvalue: VNotificationCenterTab—
@update:searchQueryvalue: string—

Slots

Sem slots.

Fonte: src/components/feedback/VNotificationCenter/VNotificationCenter.vue · tipos: src/components/feedback/VNotificationCenter/VNotificationCenter.types.ts