Components
Emoji Dialog
A styled modal dialog with built-in memoji avatars, animated glassmorphism circle, speech bubbles, and a decorative grid background pattern.
Installation
bunx @happlyui/cli@latest add emoji-dialog
Dependencies
npm packages
@radix-ui/react-dialog@remixicon/reactframer-motion
Registry dependencies
These are automatically installed when you add this component.
tvhapply-ui-utilsmemoji
Usage
import * as EmojiDialog from "@/components/ui/emoji-dialog"
<EmojiDialog.Root>
<EmojiDialog.Trigger>Open</EmojiDialog.Trigger>
<EmojiDialog.Content>
<EmojiDialog.EmojiArea memoji={{ gender: 'female', person: 'angela', skinTone: 'black', posture: 'happy-1' }}>
<EmojiDialog.Bubble>Hello!</EmojiDialog.Bubble>
</EmojiDialog.EmojiArea>
<EmojiDialog.Header>
<EmojiDialog.Title>Welcome</EmojiDialog.Title>
<EmojiDialog.Description>Dialog description</EmojiDialog.Description>
</EmojiDialog.Header>
<EmojiDialog.Footer>
<EmojiDialog.Close>Cancel</EmojiDialog.Close>
</EmojiDialog.Footer>
</EmojiDialog.Content>
</EmojiDialog.Root>
Examples
Welcome Dialog
A welcoming onboarding dialog with a friendly memoji and tour prompt.
<EmojiDialog.Root>
<EmojiDialog.Trigger asChild>
<Button.Root>Open Welcome Dialog</Button.Root>
</EmojiDialog.Trigger>
<EmojiDialog.Content>
<EmojiDialog.EmojiArea memoji={{ gender: 'female', person: 'angela', skinTone: 'black', posture: 'happy-1' }}>
<EmojiDialog.Bubble icon={<RiSparklingLine />}>Welcome aboard!</EmojiDialog.Bubble>
</EmojiDialog.EmojiArea>
<EmojiDialog.Header>
<EmojiDialog.Title>Welcome to Happly!</EmojiDialog.Title>
<EmojiDialog.Description>Your workspace is ready.</EmojiDialog.Description>
</EmojiDialog.Header>
<EmojiDialog.Footer>
<EmojiDialog.Close asChild><Button.Root variant='neutral' mode='stroke'>Skip Tour</Button.Root></EmojiDialog.Close>
<Button.Root>Start Tour</Button.Root>
</EmojiDialog.Footer>
</EmojiDialog.Content>
</EmojiDialog.Root>
Delete Confirmation
Danger-variant bubble for irreversible destructive actions with multi-line description.
<EmojiDialog.Content>
<EmojiDialog.EmojiArea memoji={{ ... posture: 'sad-3' }}>
<EmojiDialog.Bubble variant='danger' icon={<RiDeleteBinLine />}>This can't be undone</EmojiDialog.Bubble>
</EmojiDialog.EmojiArea>
<EmojiDialog.Header>
<EmojiDialog.Title>Delete Your Account?</EmojiDialog.Title>
<EmojiDialog.Description lines={['All data will be removed.', 'This cannot be reversed.']} />
</EmojiDialog.Header>
...
</EmojiDialog.Content>
Unsaved Changes
Warning-variant bubble prompting users to save before navigating away.
<EmojiDialog.EmojiArea memoji={{ ... posture: 'thinking-28' }}>
<EmojiDialog.Bubble variant='warning' icon={<RiAlertLine />}>Wait a moment!</EmojiDialog.Bubble>
</EmojiDialog.EmojiArea>
Success Confirmation
A clean success dialog without background grid, ideal for payment or completion flows.
<EmojiDialog.Content showBackground={false}>
<EmojiDialog.EmojiArea memoji={{ ... posture: 'party-11' }}>
<EmojiDialog.Bubble icon={<RiCheckLine />}>All done!</EmojiDialog.Bubble>
</EmojiDialog.EmojiArea>
...
</EmojiDialog.Content>
With Form Content
Demonstrates custom form fields between header and footer for data collection dialogs.
<EmojiDialog.Content>
<EmojiDialog.EmojiArea memoji={{ ... }} />
<EmojiDialog.Header>
<EmojiDialog.Title>Invite a Teammate</EmojiDialog.Title>
<EmojiDialog.Description>Send an invite.</EmojiDialog.Description>
</EmojiDialog.Header>
<div className='relative z-10 flex flex-col gap-4'>
<Label.Root>Email</Label.Root>
<Input.Root>...</Input.Root>
</div>
<EmojiDialog.Footer>...</EmojiDialog.Footer>
</EmojiDialog.Content>
Floating Memojis
Satellite memoji avatars floating around the main avatar, great for team or community dialogs.
<EmojiDialog.EmojiArea floatingMemojis memoji={{ ... posture: 'party-11' }}>
<EmojiDialog.Bubble>We're glad you're here!</EmojiDialog.Bubble>
</EmojiDialog.EmojiArea>
Static (No Animations)
All entry and floating animations disabled for reduced-motion or static contexts.
<EmojiDialog.Content disableAnimations>...</EmojiDialog.Content>
Custom Emoji Area
Fully custom emoji area content using native emoji instead of memoji avatars.
<EmojiDialog.EmojiArea customContent>
<div className='flex items-end justify-center gap-2 text-[64px]'>πππ</div>
</EmojiDialog.EmojiArea>
API Reference
EmojiDialog.Root
Wraps the trigger and content. Passes through Radix Dialog.Root props.
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | - | Controlled open state |
onOpenChange | (open: boolean) => void | - | Callback when open state changes |
EmojiDialog.Content
The modal popup with overlay, close button, and optional decorative background.
| Prop | Type | Default | Description |
|---|---|---|---|
showClose | boolean | true | Show the close button |
showBackground | boolean | true | Show the decorative grid background |
disableAnimations | boolean | false | Disable all entry and floating animations |
EmojiDialog.EmojiArea
Container for the avatar with glassmorphism circle. Supports built-in memoji or custom content.
| Prop | Type | Default | Description |
|---|---|---|---|
memoji | MemojiConfig | - | Memoji configuration for automatic avatar rendering |
customContent | boolean | false | Bypass default layout for fully custom content |
floatingMemojis | boolean | false | Show satellite memoji avatars floating around the main avatar |
EmojiDialog.Bubble
Speech bubble positioned above the avatar in the emoji area.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'secondary' | 'warning' | 'danger' | 'secondary' | Color variant |
icon | ReactNode | - | Icon displayed in a circular container |
children | ReactNode | - | Bubble text content |
EmojiDialog.Header
Centered container for title and description.
| Prop | Type | Default | Description |
|---|
EmojiDialog.Title
The dialog title.
| Prop | Type | Default | Description |
|---|
EmojiDialog.Description
The dialog description. Supports multi-line via lines prop.
| Prop | Type | Default | Description |
|---|---|---|---|
lines | string[] | - | Array of lines rendered with <br /> between them |
EmojiDialog.Footer
Container for action buttons. Row on desktop, stacked on mobile.
| Prop | Type | Default | Description |
|---|
EmojiDialog.Close
Closes the dialog when clicked.
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render as child element |
EmojiDialog.Background
Decorative grid pattern. Included automatically via showBackground prop.
| Prop | Type | Default | Description |
|---|---|---|---|
opacity | number | 0.15 | Grid line opacity |