Components / core
RoleBadgeList
Displays the roles assigned to a record.
Generated from @oods/foundry 0.10.1
- Categories
- core
- Contexts
- list
- Readiness
react-and-vue
Playground
This component's contract doesn't list typed props, so the playground shows its documented example.
Documented example role-badge-list-items : mount, two visible role items inside one group carrying the session variant.
The render follows the page's theme switch: light, dark or high contrast. Both frameworks render the same example.
Code
The documented example. HTML is the markup the React component renders for it, which @oods/component-styles styles.
import { RoleBadgeList } from '@oods/components-react';
import '@oods/component-styles/css';
const roles = [
"owner",
{
"label": "billing-admin"
}
];
export function Example() {
return (
<RoleBadgeList
roles={roles}
variant="session"
/>
);
}Props, slots and events
Contract version 1.1.0. Types are from the React declarations in @oods/components-react.
| Prop | Type | Required | Documented example |
|---|---|---|---|
roles | readonly unknown[] | undefined | no | ["owner",{"label":"billing-admin"}] |
badges | readonly unknown[] | undefined | no | |
role | readonly unknown[] | undefined | no | |
value | readonly unknown[] | undefined | no | |
variant | string | undefined | no | session |
tone | string | undefined | no | |
label | string | undefined | no | |
text | string | undefined | no |
Slots
default
Events
none
States
populated, fallback
Accessibility
- Role
none- How it gets its name
noneon:root
Keyboard
The contract lists no keyboard behaviour.
Obligations in the contract
- Each role is visible text inside one inline noninteractive group
- An empty list falls back to a visible label
Mirrors renderRoleBadgeList: roles, then badges, roleLabels or value (records read label/name/role/value/id, scalars render as text) render one data-role-badge item each inside a span carrying data-badge-variant from variant, then tone, then roles; with no items the label, then text, then Roles is the visible fallback; authored children replace the list. rolesField lowers to roles and fallbackRoleParameter is consumed.
Tokens
The token roles this component reads.
badge.backgroundbadge.text
Readiness
The evidence recorded for this component, with its label.
react-and-vue: catalog_list gives this label when the React and Vue components have complete readiness evidence, but the sweep's generated apps don't use the component in both.
| 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 | not-applicable | not-applicable |
| visual themes | verified | verified |
RoleBadgeList presents content and owns no focusable control or action; authored child actions remain the consumer's responsibility.
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": "<YourRoleBadgeList>",
"oodsTraits": [
"Authable"
],
"substitution": {
"component": "RoleBadgeList",
"react": {
"package": "<your-package>/react",
"version": "<exact version>",
"export": "<YourRoleBadgeList>"
},
"vue": {
"package": "<your-package>/vue",
"version": "<exact version>",
"export": "<YourRoleBadgeList>"
}
}
} 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.RoleBadgeListsha256:1f8d01dafb81… - Documented example:
@oods/component-contracts@0.10.1 sharedScenarios role-badge-list-itemssha256:095050677568… - Catalog entry (catalog_list):
generated/0.10.1/system/catalog.json RoleBadgeListsha256:1b8523bb76e4… - React readiness:
@oods/components-react@0.10.1 readiness RoleBadgeListsha256:0342c20b56ce… - Vue readiness:
@oods/components-vue@0.10.1 readiness RoleBadgeListsha256:87de4edc9186… - Prop types:
generated/0.10.1/components/prop-types.json RoleBadgeListsha256:e103cf11ed5f…