AppRequiredMark
The shared required-field asterisk used beside form labels.
<app-required-mark /><app-required-mark> is the red asterisk that sits beside a required field's label. It is a fixed decorative mark: one class, one character, always aria-hidden. Colour comes from the theme .required rule (--color-danger-text), never an inline hex.
Form primitives already render it when you pass required. Reach for this tag only when you compose a custom label that those primitives do not own. The Razor <app-required-mark> and the React <AppRequiredMark /> render identically on every surface.
Basic
Place it immediately after the label text. No attributes to set.
Show code
<span class="label d-inline-flex align-items-center gap-1"> Email <app-required-mark /> </span>
Prefer the field's required flag
Every form control that owns its label already inserts the mark when required is true. Prefer that path.
required on the field. The asterisk and validation behaviour stay in sync without composing the mark by hand.Show code
<app-input label="Email" required="true" />
<app-required-mark> when the label is yours (a custom layout, a non-library field). Do not double the mark by adding it beside a field that already has required.Accessibility
The asterisk is decorative. Assistive tech learns required state from the field, not from the glyph.
required attribute (or aria-required) on the control.Show code
<app-required-mark /> <!-- renders: <span class="required" aria-hidden="true">*</span> -->
When to use
Use it when
- You compose a custom label for a required field the library does not own.
- You need the same asterisk look outside
<app-input>/<app-select>and their siblings.
Reach for something else when
- The field already accepts a
requiredattribute → passrequiredon the field - You want a status or count marker → AppBadge / AppStatusBadge
- You need explanatory help beside the label → AppInfoTip
Best practices
required.required) shows two asterisks or fights the field's own label.Attributes
<app-required-mark> takes no attributes. It always renders the same <span class="required" aria-hidden="true">*</span>.