Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

In a table

Let a person change one value in a table cell without opening an edit form for the whole row.

Project table
A table whose owner, status and budget cells each edit in place.
ProjectStatusOwnerDueBudget
Tower A fit-out
Lobby lighting
Parking signage
Show code
<td>
  <app-inline-edit action="/Projects?handler=Status&id=p1" name="status" label="Status of Tower A fit-out" type="Select" value="in-progress">
    <app-option value="open">Open</app-option>
    …
  </app-inline-edit>
</td>
<td class="num">
  <app-inline-edit action="/Projects?handler=Budget&id=p1" name="budget" label="Budget of Tower A fit-out" type="Number" value="1500000" display="₹15,00,000" />
</td>

On a detail page

Use it beside each fact on a record's detail page, so the page keeps one reading order.

Record facts
The facts of one project, each editable beside its label.
Owner
Site phone
Due
Note
Show code
<app-descriptions columns="2">
  <app-description label="Owner">
    <app-inline-edit action="/Projects?handler=Owner&id=p1" name="owner" label="Owner" type="Select" value="asha">
      <app-option value="asha">Asha Rao</app-option>
      …
    </app-inline-edit>
  </app-description>
  <app-description label="Site phone">
    <app-inline-edit action="/Projects?handler=Phone&id=p1" name="phone" label="Site phone" placeholder="Add a number" />
  </app-description>
  <app-description label="Due">
    <app-inline-edit action="/Projects?handler=Due&id=p1" name="due" label="Due" type="Date" value="2026-11-14" />
  </app-description>
  <app-description label="Note">
    <app-inline-edit action="/Projects?handler=Note&id=p1" name="note" label="Note" type="Textarea" value="Keys with the guard." />
  </app-description>
</app-descriptions>

Saving and failure

A save that is refused keeps the control open with the reason, so the person can correct it.

A refused save
A save the server refuses shows its message and keeps the control open.
Show code
public IActionResult OnPostName(Guid id, string name)
{
    Project project = Load(id);
    if (_db.Projects.Any(p => p.Name == name && p.Id != id))
        return this.ActionRefused("A project with this name already exists.");
    project.Rename(name);
    _db.SaveChanges();
    return StatusCode(StatusCodes.Status204NoContent);
}

Every option

Every value of every prop, one cell each.

label

label: the accessible name, no visible change

value

value="Tower A fit-out"
value="" (empty, shows a hyphen)

type

type="text" (default)
type="number"
type="select"
type="date"
type="textarea"

options

app-option: the choices of a select

placeholder

placeholder="Add a number": shown when empty

validate

validate(next): a page script hook, set from the page

renderValue or display

display="₹15,00,000" (React: renderValue)

grouping

grouping="Indian": a number at rest in lakh grouping

disabled

disabled="false" (default)
disabled="true"

wrap

wrap="true" (default)
wrap="false"

className or class

class: extra classes on the root, no visible change

id

id: the root id, no visible change

onSave, action and name

action: where a save posts, no visible change
name="status": the form field the value posts under

events and methods

wui:inline-edit:saved: bubbles after a save
wui:inline-edit:failed: bubbles when a save is refused
edit(), cancel(): page script methods

Guidance

What to do, and what to avoid.

Use it when

  • One field that changes often on its own: a status, an owner, a due date, a name.
  • A value in a table row that people fix while working down the list.
  • A fact on a detail page that is wrong or out of date.

Reach for something else when

  • Several fields that change together, or depend on each other. → An edit form or AppModal with AppFormActions.
  • A change that needs a reason, an approval or a confirmation. → An action button that opens a dialog.
  • A value people cannot change. → Plain text, or AppInlineEdit with disabled while access is decided per row.

Reference

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

text number select date textarea
?handler=Save ?handler=Fail ?handler=Phone ?handler=Budget
true false
none indian
React, generated from the controls
<AppInlineEdit label="Project name" value={value} onSave={save} />
Razor, the same props
<app-inline-edit action="/Components/AppInlineEdit?handler=Save" name="value" label="Project name" value="Tower A fit-out" />

16 props. The 4 most used come first.

Used on most screens 4 props

PropTypeDefaultDescription
labeldefault - string - What the value is, such as Owner: its accessible name and what screen readers announce, as in Owner saved.
valuedefault - string - The saved value. A date is yyyy-MM-dd; a select value is one of the options' values.
typedefault text text | number | select | date | textarea text The control the value turns into.
placeholderdefault - string - Shown, muted, when there is no value, and in the empty control. Without it an empty value shows a hyphen.

Less common 12 props

PropTypeDefaultDescription
actiondefault - string - Where a save POSTs, with the antiforgery header.
namedefault - string - The form field the value posts under.
displaydefault - string - How the saved value reads when it is not the value itself, a formatted amount. Answer a save with the new display text to keep the format.
groupingdefault none none | indian none Digit grouping of a number value at rest.
disableddefault false bool false Shows the value without the edit affordance.
wrapdefault true bool true Wraps a long value across lines. false keeps it on one line, and a newline in a textarea value reads as a space.
validate(next)default - method - A page script hook, run before a save: return a message to keep the control open with it, or null to save.
edit()default - method - Opens the control for editing, from the page script.
cancel()default - method - Closes the control without saving, from the page script.
wui:inline-edit:saveddefault - event - Bubbles from the element after a save succeeds. Its detail holds value and previous.
wui:inline-edit:faileddefault - event - Bubbles from the element when a save is refused. Its detail holds value, previous, kind and message.
classdefault - string - Extra classes on the root element.

Screen reader

3 notes
  • The value is a button named from the label, with a visually hidden word, edit or read only.
  • Saved and failed outcomes are announced through a polite live region.
  • Enter saves a text or number, Ctrl or Cmd+Enter saves a textarea, and Escape cancels.