CompactCharacterPicker
裁到刚好能放在注册表单旁边的选择器。
形状
配色
选项少是有意的
只给一小撮墨色和形状,而不是整本目录。形状是 AUTO_SHAPE_POOL——在 16px 下仍然读得出是个角色的形状;少掉的那种墨色是 black,它被保留为默认墨色,没人会把它当成一个选择(ASSIGNABLE_COLOR_IDS)。一个人决定自己第一个智能体长什么样时,想要的是几个显而易见的选项,而不是整本目录;完整网格属于他们稍后可以打开的编辑器。
组件和普通选择器一样是受控的,两组选项排在同一行。
API
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
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" | — | — |
className | string | — | — |
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. |
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: "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) | — | — |
sizePx | number | — | Size of each preview. Defaults to `PICKER_MARK_PX`. |
style | CSSProperties | — | — |
接下来
- CharacterPicker——受控的选择网格
- 角色设置——挑选智能体的外观