Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Basic usage

Place two or more fields in a row, and they sit side by side on a desktop and stack on a phone.

Two columns
Avoid mixing plain HTML inputs with app-* components in the same row; for consistency, all fields should use the same library.
Show code
<app-form-row columns="2">
    <app-input label="First name" name="firstName" />
    <app-input label="Last name" name="lastName" />
</app-form-row>

One, two or three columns

Set columns to one, two or three to choose how many fields share a row, such as day, month and year.

One column (full width)
Show code
<app-form-row columns="1">
    <app-input label="Full width field" name="fullName" />
</app-form-row>
Three columns
Show code
<app-form-row columns="3">
    <app-input label="Day" name="day" />
    <app-input label="Month" name="month" />
    <app-input label="Year" name="year" />
</app-form-row>
Long content: a label that wraps inside a narrow column
Show code
<app-form-row columns="3">
    <app-input label="A field label long enough to wrap onto a second line" name="longLabel" />
    <app-input label="Short" name="short" />
    <app-input label="Short" name="short2" />
</app-form-row>

Responsive breakdown

Every column count collapses to one column below the medium breakpoint, so fields stay readable on phones.

Responsive at all breakpoints
Show code
<app-form-row columns="2">
    <app-input label="Street" name="street" />
    <app-input label="City" name="city" />
    <app-input label="State" name="state" />
    <app-input label="Postcode" name="postcode" />
</app-form-row>

Spacing

app-form-row uses theme gap tokens to ensure consistent spacing between fields. The gap is applied both horizontally (between columns) and vertically (between rows on mobile), matching the design system's spacing scale.

Supported children

app-form-row works with any form field component: app-input, app-textarea, app-number-input, app-select (with its search, multiple, tag and country modes), app-checkbox, app-radio, app-switch, app-date-picker, app-date-range-picker, app-time-picker, app-phone-number-input, app-color-field and app-slider.

Mixed field types
Show code
<app-form-row columns="3">
    <app-input label="Name" name="name" />
    <app-textarea label="Notes" name="notes" />
    <app-checkbox label="Subscribe" name="subscribe" checked="true" />
</app-form-row>

Passthrough props: id, data-*, style

Passthrough props: id, data-*, style
Show code
<app-form-row columns="1" id="passthrough-row" data-testid="row" style="margin-top: var(--wui-space-xl)">
    <app-input label="Street" name="street" />
</app-form-row>

Every option

Every value of every prop, one cell each.

columns: 1 to 12

columns="1"
columns="2" (default)
columns="3"
columns="4"
columns="5"
columns="6"
columns="7"
columns="8"
columns="9"
columns="10"
columns="11"
columns="12"

collapse: true or false

collapse="true" (default)
collapse="false"

class: merged onto the grid div

class="row-highlight"

passthrough props: id, data-*, style

id="shipping-row" data-testid="row"
style="margin-top: var(--wui-space-xl)": merges with the --form-cols custom property

children: mixed field types and long labels

app-input + app-textarea + app-checkbox in one row
columns="3" with a long field label

Guidance

What to do, and what to avoid.

Use it when

  • You have multiple form fields that should sit side-by-side on desktop but stack on mobile.
  • You are building a form page with multiple rows of fields (pair with AppFormSection to group them).
  • You need responsive column control without custom CSS: use the columns prop.

Reach for something else when

  • You need a single full-width field → Just use the field component directly, or wrap in columns={1}
  • You need a custom grid layout (asymmetric columns, spans, etc.) → Use Bootstrap Row/Col for full control
  • You are organizing logical groups, not just laying out fields → Wrap AppFormRow in AppFormSection to add a title and description

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

1 2 3
true false
React, generated from the controls
<AppFormRow columns={2}>
  <AppInput label="First name" name="firstName" />
  <AppInput label="Last name" name="lastName" />
  <AppInput label="Email" name="email" />
</AppFormRow>
Razor, the same props
<app-form-row columns="2">
    <app-input label="First name" name="firstName" />
    <app-input label="Last name" name="lastName" />
    <app-input label="Email" name="email" />
</app-form-row>

5 props. The 2 most used come first.

Used on most screens 2 props

PropTypeDefaultDescription
columnsdefault 2 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2 Number of columns, 1 to 12.
collapsedefault true bool true Stack to one column below the md breakpoint; false keeps the set columns at every width.

Less common 3 props

PropTypeDefaultDescription
childrendefault - - - Field components (app-input, app-select, etc.) laid out in the grid.
classdefault - string - Extra classes merged onto the grid div (component classes go first, so an authored class wins the cascade).
styledefault - string - Extra inline styles merged with the component's own --form-cols declaration (component declaration first, so an authored property of the same name wins).

Screen reader

3 notes
  • Renders a plain div grid with no role, so each field keeps its own label and accessible name.
  • Columns are placed by CSS only, so the tab order follows the order of the children whatever the column count.
  • Extra attributes pass through to the div.