Emoji Picker
more-shadcn-noair/emoji-pickerFreeComponent
A self-contained emoji picker with categories, search, skin tones and recents.
Live preview
live · rendered by the registry
Rendered by more-shadcn-noair on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://more-shadcn.noair.fun/r/emoji-picker.jsonSource
1<script lang="ts">2 import { cn } from '$UTILS$';3 import { tick } from 'svelte';4 import {5 Clock,6 Smile,7 Hand,8 Leaf,9 Coffee,10 Dumbbell,11 Plane,12 Lightbulb,13 Hash,14 Flag,15 Search,16 X17 } from '@lucide/svelte';18 import {19 emojiCategories,20 applySkinTone,21 SKIN_TONES,22 type Emoji,23 type EmojiCategoryId24 } from './emoji-data';2526 let {27 value = $bindable(''),28 skinTone = $bindable(0),29 recents = $bindable<string[]>([]),30 columns = 9,31 maxRecents = 18,32 showSearch = true,33 showCategories = true,34 showSkinTones = true,35 showRecents = true,36 showPreview = true,37 persistKey = 'more-shadcn:emoji',38 searchPlaceholder = 'Search emoji...',39 class: className,40 onSelect,41 ...rest42 }: {43 value?: string;44 skinTone?: number;45 recents?: string[];46 columns?: number;47 maxRecents?: number;48 showSearch?: boolean;49 showCategories?: boolean;50 showSkinTones?: boolean;51 showRecents?: boolean;52 showPreview?: boolean;53 /** Set to `null` to disable persisting recents and the skin tone. */54 persistKey?: string | null;55 searchPlaceholder?: string;56 class?: string;57 onSelect?: (emoji: string, data: Emoji) => void;58 [key: string]: unknown;59 } = $props();6061 const CATEGORY_ICONS: Record<EmojiCategoryId, typeof Smile> = {62 recent: Clock,63 smileys: Smile,64 people: Hand,65 nature: Leaf,66 food: Coffee,67 activity: Dumbbell,68 travel: Plane,69 objects: Lightbulb,70 symbols: Hash,71 flags: Flag72 };7374 /** Base character -> emoji, so stored recents can be resolved back to data. */75 const byChar = new Map<string, Emoji>(76 emojiCategories.flatMap((c) => c.emojis.map((e) => [e.e, e] as const))77 );7879 let query = $state('');80 let hovered = $state<Emoji | null>(null);81 let activeIndex = $state(-1);82 let activeCategory = $state<EmojiCategoryId>('smileys');83 let tonesOpen = $state(false);84 let hydrated = $state(false);8586 let scrollRef = $state<HTMLDivElement | null>(null);87 let sectionRefs: Partial<Record<EmojiCategoryId, HTMLDivElement>> = {};8889 const recentEmojis = $derived(90 recents.map((char) => byChar.get(char)).filter((e): e is Emoji => Boolean(e))91 );9293 const sections = $derived.by(() => {94 const needle = query.trim().toLowerCase();9596 if (needle) {97 const matches = emojiCategories.flatMap((category) =>98 category.emojis.filter(99 (emoji) => emoji.n.includes(needle) || emoji.k?.includes(needle) || emoji.e === needle100 )101 );102// … truncated
More from more-shadcn-noair
All 43 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Audioaudio | more-shadcn-noair | Components | Free | no deps | |
| Audio Waveaudio-wave | more-shadcn-noair | Components | Free | no deps | |
| Autocompleteautocomplete | more-shadcn-noair | Components | Free | no deps | |
| Bannerbanner | more-shadcn-noair | Components | Free | no deps | |
| Big Calendarbig-calendar | more-shadcn-noair | Components | Free | no deps | |
| Bottom Navigationbottom-nav | more-shadcn-noair | Components | Free | no deps | |
| Canvascanvas | more-shadcn-noair | Components | Free | no deps | |
| Chipchip | more-shadcn-noair | Components | Free | no deps |
