Guides

Add a Tamil Typing Widget to Your Website

உங்கள் இணையதளத்தில் தமிழ் தட்டச்சு

Let your visitors type Tamil in English letters, right in your comment box, contact form or search field. One script tag, no account, no cost.

Updated By TypeTamilOnline EditorialHow we check guides

Short answer

Add <script src="https://typetamilonline.com/embed/v1.js" defer></script> to your page, then put data-tamil-typing on any <textarea> or text <input>. Visitors type vanakkam, press space and get வணக்கம், with other spellings one tap away.

Live Demo: A Plain Form With the Script Added

Type a word in English letters and press space.nanriநன்றி

Add It in Two Steps

  1. Paste the script tag once per page, just before </body>. In most site builders this is a “footer code” or “custom HTML” setting.

  2. Add data-tamil-typing to each text box that should accept Tamil. Text inputs and textareas work; email, password and number fields are skipped on purpose.

That is all. Fields added later, for example by a form plugin or a single-page app, are picked up automatically.

Copy-Paste Snippets

Plain HTMLHTML
<!-- once per page, before </body> -->
<script src="https://typetamilonline.com/embed/v1.js" defer></script>

<!-- on any text box -->
<textarea name="message" data-tamil-typing></textarea>
<input type="text" name="title" data-tamil-typing>
WordPress comment boxPHP
// In your child theme's functions.php, or as a PHP snippet
// in a code snippets plugin. #comment is the comment box.
add_action( 'wp_footer', function () {
  echo '<script src="https://typetamilonline.com/embed/v1.js"'
    . ' data-selector="#comment" defer></script>';
} );
ReactJSX
// 1. Load the script once, in index.html or your root layout:
//    <script src="https://typetamilonline.com/embed/v1.js" defer></script>

// 2. Mark any field. Controlled fields work: onChange fires as usual.
export function CommentBox() {
  const [text, setText] = useState('');
  return (
    <textarea
      data-tamil-typing=""
      value={text}
      onChange={(e) => setText(e.target.value)}
    />
  );
}

On WordPress you usually can’t edit the comment box markup, so the snippet uses data-selector to point at it instead: #comment is the comment field WordPress itself prints. Use a comma-separated list to add more fields, such as #comment, .wpcf7-textarea. The widget is written in plain JavaScript, so it also works with Vue, Svelte, Angular and plain HTML forms.

Options

Everything is set with data- attributes, so there is no code to write.

Embed options
AttributeWhereWhat it does
data-tamil-typingFieldTurns Tamil typing on for this field. ="off" turns it off.
data-selectorScript tagA CSS selector for fields you can’t edit, such as #comment.
data-tamil-typing-creditAny elementShows one credit line there, instead of one under each field. The demo above uses it.
data-lexiconScript tag="off" skips the 652 KB word list (suggestions get a little worse). A URL loads your own copy.
data-themeScript taglight or dark for the suggestion box. By default it matches the field’s background.

For pages that build their own fields in JavaScript, TamilTyping.attach(element) and TamilTyping.detach(element) switch a field on and off directly.

What Your Visitors Can Do

Keys in a Tamil typing field
KeyAction
Space or punctuationConverts the word just typed
↑ ↓, then EnterPicks another spelling (or tap it)
1 to 6Picks a spelling by its number
EscKeeps the word in English letters
Backspace right after a word convertsBrings back the English letters
Ctrl + GSwitches the field between Tamil and English

The suggestion list works with screen readers: the field announces the highlighted spelling, and the list is a standard listbox. Pasted text is never changed, and email addresses and web links typed into a field stay in English letters. Ctrl+Z undoes a conversion like any other edit.

Privacy

Everything happens in the visitor’s browser. What they type is never sent to us or to anyone else, and the widget sets no cookies and loads no analytics.

The one network request is the word list, downloaded from typetamilonline.com the first time a visitor clicks into a Tamil field. Like any file fetched from another site, that request shows our hosting provider the visitor’s IP address and your site’s address, as described in our privacy policy. It never includes their text. To avoid it entirely, host both files yourself or set data-lexicon="off".

Spellings a visitor picks are remembered in their own browser’s storage for your site (under the key tamil-typing:history), so their usual words come first next time. Clearing site data removes them.

The Credit Link

By default a small line, “Tamil typing by TypeTamilOnline”, appears under each Tamil field. It is a normal link to our home page, and it inherits your text colour so it fits your design.

