APTalkmoji Display Styles
Docs›Getting Started

Display Styles

The same talking character, dressed for different places on your site: a profile card, a hero, a banner, a full-screen voice stage, a header strip, a phone-call screen, a studio with a message bar, or a game-style dialogue box. Each style is drawn inside the embed, so one pasted snippet looks identical on every site and your page's CSS can't change it. Your chat widget keeps working exactly as before.

✅

Fastest route: open your project in the dashboard, go to Install code → Display styles, pick a style, try it in the live preview, and copy the snippet. It already contains your project ID and your choices.

The styles

data-layoutWhat it looks likeWhere it fitsBox size
cardThe character stands in front of a circle on a rounded card, with name, tagline and a talk button. Optional level pill and XP bar.Team page, sidebar, a game's profile screen.about 320 × 470
heroA big character on a scene, a round mic at the bottom, optional headline.Top of a landing page.full width × 520
voiceA full-screen stage: large subtitles, a chat button, a big mic and a close button."Talk to us" button, mobile voice assistant.opens full screen
studioA wide stage with a message bar along the bottom: type, press Ask.Demos, playgrounds, "ask me anything" pages.full width × 520
callA close-up with phone-call controls: mute, one big call button, options.Support and sales call buttons.opens full screen
headerA slim rounded strip: the face, the name, a line of text and a mic.Inside your site's header or nav.full width × 76
bannerA headline, tagline and talk button on the left, the character on the right.Promo and call-to-action banners.full width × 300
gameThe character beside an in-game dialogue box with a name tag, level and message bar.Games, quests, tutorials, kids' apps.full width × 480

Set it once in the dashboard

Open your chatbot, go to Widget design → Display style, pick a style (Corner chat is the default) and press Save. The install script you already pasted, embed-loader.js, then draws that style on your site. No new code needed.

  • Voice stage and Call open full screen from a floating button; a header strip goes to the top of the page; the rest float in the corner.
  • To put an inline style (card, hero, banner, studio, game, just the face) inside a part of your page, add data-target="#some-element" to the tag.
  • The background picture you upload under Widget design is used as the style's background and as the chat background.
  • To keep one tag as the classic corner chat whatever is saved, add data-classic="1".

The snippets below are for placing a style yourself, for example a second style on another page.

1. Paste it

For the inline styles (card, hero, studio, header, banner, game), add an element where it should appear and the script. The style fills the element.

<div id="talkmoji-hero" style="width:100%;height:520px"></div>
<script src="https://talkmoji.com/js/talkmoji-character.js"
        data-bot="YOUR_PUBLIC_ID"
        data-layout="hero"
        data-scene="tech"
        data-title="Meet Maya"
        data-tagline="Your host for the day"
        data-target="#talkmoji-hero" defer></script>

The full-screen styles (voice, call) need no element. A floating "Voice chat" button appears; visitors tap it to open the stage, and the X (or the Escape key) closes it and ends the voice session.

<script src="https://talkmoji.com/js/talkmoji-character.js"
        data-bot="YOUR_PUBLIC_ID"
        data-layout="voice" defer></script>

<!-- or open it from your own button instead of the floating one: -->
<button id="talk-button">Talk to us</button>
<script src="https://talkmoji.com/js/talkmoji-character.js"
        data-bot="YOUR_PUBLIC_ID"
        data-layout="voice"
        data-trigger="#talk-button"
        data-launcher="0" defer></script>

2. Options

All optional. Every data-* attribute is also a key of TalkmojiCharacter.mount({ ... }).

AttributeDefaultWhat it does
data-layoutbare charactercard, hero, voice, studio, call, header, banner or game.
data-sceneper styleThe background: office, office-cool, tech, forest, sunset, plain, dark, or none for a transparent background.
data-bgnoneAn https:// image URL used instead of the scene. Anything else is ignored.
data-title, data-taglinethe character's nameThe name and the line under it (card, header, banner, game, and optionally hero and call).
data-ctaTalk to meText of the talk button (card, banner).
data-level, data-xp, data-xpmaxhiddenA "LvL 30" pill and an XP bar (card), or just the level on the name tag (game).
data-actionaskWhat the message bar does (studio, game): ask answers the typed question from your knowledge base, say speaks exactly what was typed.
data-captionsper style1 or 0. Voice, studio, header and game show subtitles by default.
data-mic, data-greeton0 hides the mic / skips the spoken welcome.
data-accentyour project colourHex colour without the #, for buttons and highlights.
data-trigger, data-launcher, data-label, data-positionpill onFull-screen styles: a CSS selector for your own opening button, 0 to hide the floating pill, the pill's text, and left to move it to the left.

3. Control it from your code

const character = TalkmojiCharacter.get('YOUR_PUBLIC_ID');

character.open();                          // full-screen styles: show the stage
character.close();                         // ...and end the session
character.update({ level: 31, xp: 120, xpmax: 6600, tagline: 'Quest complete!' });
character.say('Welcome back!');            // speaks this exact text (opens a closed stage first)
character.ask('What are your hours?');     // answers out loud from your knowledge base

character.on('open',  () => pauseMusic());
character.on('close', () => resumeMusic());

Everything from Talking Character Only (events, say(), ask(), the React and React Native components) works the same in every style.

No JavaScript? Use the iframe

<iframe src="https://talkmoji.com/e/YOUR_PUBLIC_ID?mode=scene&layout=card&level=30"
        allow="microphone; autoplay" title="Talking character"
        style="width:320px;height:470px;border:0;background:transparent;color-scheme:normal"></iframe>

The URL options are the same names without data-: layout, scene, bg, title, tagline, cta, level, xp, xpmax, action, captions, mic, greet, accent.

Good to know

  • One placement per project per page. A project's character starts one voice session, so mounting two styles of the same project on one page returns the first. Use a second project for a second character.
  • Full-screen styles load nothing until opened. No voice session is started (or counted) until a visitor taps the button.
  • Browsers block sound until the visitor interacts. The full-screen styles open from a tap, so they can greet out loud. For inline styles, the first spoken line may wait for a click.
  • Voice not available? If your monthly usage is used up or voice isn't set up, the styles hide their mic and call buttons and the message bar still answers in text.
  • Free plan badge. The small "Powered by Talkmoji" badge appears on the Free plan, as it does in the chat widget.
  • Allowed domains in your project settings apply to every style.
  • Your own character. Want a mascot of your own in any of these styles? Order a custom character: send us an image and we build it as a talking character that only appears in your account.