Componente
Chip
Uma etiqueta compacta para um valor, filtro ou entidade. Carrega um ícone ou avatar inicial, vem em seis tons e cinco tamanhos, e pode ser removida com um botão à direita.
Tipos
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { HbChipComponent } from '@herbst/ui';
@Component({
selector: 'hb-demo-chip-types',
imports: [HbChipComponent],
template: `
<div class="flex flex-wrap items-center gap-2">
<span hb-chip>Default</span>
<span hb-chip hbType="secondary">Secondary</span>
<span hb-chip hbType="outline">Outline</span>
<span hb-chip hbType="success">Success</span>
<span hb-chip hbType="warning">Warning</span>
<span hb-chip hbType="destructive">Destructive</span>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoChipTypesComponent {}
Tamanhos
Ícone, avatar, removível e desabilitado
Referência de API
hb-chip
| Propriedade | Descrição | Tipo | Padrão |
|---|---|---|---|
| [hbType] | Intenção de cor do chip. | 'default' | 'secondary' | 'destructive' | 'success' | 'warning' | 'outline' | 'secondary' |
| [hbSize] | Escala geral do chip. | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'md' |
| [hbIcon] | Nome do ícone inicial. | string | '' |
| [hbImage] / [hbImageAlt] | URL da imagem de avatar inicial e seu texto alternativo. | string | '' |
| [hbRemovable] | Mostra o botão de remover à direita. | boolean | false |
| [hbRemoveIcon] | Nome do ícone do botão de remover. | string | '' |
| [hbDisabled] | Desabilita o chip e seu botão de remover. | boolean | false |
| (hbRemove) | Emitido quando o botão de remover é pressionado. | void | — |