The credit is the one condition of free use, and it can’t be switched off. You can restyle it to match your site, or show one credit for the whole page by adding data-tamil-typing-credit to any element. If the credit is removed, hidden, made unreadable or moved off screen, the widget puts it back; if it still can’t be seen, Tamil typing pauses with a short notice until it is visible again. To use the widget without a credit, contact us.

Size and Speed

  • The script is about 19 KB compressed, with the core Tamil word list built in. It loads with defer and never blocks your page.

  • The full word list (652 KB, 200,000 Tamil words) improves suggestions. It is fetched only after a visitor focuses a Tamil field, decoded off the main thread, cached for a year, and skipped when the visitor has Data Saver on. Until it arrives, typing works with the built-in list.

  • No fonts are downloaded: suggestions use the Tamil font already on the visitor’s device.

  • Styles are scoped to the widget’s own elements, so they can’t change the look of your page, and your page’s styles can’t break the suggestion box.

Licence

The script’s code is under the TypeTamilOnline Attribution Licence: use it on any site, commercial or not, and host or modify your own copy, as long as the credit link stays visible. It also contains data adapted from the Dakshina dataset by Google Research, as does the word list. That data is licensed under CC BY-SA 4.0: using the widget on your site is fine, and if you redistribute the data files, keep the attribution in the file header and share any changed data under the same licence. Details are in the comment at the top of v1.js.

The URL ends in v1 on purpose: fixes and better word lists arrive automatically, and anything that would change how your fields behave would ship as a new version instead.

Questions People Ask

Is the Tamil typing widget free?

Yes, for any website, including commercial ones. There is no account, no API key and no usage limit. The one condition is that the small credit link stays visible. Use the example above to add it to a supported text field and test the finished form before publishing it. The widget does not replace your form’s submission code.

Does it work on phones?

Yes. It reacts to the text the keyboard inserts rather than to key codes, which is how phone keyboards report typing. On a narrow screen the suggestions show as one row of large tap targets under the line being typed.

Will it slow down my site?

The script is about 19 KB compressed and loads with defer, so it never blocks your page from showing. It loads no fonts and sets no cookies. The 652 KB word list is only downloaded after a visitor clicks into a Tamil field, and the browser then keeps it for a year.

Does it work in the WordPress post editor?

No. It works on plain text boxes: comment forms, contact forms, search boxes. Rich text editors such as the block editor, TinyMCE or Google Docs use a different kind of editing area that the widget does not support. Use the plain-field example above instead.

Can I host the script myself?

Yes. Download v1.js and the word list, put both on your server, and point the script tag at your copy. Keep the licence comment at the top of the file and the credit link visible. Then the widget makes no requests to our site at all.

Can I remove the credit link?

No. The credit is the one condition of free use. You can restyle it, or show a single credit for the whole page with data-tamil-typing-credit, but it has to stay visible. If it is removed or hidden, the widget puts it back, and if it still cannot be seen, Tamil typing pauses until it is. To use the widget without a credit, contact us.

Which form fields can use the Tamil typing widget?

Add data-tamil-typing to a supported plain text input or textarea, then load the script as shown above. Keep your existing form labels and submission handling. The widget changes field text while visitors type; it does not create a form, translate submitted messages or add a backend to store them.

Can I enable Tamil typing in only one field?

Yes. Mark only that input or textarea with data-tamil-typing instead of enabling every field. Leave email addresses, passwords and other unrelated fields outside the integration. You can set data-tamil-typing="off" on a previously marked field to detach the widget without removing the field from your form.

Will the widget find a textarea added after the page loads?

Yes. It watches for added elements and attaches to supported fields marked for Tamil typing. Add the same data-tamil-typing attribute when your code creates the textarea. Test the actual form after inserting it, including suggestions, credit visibility and submission, rather than relying only on a static example.

Does embedding the widget send visitors’ typed text to your server?

No. The widget converts field text in the visitor’s browser. Loading the hosted script and word list makes resource requests to this site, but those are separate from uploading field contents. Your own form submission still goes wherever your form sends it, so explain that behaviour in your site’s privacy information.

Sources

Every step on this page was checked against these official pages on . Menu names can change with software updates. If yours look different, tell us.

  1. WordPress Developer Resources: comment_form() developer.wordpress.org
  2. WordPress Developer Resources: wp_footer hook developer.wordpress.org