Calm motion: animations on this site only fade, with no movement
KeyValueEditor
Rows of key and value pairs to edit
Edits a list of pairs, such as the headers of a request, environment variables, or the metadata of a file. To show pairs that people only read, use descriptions. For a list of single words, use input tags.
Basic
[
"Accept"
]v-modelis a list of{ key, value, enabled }. An empty row is always at the end. Type in it, and it becomes a row, and a new empty row shows.- Each row has a remove button. After a remove, focus goes to the key of the row that takes its place, so the keyboard stays in the list.
- A key that is used more than once is marked on each of its rows, and a line under the list says so. The list still keeps the rows, so you decide what to do.
toggleadds an on and off box to each row. A row that is off stays in the list withenabled: false, so people can turn a header off and on again without typing it again.secrethides the values, as a password field does.- In a field, the field's label names the group. Each field in a row has a name with the row number, for example "Key 2".
- Change the words with
labelsor a label pack:key,value,enabled,remove, andduplicate.
Usage
ts
import { BlessKeyValueEditor, type BlessKeyValue } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
toggle | boolean | — | an on and off box per row |
secret | boolean | — | hide the values, for secrets |
disabled | boolean | — | |
labels | Partial<{ key: string; value: string; enabled: string; remove: string; duplicate: string; }> | — | |
modelValue | BlessKeyValue[] | [] |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: BlessKeyValue[]] |