Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Text add-ons

Text before or after the field adds meaning, such as a currency sign or a domain, without changing the value.

Currency before and decimals after
₹
.00
Show code
<app-input-group label="Amount" html-for="amount" leading="₹" trailing=".00">
    <app-input id="amount" name="amount" />
</app-input-group>

Button beside the field

Put a button or select beside the field when its action belongs with the value, such as applying a coupon.

Coupon code
Show code
<app-input-group label="Coupon" html-for="coupon">
    <app-input id="coupon" name="coupon" />
    <app-input-group-trailing><app-button variant="Outline">Apply</app-button></app-input-group-trailing>
</app-input-group>

Every option

Every value of every prop, one cell each.

children: the field

children: one label-less app-input

leading: text or a node

leading="₹"
₹
leading="https://"
https://
leading omitted (default)
<app-input-group-leading> child (React: leading={node})

trailing: text or a node

trailing=".com"
.com
trailing omitted (default)
<app-input-group-trailing> child (React: trailing={node})

label: the group's label

label="Amount"
label omitted (default)

htmlFor: the field's id

html-for="ev-field" (ties the label to its field, no visible change)

required: marks the label

required
required omitted (default)

size: height of text add-ons

size="sm"
₹
size="md" (default)
₹
size="lg"
₹

className: class on the root

class="my-field" (React: className, no visible change)

Guidance

What to do, and what to avoid.

Use it when

  • Currency, protocol or domain around a value.
  • A button or select that acts on the field (Copy, Apply, a unit picker).

Reach for something else when

  • A unit shown inside the field. → AppInput unit, prefix or suffix
  • A search box with a submit button. → AppSearch

Reference

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

sm md lg
₹
.00
React, generated from the controls
<AppInputGroup label="Amount" htmlFor="pg-amount" leading="₹" trailing=".00">
  <AppInput id="pg-amount" />
</AppInputGroup>
Razor, the same props
<app-input-group label="Amount" html-for="pg-amount" leading="₹" trailing=".00">
    <app-input id="pg-amount" name="amount" />
</app-input-group>

6 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
labeldefault - string - The group's label, above it.
html-fordefault - string - The id of the field the label names.
requireddefault false bool false Marks the label required.
leadingdefault - string - Text before the field. A button or select goes in an <app-input-group-leading> child, which wins.
trailingdefault - string - Text after the field, or an <app-input-group-trailing> child.

Less common 1 props

PropTypeDefaultDescription
sizedefault md sm | md | lg md Height of text add-ons; set the same size on the field and on button add-ons.

Screen reader

3 notes
  • The label is a label element tied to the field by htmlFor, and the required mark follows the label text.
  • The add-ons share the field's outline and height.
  • Text add-ons are plain spans with no role, so the field must carry its own accessible name when there is no label.