- Examples
- /
- How to implement a typing awareness indicator
How to implement a typing awareness indicator
What is a typing indicator?
Typing indicators signify when other users’ are typing a message. It is a useful feature that provides a realtime typing view, and enables users to communicate efficiently. It sets user’s expectations that there will be a new interaction, such as a response in a live chat, or a new comment in a collaborative document.
Where can I use Typing Indicators?
Typing indicators can add value to a range of live experiences. Some example use cases are:
Advanced typing awareness indicator functionality
You can incorporate more functionality within your Typing Indicator such as:
Showing that multiple people are typing simultaneously
Showing who is typing a message if there are more than 2 users connected
How to build realtime typing indicators
With Ably, it is easy to implement a typing awareness indicator.
Step 1: Sign up to Ably
Visit our sign up page to start using Ably for free. Simply upgrade when you need to ramp up usage past 6M Monthly messages, 200 Peak concurrent channels, 200 Peak concurrent connections. Once you are signed up, download one of our SDKs to get started.
Step 2: Start using Ably Channels and Presence
Ably Channels
Channel is the unit of distribution of messages. Channels can be used to segment the data. For example, different boards, different rooms in audience engagement tools etc. Users or their devices can subscribe to a specific or multiple channels.
channels.get
- to get an existing or create a new channelchannels.presence
- to get the presence object
Ably Presence
Presence allows you to automatically track who is present in a channel. This feature can be used to update user information such as whether they are typing or not. This will publish the update information to other clients.
presence.enter(data)
- to add a user with a specific namepresence.update
- to update member data on a user which will publish a presence updatepresence.subscribe
- to subscribe to updates on any member data on the channel
Next steps
You'll need to do the following to get started with adding a Typing Indicator to your chat application.
Implement the UI for the Typing Indicator
Create the logic to update the typing indicator status for each user
Discover more collaborative features
Discover the other features you could use to deliver a rich collaborative experience, including:
Recommended Articles
Add live cursors for collaborative multiplayer experiences
It’s easy to add live cursors with Ably. Using our Spaces SDK you can build live cursors and other realtime collaboration features to enhance your product.
Implementing emoji reactions for live chat
Ably provides simple APIs to help you build and add emoji reactions to your chat application, allowing users to react to messages in realtime.
Show the member location of users in your app
How to use the member location feature to show where a user is within the app - which page, cell, slide or block they're viewing.