On this page
@addTagHelper *, Webority.Ui.RazorPrefer the required flag
Pass required to a form field and it draws the mark itself, so the asterisk and validation stay in step.
Custom labels
Compose the mark beside a label you build yourself, never beside a field that already has required.
Every option
Every value of every prop, one cell each.
no props
<app-required-mark> takes no props
Guidance
What to do, and what to avoid.
Use it when
- You compose a custom label for a required field the library does not own.
- You need the same asterisk look outside AppInput / AppSelect and their siblings.
Reach for something else when
- The field already accepts a required prop. → Pass required on the field
- You want a status or count marker. → AppBadge
- You need explanatory help beside the label. → AppInfoTip
One mark beside the label
One asterisk flush against its label, using the shared mark.
A hand-rolled star drifts in colour and spacing from every library field.
Let the field own the mark
Let the field own the mark via required.
A star typed into the label of a required field doubles the mark: the field already draws one.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
0 props.
Screen reader
2 notes- The asterisk is hidden from assistive technology with aria-hidden="true", so it is never read aloud.
- Because the mark is hidden, the control itself must carry the required state: set required or aria-required on it.
Do and avoid
2 pairsOne mark beside the label
One asterisk flush against its label, using the shared mark.
A hand-rolled star drifts in colour and spacing from every library field.
Let the field own the mark
Let the field own the mark via required.
A star typed into the label of a required field doubles the mark: the field already draws one.