• English
  • CompactCharacterSelector

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

    Shape
    Colour
    import { useState } from 'react';
    import { AgentPortrait, CompactCharacterSelector, 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">
          <AgentPortrait agent={{ id: 'first', shape, color }} size="xl" />
          <CompactCharacterSelector
            shape={shape}
            color={color}
            onSelectShape={setShape}
            onSelectColor={setColor}
          />
        </div>
      );
    }

    Fewer options on purpose

    It offers a handful of inks and shapes rather than the whole catalogue. The shapes come from AUTO_SHAPE_POOL, the shapes that still read as a character at 16px. The inks come from ASSIGNABLE_COLOR_IDS, the eleven bright hues an id is hashed onto; black (the default ink) and the near-white and muted colours are left to the full editor. Someone choosing how their first agent looks wants a few obvious options. The full grid belongs in the editor, which they can open later.

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

    API

    PropTypeDefaultDescription
    color*"cream" | "ivory" | "black" | "brown" | "red" | "orange" | "yellow" | "green" | "cyan" | "blue" | "violet" | "magenta" | "pink" | "gray" | "sage" | "clay" | "navy" | "mauve" | "night" | "cocoa" | "sky" | "blush" | "lilac" | "butter" | "meadow" | "peach" | "pine" | "crimson" | "snow" | "indigo" | "crust" | "jade" | "peel" | "mint" | "carrot" | "caramel" | "lagoon" | "lemon" | "aqua" | "sand" | "grass" | "wine" | "plum"——
    shape*"circle" | "mochi" | "blob" | "pebble" | "egg" | "bun" | "tofu" | "pill" | "hex" | "onigiri" | "gem" | "cloud" | "drop" | "leaf" | "flower" | "clover" | "sprout" | "mushroom" | "acorn" | "cactus" | "eggplant" | "pear" | "apple" | "strawberry" | "cherry" | "avocado" | "melon" | "pudding" | "toast" | "icecream" | "cupcake" | "fries" | "candy" | "burger" | "star" | "heart" | "flame" | "bell" | "ghost" | "bot" | "crescent" | "boba" | "planet" | "cottage" | "chat" | "gift" | "bulb" | "fish" | "octopus" | "seal" | "puffer" | "cat" | "bunny" | "bear" | "chick" | "penguin" | "pig" | "fox" | "lion" | "hamster" | "hedgehog" | "koala" | "bat" | "bob" | "topknot" | "spiky" | "curly" | "twinbuns" | "chunk" | "lump" | "fluff" | "spook" | "pumpkin" | "nightcat" | "batling" | "cauldron" | "witch" | "toffee" | "manor" | "wisp" | "deadtree" | "scarecrow" | "tombstone" | "candycorn" | "mummy" | "skull" | "spider" | "owl" | "pail" | "candle" | "vampire" | "witchmochi" | "lanterncat" | "nightcapmoon" | "xm-tree" | "xm-snowman" | "xm-ginger" | "xm-deer" | "xm-stocking" | "xm-cane" | "xm-globe" | "xm-santa" | "xm-cocoa" | "xm-bauble" | "xm-mochi-hat" | "xm-chirp-hat" | "xm-waddle-scarf" | "xm-miso-antlers" | "xm-kiki-muffs" | "xm-pokey-mittens" | "xm-pud-holly" | "xm-chime-holly" | "sf-tangyuan" | "sf-hongbao" | "sf-firecracker" | "sf-fu" | "sf-nian" | "sf-knot" | "sf-orange" | "sf-goat" | "sf-koi" | "sf-ingot" | "sf-kiki-tiger" | "sf-waddle-scarf" | "sf-hop-lantern" | "sf-maru-collar" | "sf-mochi-fu" | "sf-lulu-crackers" | "sf-nook-couplets" | "sf-chirp-lion" | "ma-mooncake" | "ma-rabbit" | "ma-lantern" | "ma-osmanthus" | "ma-moon" | "ma-pomelo" | "ma-skylantern" | "ma-crab" | "ma-mochi-ears" | "ma-hop-cake" | "ma-chirp-cake" | "ma-lulu-pin" | "ma-kiki-pin" | "ma-miso-lamp" | "ma-waddle-lamp" | "ma-bao-hat" | "ma-pip-hat" | "ea-dapple" | "ea-wicker" | "ea-cocoa" | "ea-crunchy" | "ea-posy" | "ea-breezy" | "ea-peeky" | "ea-hop-crown" | "ea-chirp-shell" | "ea-mochi-ears" | "ea-momo-ears" | "ea-waddle-shell" | "ea-kiki-crown" | "ea-lulu-bow" | "ea-hammy-basket" | "sm-popsicle" | "sm-coconut" | "sm-ring" | "sm-castle" | "sm-fan" | "sm-ice" | "sm-pineapple" | "sm-shell" | "sm-cicada" | "sm-miso-shades" | "sm-waddle-goggles" | "sm-chirp-hat" | "sm-hop-hat" | "sm-bruno-melon" | "sm-koko-lei" | "sm-leo-sunscreen" | "sm-scoop-shades" | "vl-bonbon" | "vl-rose" | "vl-cherub" | "vl-ring" | "vl-dove" | "vl-dipped" | "vl-mochi-stickers" | "vl-miso-bowtie" | "vl-waddle-bowtie" | "vl-bruno-rose" | "vl-hop-glasses" | "vl-oink-stickers" | "vl-kiki-letter" | "vl-chirp-headband"——
    classNamestring——
    face"symbol" | "capsule" | "cute" | "eyes" | "line" | "brow" | "glossy" | "sparkle" | "button" | "shades" | "droopy" | "bigmouth" | "pie" | "screen" | "teardrop" | "specs"—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: ColorId) => void)——
    onSelectFace((face: "symbol" | "capsule" | "cute" | "eyes" | "line" | "brow" | "glossy" | "sparkle" | "button" | "shades" | "droopy" | "bigmouth" | "pie" | "screen" | "teardrop" | "specs") => void)——
    onSelectNose((nose: "slant" | "angular" | "hook" | "long" | "curve" | "bow") => void)——
    onSelectShape((shape: ShapeId) => void)——
    sizePxnumber—Size of each preview. Defaults to `SELECTOR_MARK_PX`.
    styleCSSProperties——

    Next