Components / behavioral
TagInput
Edits the tags assigned to a record.
Generated from @oods/foundry 0.10.1
- Categories
- behavioral
- Contexts
- form
- Readiness
proven-in-generated-apps
Playground
This component's contract doesn't list typed props, so the playground shows its documented example.
Documented example tag-input-typed-text : type into the Tag input, the typed text emitted.
The render follows the page's theme switch: light, dark or high contrast. Both frameworks render the same example.
Events it emits: change, update. Use either render above, and each event shows here with the framework that sent it.
Code
The documented example. HTML is the markup the React component renders for it, which @oods/component-styles styles.
import { TagInput } from '@oods/components-react';
import '@oods/component-styles/css';
const tags = [
"alpha"
];
export function Example() {
return (
<TagInput
title="Tags"
tags={tags}
value="be"
placeholder="Add a tag"
/>
);
}Props, slots and events
Contract version 1.1.0. Types are from the React declarations in @oods/components-react.
| Prop | Type | Required | Documented example |
|---|---|---|---|
title | string | undefined | no | Tags |
label | string | undefined | no | |
heading | string | undefined | no | |
name | string | undefined | no | |
description | string | undefined | no | |
subtitle | string | undefined | no | |
hint | string | undefined | no | |
tags | readonly unknown[] | undefined | no | ["alpha"] |
value | string | undefined | no | be |
placeholder | string | undefined | no | Add a tag |
Slots
default
Events
change, update
States
populated, empty
Accessibility
- Role
textbox- How it gets its name
labeloninput
Keyboard
| Key | What it does |
|---|---|
| Tab | Move focus to the named native control |
| x | Edit the named control |
Obligations in the contract
- A fieldset whose legend is the title
- The Tag input is a labelled text input
- Each tag is visible text
Mirrors renderTagInput over renderFormContainer with data-form-type=tag-input as a fieldset: the legend reads title/label/heading/name (default Tag Input), subtitle aliases description/subtitle/hint, the Tag input named tag takes placeholder and shows value, and tags (records read label/name/role/value/id, scalars render as text) render one data-tag-item each after the input; authored children replace the generated body. The generic field lowers to tags while value is the typed text: a saved onChange binding owns a local string state in the React and Vue targets, so the input is controlled. maxTagsParameter, allowCustomParameter, allowListParameter, minLengthParameter, maxLengthParameter and synonymParameter are consumed.
Tokens
The token roles this component reads.
form.backgroundform.borderform.textform.hint
Readiness
The evidence recorded for this component, with its label.
proven-in-generated-apps: catalog_list gives this label when generated React and Vue apps in the runtime sweep that ships with this version both use the component. That sweep was measured on the published 0.4.1, not on this version.
| Evidence | React | Vue |
|---|---|---|
| state | implemented-evidence-complete | implemented-evidence-complete |
| versioned contract | passed | passed |
| target implementation | passed | passed |
| package export | passed | passed |
| public declaration | passed | passed |
| dependency closure | passed | passed |
| framework scenario | passed | passed |
| accessibility | verified | verified |
| interaction | verified | verified |
| visual themes | verified | verified |
Use your own
You can replace this component with your own React or Vue component. Map it, and generated code imports yours at the exact version you name. A contract report, run in a real browser, lists what your component met, what it didn't, and what wasn't checked.
The component_map call, with the parts in angle brackets yours to fill:
{
"action": "create",
"apply": true,
"externalSystem": "<your design system>",
"externalComponent": "<YourTagInput>",
"oodsTraits": [
"Taggable"
],
"substitution": {
"component": "TagInput",
"react": {
"package": "<your-package>/react",
"version": "<exact version>",
"export": "<YourTagInput>"
},
"vue": {
"package": "<your-package>/vue",
"version": "<exact version>",
"export": "<YourTagInput>"
}
}
} How this page was made
Generated at build from the published data, each source with the hash of what was read. The page's manifest.
- Contract:
@oods/component-contracts@0.10.1 componentContracts.TagInputsha256:36bc4bad70b5… - Documented example:
@oods/component-contracts@0.10.1 sharedScenarios tag-input-typed-textsha256:9523c78977cf… - Catalog entry (catalog_list):
generated/0.10.1/system/catalog.json TagInputsha256:e1a53a59b192… - React readiness:
@oods/components-react@0.10.1 readiness TagInputsha256:cbe24354d71e… - Vue readiness:
@oods/components-vue@0.10.1 readiness TagInputsha256:878280a23f9d… - Prop types:
generated/0.10.1/components/prop-types.json TagInputsha256:7ee44b38efae…