Components
Emoji Toolbar Dropdown
Emoji Toolbar Dropdown
Display an emoji selection menu within a toolbar interface.
Installation
npx shadcx@latest add emoji-toolbar-dropdown -r plate-ui
Examples
import React from 'react';
import {
type EmojiDropdownMenuOptions,
useEmojiDropdownMenuState,
} from '@udecode/plate-emoji/react';
import { Icons } from '@/components/icons';
import { emojiCategoryIcons, emojiSearchIcons } from './emoji-icons';
import { EmojiPicker } from './emoji-picker';
import { EmojiToolbarDropdown } from './emoji-toolbar-dropdown';
import { ToolbarButton } from './toolbar';
type EmojiDropdownMenuProps = {
options?: EmojiDropdownMenuOptions;
} & React.ComponentPropsWithoutRef<typeof ToolbarButton>;
export function EmojiDropdownMenu({
options,
...props
}: EmojiDropdownMenuProps) {
const { emojiPickerState, isOpen, setIsOpen } =
useEmojiDropdownMenuState(options);
return (
<EmojiToolbarDropdown
control={
<ToolbarButton pressed={isOpen} tooltip="Emoji" isDropdown {...props}>
<Icons.emoji className="size-4" />
</ToolbarButton>
}
isOpen={isOpen}
setIsOpen={setIsOpen}
>
<EmojiPicker
{...emojiPickerState}
icons={{
categories: emojiCategoryIcons,
search: emojiSearchIcons,
}}
isOpen={isOpen}
setIsOpen={setIsOpen}
settings={options?.settings}
/>
</EmojiToolbarDropdown>
);
}
Build your editor even faster
Complete, deployable AI-powered template with backend.
All components included.
Customizable and extensible.
Get all-accessCustomizable and extensible.