CompactCharacterSelector
精简到可以放在注册表单旁边的选择器。
形状
配色
选项少是有意的
它只提供少量墨色和形状,不列出完整目录。形状取自 AUTO_SHAPE_POOL,这些形状在 16px 下仍能认出是角色。墨色取自 ASSIGNABLE_COLOR_IDS,即 id 散列后会落到的十一种鲜亮色相;默认墨色 black、近白色和低饱和的颜色只出现在完整的编辑器里。用户在决定第一个智能体的外观时,需要的是几个一目了然的选项。完整的选择网格放在之后可以打开的编辑器里。
和普通选择器一样,这个组件是受控的,两组选项排在同一行。
API
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
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" | — | — |
className | string | — | — |
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. |
lineWeight | number | — | — |
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) | — | — |
sizePx | number | — | Size of each preview. Defaults to `SELECTOR_MARK_PX`. |
style | CSSProperties | — | — |
接下来
- CharacterSelector——受控的选择网格
- 角色设置——为智能体选择外观