Data Entry
InlineEdit
Edit one value in place.
import { InlineEdit } from 'faifo-design'InlineEdit turns a displayed value into an editor and back. The edit state is controlled, a native
form is the fallback, and a stale version or a rejected input is shown where the value is.
#When to use
- Use it for a single value a reader corrects often, such as a quantity in a row.
- Use a
RecordFormwhen several values change together.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Inline edit
Controlled edit state keeps a native form fallback, stale version and rejected input.
Show codeHide code
import { InlineEdit } from 'faifo-design'
export const Example = () => (
<InlineEdit
id="customer-name"
label="Customer"
value="An Việt"
editing
editHref="?edit=customer"
cancelHref="?edit="
action="/orders/SO-1042/customer"
name="customer"
inputValue="An Việt Trading"
version="7"
/>
)#API
Generated from the package source. A property without a description has none in the source yet.
#InlineEditComponent
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
labelrequired | – | string | – |
valuerequired | – | JSXChild | – |
editingrequired | – | boolean | – |
editHrefrequired | – | string | – |
cancelHrefrequired | – | string | – |
actionrequired | – | string | – |
namerequired | – | string | – |
inputValuerequired | – | string | – |
version | – | string | – |
error | – | string | null | – |
saveLabel | – | string | 'Save' |
cancelLabel | – | string | 'Cancel' |
#Types
#InlineEditProps
The properties of InlineEdit, listed above.
#Hooks
The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.
inline-editinline-edit-valueinline-edit-forminline-edit-actions