CometChatStickerKeyboard shows your app’s stickers: one page per sticker set, a grid of
four columns, and a tab bar of set icons at the bottom. It fetches the sets itself and
reports the sticker a user taps; the host sends it. The
message composer opens it from its sticker button and
sends the sticker you tap. You can also host it yourself.

Where It Fits
- SwiftUI
- UIKit
CometChatStickerKeyboard is a View. It fetches the sticker sets when it first appears.The composer’s sticker button opens it, as tall as the system keyboard was — at least
296 pt. Tapping a sticker sends it, and the keyboard stays open. The sticker button or a
tap in the text field closes it. See
Message Composer ▸ Stickers.Quick Start
- SwiftUI
- UIKit
Give it a height, and handle the tap. The keyboard does not close itself:To send the sticker to a chat, use a composer store:With the Stickers extension turned off,
onError receives ERR_EXTENSION_NOT_ENABLED.What It Shows
- SwiftUI
- UIKit

emptyStateTitleText, emptyStateSubtitleText and
errorStateText. A hidden state renders nothing.Sets appear in the order the extension returns them — the app’s default stickers first,
then custom ones. A set’s tab icon is its first sticker. A sticker that fails to load
shows a placeholder sticker. An animated GIF sticker shows its first frame in the
keyboard; what is sent is the GIF’s URL.onError is called every time the keyboard enters the error state, and when it appears
already in it.Sticker carries name, url and setName, and isGif when the URL ends in .gif.
Actions and Events
Callback Methods
- SwiftUI
- UIKit
Functionality
- SwiftUI
- UIKit
loadingView, emptyView and errorView replace the states — see Custom View Slots.Custom View Slots
- SwiftUI
- UIKit
Replace the loading, empty and error states. The error view receives a retry action:Or for every sticker keyboard in a subtree, including the composer’s. An initialiser
argument wins:
Advanced Methods
Store Access
- SwiftUI
- UIKit
CometChatStickerKeyboardStore fetches and holds the sets. Pass your own to share it, to
keep the fetched stickers when the keyboard goes away, or to show fixed stickers in a
preview:retry(), selectStickerSet(_:), and
the observable uiState, stickerSets, selectedSetIndex and currentStickers.Subclassing
- SwiftUI
- UIKit
CometChatStickerKeyboard is a View struct. Customise it with its parameters, modifiers
and style.Objective-C
In the UIKit toolkit: The keyboard is@objc, apart from setOnStickerTap(onStickerTap:), whose Sticker is a
Swift struct — from Objective-C, host it through the composer. Swift’s
set(emptyStateTitleText:) is setWithEmptyStateTitleText:; set(onError:) keeps
setOnError::
Accessibility
In the SwiftUI toolkit:- Each sticker is a button that reads as its name, or “Sticker” when it has none. Each tab is a button that reads as “name sticker set”, marked selected for the set shown.
- The loading state reads as “Loading stickers, please wait”.
- Under Reduce Motion, the composer fades the keyboard in and out instead of sliding it.
Style
- SwiftUI
- UIKit
CometChatStickerKeyboardStyle is sparse: set only what you change, and everything else
follows the theme. The composer passes its stickerKeyboardStyle through:Next Steps
Message Composer
Hosts the keyboard behind its sticker button
Create Poll
The composer’s other hosted component