Themes

Customize your chat UI with TalkJS Themes

Themes give you complete control over the styling, layout, and document structure of the TalkJS pre-built UI. From quick tweaks to fonts and colors, to completely changing the markup in certain areas.
Avatar
Andrea
1 day ago
This looks beautiful. How far away are we from shipping this?
Avatar
Robbie
6 hours ago
I think we're pretty much there. Just some final stage testing.
Avatar
Nikki
5 hours ago
That's right. We'll be good to ship this within the next 48 hours. Any delays, I'll let you know by tomorrow.
Avatar
Ivan
4 hours ago
Thanks for the feedback folks. Really happy with how this one turned out.
Avatar
Rupert
1 min ago
Late in commenting, but as long as this meets our accessibility standards, this looks excellent and good to ship IMO.
We should be good to go!
Avatar
Izabella
Right folks, where are we going for climbing trip this spring?
7m ago
Avatar
Jakob
I was thinking Brione in Switzerland or Alberaccin in Spain.
6m ago
Avatar
Louis
Swizzy for me. What month?
5m ago
Avatar
Callum
Yes, Brione looks epic. How's May?
1m ago
Let's do it!
Fire
Right fist
A theme is a specific look and feel for your chat

You could have a light or dark theme and UI elements only displayed to a particular subsection of users. And it's not all about styling — it's about functionality too. You can create a theme that works great for a team chat app, mobile messenger, and even a live comments section next to a video livestream.

Theme editor

Complete control over styling, layout, and document structure

HTML templates

Entirely change the way messages are rendered with markup control

Metadata

Display more information in your messages by using our REST API

How Hotplate empowers home chefs with TalkJS
The flexibility lets us implement as we wish—starting simple and adding custom functionality as we go.
Ben Klenk
Co-founder & CEO, Hotplate
Start by using the Theme Editor

TalkJS provides a pre-built UI with a Default Theme you can use right off the bat or as a starting point for customization.

To get started, you'll use the Theme Editor, which gives you complete control over the styling, the layout, and document structure of the chat messages and the possibility to show metadata.

The great thing about the Theme Editor is that it's really easy to create any style of chat UI. You have to adjust the default TalkJS chat UI by changing a couple of lines of CSS. This way of doing things keeps the frontend work at a minimum so you can ship faster.

1.inner {
2 flex-grow: 1;
3 flex-basis: 0;
4 display: flex;
5 align-items: center;
6 padding-left: 1rem;
7 padding-right: 1rem;
8 min-width: 0;
9}
10.content {
11 flex-grow: 1;
12 display: flex;
13 align-items: center;
14 min-width: 0;
15}
16.image {
17 width: 45px;
18 text-align: center;
19 margin-right: 0.75rem;
20 flex-shrink: 0;
21}
22.info {
23 flex-grow: 1;
24 flex-basis: 0;
25 min-width: 0;
26}
Avatar
Hey, have you heard about these micro communities people are joining?
8m ago
Avatar
Yeah, I have! They seem like a great alternative to big social media platforms.
7m ago
Avatar
Definitely. I joined one for local gardening enthusiasts. It's so much more engaging.
6m ago
OK hand emoji
Herb emoji
Avatar
That's cool. I've been looking to cut down my social media time. How do you like it?
2m ago
Avatar
I love it. More meaningful interactions.
just now
I'll start looking into it!
We're so pleased to finally have a chat solution on our marketplace and it was incredibly easy to setup and looks and functions fantastic.
Shayne Kasai
Engineer, Retreat Guru
Create HTML templates

HTML templates give you flexibility. You can entirely change the way messages are rendered. Meaning you have complete control of the markup of messages and all of the styles.

You can write and edit HTML templates in the components section of the TalkJS Editor.

1<template>
2<t:set showAvatars="{{true}}"/>
3<div class="message-row {{ sender.isMe | then: 'by-me' | else: 'by-other' }} {{ body.type }}">
4 <Avatar photoUrl="{{ sender.photoUrl }}" />
5 <ActionMenu class="action-menu"><Icon type="horizontalDots" /></ActionMenu>
6 <div class="message {{ body.hasThumbnail | then: 'has-thumbnail' }}">
7 <div class="message-meta">
8 <div class="message-author" style="color: {{ sender.id | random_color }}">
9 {{ sender.name }}
10 </div>
11 <div class="message-time">
12 <TimeAgo timestamp="{{ timestamp }}"/>
13 </div>
14 </div>
15 <MessageBody
16 body="{{ body }}"
17 timestamp="{{ timestamp }}"
18 isLongEmailMessage="{{isLongEmailMessage}}"
19 hasReferencedMessage="{{ hasReferencedMessage }}"
20 />
21 </div>
22</div>
23</template>
Use metadata in your chat

You can attach custom data to a conversation message. It can be almost anything you make available by using our REST API.

Use it to display more information in your messages or change how they are displayed in a specific context to your application and more.

1{
2 "id": "msg_7bUdcZEoCUiDOcbcSh3Sdj",
3 "type": "SystemMessage",
4 "text": "New Bid",
5 "conversationId": "myConversation",
6 "custom":{
7 "bid": "40",
8 "bidder": "Jennifer Pritchard",
9 "itemDescription": "The Worm",
10 "itemImage": "https://example.com/nasa-worm.jpg",
11 }
12 ...
13}
Avatar
Hello! I saw you were selling Nasa Worm book, but the price is a bit high, could you go any lower on it?
5m ago
Avatar
I'm prepared to go a little bit lower, but the book is in pristine condition. That said, I'm sure we can work something out, yeah.
3m ago
Avatar
That sounds reasonable. I'll place a bid in that case.
2m ago
OK hand emoji
Avatar
New Bid
Jennifer Pritchard
€40
NASA Worm book
The Worm showcases over 200 images from NASA's archives chosen with one simple criteria.
Avatar
That's a decent offer. Thanks!
just now
I'll start looking into it!
The power of TalkJS is that it's highly customizable and user-friendly. We can offer our customers a plug and play solution and give them the possibility to adjust the chat widget to their needs.
Paul Van Den Broek
Product Manager, Coosto