Componente
Bubble
Um balão de mensagem de chat. Carrega texto em um de vários tons, alinha-se a qualquer lado e pode conter reações, ações e um menu. Agrupe balões sob um remetente com hb-bubble-group.
Variantes
Default — the primary bubble.
Secondary — the neutral default.
Muted — a quiet aside.
Tinted — a faint oxide wash.
Outline — hairline only.
Ghost — no surface at all.
Destructive — something went wrong.
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { HbBubbleImports } from '@herbst/ui';
@Component({
selector: 'hb-demo-bubble-variants',
imports: [HbBubbleImports],
template: `
<div class="flex flex-col items-start gap-2">
<hb-bubble hbVariant="default">Default — the primary bubble.</hb-bubble>
<hb-bubble hbVariant="secondary">Secondary — the neutral default.</hb-bubble>
<hb-bubble hbVariant="muted">Muted — a quiet aside.</hb-bubble>
<hb-bubble hbVariant="tinted">Tinted — a faint oxide wash.</hb-bubble>
<hb-bubble hbVariant="outline">Outline — hairline only.</hb-bubble>
<hb-bubble hbVariant="ghost">Ghost — no surface at all.</hb-bubble>
<hb-bubble hbVariant="destructive">Destructive — something went wrong.</hb-bubble>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoBubbleVariantsComponent {}
Conversa e grupo
Walked through the Black Forest this morning.
The oaks are finally turning.
You10:26
Nice — did you take photos?
Reações, ações e menu
New autumn photos ready for review.
No reaction yet.
Recolhível e tooltip
Referência de API
hb-bubble
| Propriedade | Descrição | Tipo | Padrão |
|---|---|---|---|
| [hbVariant] | Tom e superfície do balão. | 'default' | 'secondary' | 'muted' | 'tinted' | 'outline' | 'ghost' | 'destructive' | 'secondary' |
| [hbAlign] | De que lado fica a ponta do balão. | 'start' | 'end' | 'start' |
| [hbCollapsible] | Limita texto longo com um botão mostrar mais / menos. | boolean | false |
| [hbClampLines] | Número de linhas mostradas antes de limitar. | number | 4 |
| [(hbExpanded)] | Estado bidirecional do balão recolhível. | boolean | false |
| [hbTooltip] | Tooltip exibido ao passar o mouse (ex. um horário). | string | '' |
hb-bubble-group
| Propriedade | Descrição | Tipo | Padrão |
|---|---|---|---|
| [hbName] | Nome do remetente exibido acima dos balões. | string | '' |
| [hbAvatar] | URL da imagem de avatar do remetente. | string | '' |
| [hbTime] | Horário exibido no cabeçalho do grupo. | string | '' |
| [hbAlign] | Lado ao qual o grupo inteiro se alinha. | 'start' | 'end' | 'start' |
hb-bubble-reactions
| Propriedade | Descrição | Tipo | Padrão |
|---|---|---|---|
| [hbReactions] | Chips de reação: emoji, contagem opcional e estado reagido. | HbBubbleReaction[] | [] |
| [hbAddable] | Mostra um botão para adicionar uma nova reação. | boolean | false |
| (hbReact) | Emite o emoji de uma reação alternada. | string | — |
| (hbAdd) | Emitido quando o botão de adicionar reação é pressionado. | void | — |
hb-bubble-actions / hb-bubble-menu
| Propriedade | Descrição | Tipo | Padrão |
|---|---|---|---|
| hb-bubble-actions | Linha de controles de ação projetada abaixo do corpo do balão. | slot | — |
| hb-bubble-menu | Menu de ações extras; hbAriaLabel nomeia o gatilho. | slot | — |