Person picker
An assignee, an author, an owner: you first, typing a name jumps to it.
import { PersonPicker } from "@forgeron/ui";Assignee
Author
import { PersonPicker } from "@forgeron/ui";
const people = [
{ id: "cr", name: "Camille Roy", hint: "Sales" },
{ id: "hb", name: "Hugo Bernard", hint: "Engineering" },
{ id: "lm", name: "Léa Martin", hint: "Operations" },
{ id: "np", name: "Nadia Petit", hint: "Finance" },
{ id: "tg", name: "Tom Garnier", hint: "Support" },
];
export default function Assignee() {
return (
<>
<PersonPicker people={people} me="cr" noneLabel="No assignee" defaultValue="hb" />
<PersonPicker label="Author" people={people} me="cr" defaultValue="cr" />
</>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | "Assignee" | Assignee, Author, Owner. |
people | { id, name, hint?, src? }[] | — | The people offered. |
me | string | — | The viewer: listed first, marked (you). |
noneLabel | string | — | The entry for nobody, e.g. No assignee. |
value / defaultValue | see type | — | Controlled or not. |
onChange | (value) => void | — | On a new choice. |
variant | "chip" | "field" | "chip" | A record's property, or a form control. |
markOnly | boolean | — | The mark alone, for dense rows. |
className | string | — | Extra classes. |