Componente

Accordion

Um conjunto de cabeçalhos empilhados na vertical, cada um revelando uma seção de conteúdo. Use para recolher material longo e secundário numa superfície calma que o leitor abre quando quiser.

Básico

A copy-paste component collection for Angular, tuned to the light of a German autumn.
Yes. Components live inside your project, so every token, class, and line is yours to edit.
Every component reads semantic CSS variables that turn with the .dark class.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { HbAccordionImports } from '@herbst/ui';

@Component({
  selector: 'hb-demo-accordion-basic',
  imports: [HbAccordionImports],
  template: `
    <hb-accordion class="w-full max-w-md" hbDefaultValue="item-1">
      <hb-accordion-item hbValue="item-1" hbTitle="What is Herbst UI?">
        A copy-paste component collection for Angular, tuned to the light of a German autumn.
      </hb-accordion-item>
      <hb-accordion-item hbValue="item-2" hbTitle="Is the code really mine?">
        Yes. Components live inside your project, so every token, class, and line is yours to edit.
      </hb-accordion-item>
      <hb-accordion-item hbValue="item-3" hbTitle="Does it support dark mode?">
        Every component reads semantic CSS variables that turn with the .dark class.
      </hb-accordion-item>
    </hb-accordion>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoAccordionBasicComponent {}

Múltiplo

Amber and rust drifting over cobblestone — the palette the theme is built from.
Long shadows and a quiet haze; the same restraint the components keep.
A cool paper backdrop that lets a single ember of colour do the work.

Não recolhível

With hbCollapsible set to false the open item cannot be closed — you can only move to another one.
Selecting a header opens it and keeps exactly one section visible at all times.
Useful when you always want to keep the reader on a single active section.

Card e desabilitado

A card-bordered accordion groups its items inside a single framed surface.
This item cannot be opened while it is disabled.
Disabled items stay visible so the structure of the content is never lost.

Referência de API

hb-accordion

PropriedadeDescriçãoTipoPadrão
[hbType] Se um ou vários itens podem ficar abertos ao mesmo tempo. 'single' | 'multiple' 'single'
[hbCollapsible] Permite fechar novamente o item aberto (modo single). boolean true
[hbBordered] Tratamento das bordas ao redor e entre os itens. 'none' | 'divider' | 'card' 'divider'
[hbDefaultValue] Valor(es) do(s) item(ns) aberto(s) na primeira renderização. string | string[] ''
[class] Classes CSS extras mescladas no host. string ''

hb-accordion-item

PropriedadeDescriçãoTipoPadrão
[hbTitle] Texto exibido no cabeçalho do item. string ''
[hbValue] Valor único que identifica o item. string ''
[hbDisabled] Impede o item de abrir ou fechar. boolean false
[class] Classes CSS extras mescladas no item. string ''