Cross-Browser Emoji Rendering

theodore-js

Theodore is a text input that replaces emoji characters with custom images, ensuring consistent display across all browsers

😊Consistent Rendering
🌐Cross-Browser
Lightweight
😀
🎉
❤️

Try It Live

Experience consistent emoji rendering in action


Try typing with emojis! 😊

Quick Insert:

Why theodore-js?

Use Theodore in web apps to consistently render emojis on every browser

Cross-Browser Compatibility

Ensures emojis look the same on Chrome, Firefox, Safari, Edge, and all modern browsers.

Ctrl+Z Undo Support

Built-in undo history so users can revert edits instantly with Ctrl+Z.

Lightweight & Fast

Minimal overhead with maximum performance. Won't slow down your application.

TypeScript Support

Fully typed definitions for a better developer experience and fewer bugs.

Quick Start

Get up and running in seconds

Installation

npm install theodore-js

Basic Usage

import React, { useRef } from 'react';
import { Theodore, TheodoreHandle, useEditorState } from 'theodore-js';
import 'theodore-js/style.css';

const renderEmoji = (emoji: string) => {
  if (emoji === '') return <></>;
  const unified = nativeToUnified(emoji);
  const path = `/img-apple-64/${unified}.png`;
  return <img src={path} width={22} height={22} alt={emoji} />;
};

export const TheodoreTextInput: React.FC = () => {
  const theodoreRef = useRef<TheodoreHandle>(null);
  const editorState = useEditorState();

  const handleSelectEmoji = (emoji: { native: string }) => {
    theodoreRef.current?.insertEmoji(emoji.native);
  };

  return (
    <Theodore
      ref={theodoreRef}
      editorState={editorState}
      renderEmoji={renderEmoji}
      placeholder="Write something..."
      maxLines={5}
    />
  );
};

📚 Documentation

For more detailed examples, API reference, and advanced usage, visit the documentation on github.

View on GitHub