Skip to content

Demos#

Composition field#

You may adjust the widths to your needs.

Info at the bottom
<Field.Composition info="Info at the bottom" width="large">
  <Field.String label="Field A with a long label" width="medium" />
  <Field.String label="Field B" width="stretch" />
</Field.Composition>

Composition with a label#

A legend for the fieldset
<Field.Composition label="A legend for the fieldset" width="large">
  <Field.String label="Field label" width="stretch" />
  <Field.Number
    label="Number label"
    labelSrOnly
    width="small"
    placeholder="0000"
  />
</Field.Composition>

Composition of multiple statuses#

Label text
Warning messageOppsummering:
  • FieldBlock info
  • Field info
<Field.Composition label="Label text" info="FieldBlock info">
  <Field.String
    label="Text label"
    labelSrOnly
    width="small"
    minLength={3}
    warning="Warning message"
  />
  <Field.Number
    label="Number label"
    labelSrOnly
    minimum={10}
    info="Field info"
  />
</Field.Composition>

Composition field with error#

Error at the bottom
<Field.Composition error={new Error('Error at the bottom')} width="large">
  <Field.String label="Field A" width="stretch" />
  <Field.String
    label="Field B with a long label that wraps"
    width="medium"
  />
</Field.Composition>

Alignment#

Label text
<Field.Composition label="Label text" align="center">
  <Field.Number
    label="Number label"
    labelSrOnly
    width="small"
    defaultValue={0}
    showStepControls
  />
  <Field.Boolean />
</Field.Composition>
Suggest an edit