• English
  • CompactCharacterPicker

    The picker cut down to what fits beside a sign-up form.

    Shape
    Colour
    import { useState } from 'react';
    import { AgentAvatar, CompactCharacterPicker, type ColorId, type ShapeId } from '@aora-bot/react';
    
    export default function Demo() {
      const [shape, setShape] = useState<ShapeId>('blob');
      const [color, setColor] = useState<ColorId>('blue');
      return (
        <div className="site-demo site-demo--column">
          <AgentAvatar agent={{ id: 'first', shape, color }} size="xl" />
          <CompactCharacterPicker shape={shape} color={color} onSelectShape={setShape} onSelectColor={setColor} />
        </div>
      );
    }

    Fewer options on purpose

    A handful of inks and shapes rather than the whole catalogue. The shapes are AUTO_SHAPE_POOL — the shapes that still read as a character at 16px — and the missing ink is black, which is reserved as the default ink and so is not a choice anyone makes (ASSIGNABLE_COLOR_IDS). Someone deciding what their first agent looks like wants a handful of obvious options, not the whole catalogue; the full grid belongs in the editor they can open later.

    The component is controlled, like the plain picker, and lays both groups out on one row.

    API

    PropTypeDefaultDescription
    color*"black" | "brown" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "violet" | "magenta" | "pink" | "gray"——
    shape*"mochi" | "circle" | "blob" | "pebble" | "egg" | "bun" | "tofu" | "pill" | "hex" | "onigiri" | "gem" | "cloud" | "drop" | "leaf" | "flower" | "clover" | "sprout" | "mushroom" | "acorn" | "cactus" | "pear" | "apple" | "strawberry" | "cherry" | "star" | "heart" | "flame" | "bell" | "ghost" | "bot" | "crescent" | "boba" | "fish" | "octopus" | "cat" | "bunny" | "bear" | "chick" | "penguin" | "pig" | "fox" | "bob" | "topknot" | "spiky" | "curly" | "twinbuns"——
    classNamestring——
    face"cute" | "eyes" | "line"—Face style. Passing it adds the face toggle, and the nose row when the line face is chosen — the same behaviour as the full picker.
    lineWeightnumber——
    nose"slant" | "angular" | "hook" | "long" | "curve" | "bow" | null—Nose for the line face. Defaults to the first nose while `face` is `line`.
    onSelectColor((color: "black" | "brown" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "violet" | "magenta" | "pink" | "gray") => void)——
    onSelectFace((face: "cute" | "eyes" | "line") => void)——
    onSelectNose((nose: "slant" | "angular" | "hook" | "long" | "curve" | "bow") => void)——
    onSelectShape((shape: "mochi" | "circle" | "blob" | "pebble" | "egg" | "bun" | "tofu" | "pill" | "hex" | "onigiri" | "gem" | "cloud" | "drop" | "leaf" | "flower" | "clover" | "sprout" | "mushroom" | "acorn" | "cactus" | "pear" | "apple" | "strawberry" | "cherry" | "star" | "heart" | "flame" | "bell" | "ghost" | "bot" | "crescent" | "boba" | "fish" | "octopus" | "cat" | "bunny" | "bear" | "chick" | "penguin" | "pig" | "fox" | "bob" | "topknot" | "spiky" | "curly" | "twinbuns") => void)——
    sizePxnumber—Size of each preview. Defaults to `PICKER_MARK_PX`.
    styleCSSProperties——

    Next