Feedback e status · parte de VNotificationCenter
VNotificationItem
Unidade de notificação com título, resumo, horário e estados (não lida, carregando, desabilitada). Combina com o VNotificationCenter, mas também funciona sozinha em listas e feeds.
<script setup lang="ts">
import { VNotificationItem } from 'vueui-nova-kit'
</script>Uso
A variante avatar mostra a foto ou as iniciais; system, success e actionable mudam o destaque e as ações. Use unread com moderação. Eventos: click, dismiss, menu e action.
<script setup lang="ts">
import { VNotificationItem } from 'vueui-nova-kit'
</script>
<template>
<VNotificationItem
title="Sarah Chen mencionou você"
preview="Comentou no checklist de lançamento."
time="há 2 min"
unread
variant="avatar" />
</template>Playground
Os controles abaixo são gerados a partir das props declaradas em VNotificationItem.types.ts; o código acompanha cada mudança.
Acessibilidade
- ARIA role="listitem" — cada item com
role="listitem". - Works within role="list" — lista contentora com
role="list"(ou<ul>/<li>nativos). - Keyboard navigable actions — ações inline e
…atingíveis e operáveis por teclado. - Visible focus indicators — foco visível no item e nas ações (estado Focused action).
- Sufficient color contrast — título, preview e timestamp dentro do mínimo WCAG AA; estado lido/não-lido não depende só da cor (ponto + peso).
- Meaningful alt text for avatars —
alt="Sarah Chen"nas fotos; ícones decorativos comaria-hidden. - Supports screen readers — título + tempo anunciados; mudança lido/não-lido via
aria-livesubtil ou região viva da lista. - Follows WCAG 2.2 AA — conforme WCAG 2.2 AA.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
avatar | string | — | — |
avatarAlt | string | — | — |
title | string | — | — |
preview | string | — | — |
time | string | — | — |
unread | boolean | false | — |
variant | VNotificationItemVariant | "default" | — |
size | VNotificationItemSize | "md" | — |
disabled | boolean | false | — |
loading | boolean | false | — |
dismissible | boolean | false | — |
showMenu | boolean | true | — |
actions | VNotificationItemAction[] | — | — |
ariaLabel | string | — | — |
dismissLabel | string | "Dismiss notification" | — |
menuLabel | string | "Notification options" | — |
Events
| Evento | Payload | Descrição |
|---|---|---|
@click | — | — |
@dismiss | — | — |
@menu | — | — |
@action | key: string | — |
@update:unread | value: boolean | — |
Slots
| Slot | Props do slot |
|---|---|
#avatar | — |
#title | — |
#time | — |
#preview | — |
#actions | — |
Fonte: src/components/feedback/VNotificationItem/VNotificationItem.vue · tipos: src/components/feedback/VNotificationItem/VNotificationItem.types.ts