- Label
- Icon label
- Field
- Form
- Frontmatter form
- Questionnaire
- Input
- Input group
- Input OTP
- Password input
- Password strength
- Code input
- Number field
- Tag input
- Textarea
- Checkbox
- Radio group
- Language toggle group
- Emoji appearance toggle group
- Emoji picker
- Avatar picker
- AI provider picker
- Select
- Native select
- Combobox
- Language combobox
- Slider
- Calendar
- Switch
- Alert
- Avatar
- Badge
- Card
- AI provider card
- Model info card
- Model list
- Empty
- Item
- Tree item
- File tree
- Icon media
- File type icon
- Font preview
- Image preview
- Kbd
- Table
- Data table
- Data table column header
- Chart
- Code Block
- Code card
- Markdown view
- Attachment
- Bubble
- Marker
- Message
- Chat message
- Chat suggestion item
- Message scroller
- Trace
- Progress
- Spinner
- Sonner
- Toast
- Unsaved changes toolbar
- Unsaved indicator
- Status indicator
- Permission card
- Separator
- Skeleton
- Animated grid pattern
- Meteors
A single-choice row of swatches for choosing the Fluent emoji artwork style, each previewing the same sample emoji in its own style.
Installation#
pnpm dlx shadcn@latest add @zui/emoji-appearance-toggle-groupThe CLI writes components/data-entry/emoji-appearance-toggle-group.tsx, installs
Toggle group, Utils and the Fluent emoji lib, which draws the
artwork through expo-image from https://fluent-emoji.zeroxsolutions.com, and adds expo-image and
@zeroxsolutions/fluent-emoji, whose catalog entry lists which glyphs have artwork in each style.
Usage#
import {
EmojiAppearanceToggleGroup,
EmojiAppearanceToggleGroupItem,
} from '@/components/data-entry/emoji-appearance-toggle-group';
import { Text } from '@/components/ui/text';
import type { FluentEmojiStyle } from '@/lib/fluent-emoji';<EmojiAppearanceToggleGroup value={style} onValueChange={setStyle}>
<EmojiAppearanceToggleGroupItem value="3d">
<Text>3D</Text>
</EmojiAppearanceToggleGroupItem>
<EmojiAppearanceToggleGroupItem value="flat">
<Text>Flat</Text>
</EmojiAppearanceToggleGroupItem>
</EmojiAppearanceToggleGroup>Compose one EmojiAppearanceToggleGroupItem per style the app offers, as the group's direct children; the preview
emoji is the selector, so a style is always chosen. This is an app-level appearance control, not an emoji picker:
the style is a preference the app persists and applies everywhere it draws a Fluent emoji, by passing it as
FluentEmoji's variant.
Composition#
EmojiAppearanceToggleGroup
`-- EmojiAppearanceToggleGroupItemAPI reference#
EmojiAppearanceToggleGroup#
Takes every prop of ToggleGroup except type, which it fixes to
single, and value and onValueChange, which are redefined:
| Prop | Type | Default |
|---|---|---|
value | FluentEmojiStyle | required |
onValueChange | (style: FluentEmojiStyle) => void | required |
FluentEmojiStyle is '3d' | 'flat' | 'modern' | 'mono' | 'anim'. The group is announced as a radio group,
named "Emoji style" unless given an aria-label, and pressing the checked swatch reports nothing. It defaults
variant to outline, keeps the toggle group's default spacing, and wraps its swatches onto further rows when
narrower than they are.
EmojiAppearanceToggleGroupItem#
Takes every prop of ToggleGroupItem except value, which is redefined:
| Prop | Type | Default |
|---|---|---|
value | FluentEmojiStyle | required |
One swatch, announced as a radio named by its label alone: the grinning face drawn 24px in value's style,
hidden from a screen reader, before the label, a Text child. The anim swatch plays its frames, and the black
mono artwork is tinted the foreground colour. Where the artwork cannot be loaded, the swatch draws the emoji as
text.
Differences from the web#
- The artwork comes from
https://fluent-emoji.zeroxsolutions.comthroughexpo-image, which draws svg and animated webp on both platforms, where the web draws the files@zeroxsolutions/fluent-emojiserves. monotakes the foreground colour, where the web inverts the black artwork in the dark theme.- Its label goes in each item as a Text child, where the web's item takes the string itself.
- The web's
data-slotattributes are not set; a View takes no data attributes.