Skip to content

Field

Last updated 6 Nov 2026

NbField is a labeled row: a label and a control sharing one grid. A stack of NbFields lines up on a single spine automatically, with no per-field CSS, which makes it the building block of an inspector or a settings panel. Wrap any control and it falls into place.

Stack a control ​

orientation="stack" puts the label on its own line above a full-width control, for a control that wants the whole width (a tall text area, a prominent slider), or a label too long to sit beside it.

Small controls: control="fit" ​

For a small control such as a switch, control="fit" lets the label run wide and pushes the control to the right edge, instead of squeezing the label into the fixed column.

In an inspector ​

Inside a .nb-inspector container, NbField picks up the inspector treatment automatically: a compact spine, sliders that stack with full-width tracks, compact numeric steppers, and section highlighting. See Building an inspector.

Content ​

  • The label is one to three words. It ellipsizes at the label column width, and the full text survives only in title, which touch users never see.
  • hint is guidance before the answer, a sentence with a period, or a fragment without one. It is where steady requirements live, not in a placeholder.
  • Mark required, not optional, and never both in one form.
  • The error replaces the hint and names the fix, in two lines at most.

Casing, punctuation and tone are set library-wide, not by this component: Writing style is the source.