Layout primitives for form fields — a label, control, description, and error, laid out vertically or horizontally, and grouped into fieldsets and columns.
Label, description & error
A short title for your photo. A city is required.
import { ChangeDetectionStrategy, Component } from '@angular/core';import { HbFieldImports, HbInputDirective } from '@herbst/ui';@Component({ selector: 'hb-demo-field-basic', imports: [HbFieldImports, HbInputDirective], template: ` <div class="flex w-full max-w-sm flex-col gap-6"> <hb-field> <label hb-field-label hbRequired>Photo title</label> <input hb-input placeholder="Autumn in the Black Forest" /> <hb-field-description>A short title for your photo.</hb-field-description> </hb-field> <hb-field hbInvalid> <label hb-field-label hbRequired>City</label> <input hb-input aria-invalid="true" placeholder="Freiburg" /> <hb-field-error [hbErrors]="['A city is required.']" /> </hb-field> </div> `, changeDetection: ChangeDetectionStrategy.OnPush,})export class HbDemoFieldBasicComponent {}
Horizontal
Receive a note when a new photo is shared.
Fieldset, legend & columns
API reference
hb-field
Property
Description
Type
Default
[hbOrientation]
Stack the label and control, place them in a row, or switch by container width.
'vertical' | 'horizontal' | 'responsive'
'vertical'
[hbInvalid]
Mark the field invalid, tinting the label and error.
boolean
false
Parts
Property
Description
Type
Default
hb-field-label [hbRequired]
The field label; hbRequired adds an asterisk.
boolean
false
hb-field-description
Helper text below the control.
slot
—
hb-field-error [hbErrors]
Error messages shown when invalid.
string[]
[]
hb-field-content
Wraps the label and description as a block (for horizontal layouts).
slot
—
Grouping
Property
Description
Type
Default
hb-field-group [hbColumns]
Grid of fields; collapses to one column on narrow containers.
1 | 2 | 3
1
hb-field-set / hb-field-legend
A fieldset and its legend (variant: legend or label).