RolePicker
Choosing a role: built-in, then custom, each with one sentence; ungivable roles say why.
Built-in roles
Custom roles
function List() {
const [role, setRole] = useState("developer");
return <RolePicker className="w-480" aria-label="Role in the organization" roles={ORG_ROLES} value={role} onValueChange={setRole} />;
}import { RolePicker } from "@logicplanes/kaeso-ui";Props
appearance"list" | "select" = listA list with each role's description, or a compact select.
aria-labelstringThe accessible name, for when there is no visible label.
disabledbooleanTurns it off: it can't be used, and it looks dimmed.
fullWidthbooleanSelect only: fill the container.
labelstringThe select's visible label; a list is named by
aria-labelor the step around it.namestringThe field name the value is sent under in a form.
onValueChange((value: string) => void)Called with the chosen role's id.
rolesRoleOption[]The roles to choose from.
size"md" | "sm" = mdThe height of the control.
valuestring | nullThe chosen role's id, when you control it.