On this page
@addTagHelper *, Webority.Ui.RazorIn 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.
| Project | Status | Owner | Due | Budget |
|---|---|---|---|---|
| Tower A fit-out |
|
|
||
| Lobby lighting |
|
|
||
| Parking signage |
|
|
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
-
Asha Rao Ravi Kumar Meera Iyer - Site phone
- Due
- Note
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.
Every option
Every value of every prop, one cell each.
label
label: the accessible name, no visible changevalue
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 selectplaceholder
placeholder="Add a number": shown when emptyvalidate
validate(next): a page script hook, set from the pagerenderValue or display
display="₹15,00,000" (React: renderValue)grouping
grouping="Indian": a number at rest in lakh groupingdisabled
disabled="false" (default)disabled="true"wrap
wrap="true" (default)wrap="false"className or class
class: extra classes on the root, no visible changeid
id: the root id, no visible changeonSave, action and name
action: where a save posts, no visible changename="status": the form field the value posts underevents and methods
wui:inline-edit:saved: bubbles after a savewui:inline-edit:failed: bubbles when a save is refusededit(), cancel(): page script methodsGuidance
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.
16 props. The 4 most used come first.
Used on most screens 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| 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
| Prop | Type | Default | Description |
|---|---|---|---|
| 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.