Blocks / Person picker

Person picker

An assignee, an author, an owner: you first, typing a name jumps to it.

import { PersonPicker } from "@forgeron/ui";
/01 → Assignee
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
PropTypeDefaultDescription
labelstring"Assignee"Assignee, Author, Owner.
people{ id, name, hint?, src? }[]—The people offered.
mestring—The viewer: listed first, marked (you).
noneLabelstring—The entry for nobody, e.g. No assignee.
value / defaultValuesee type—Controlled or not.
onChange(value) => void—On a new choice.
variant"chip" | "field""chip"A record's property, or a form control.
markOnlyboolean—The mark alone, for dense rows.
classNamestring—Extra classes.