React API

Three components and one hook, exported from react-7tv.

Provider7tv

Shares an emote collection, matching syntax, and animation preference.

PropDefaultPurpose
emoteSetIdPublic set ID or global
emotesControlled collection; disables fetching
initialEmotesEmptySSR and loading fallback
syntaxPlainDefault matching rules
animatedtrueDefault image animation
fetch / apiBaseUrl7tv APICustom transport or proxy
onErrorRequest error callback

Text7tv

Transforms string children and nested intrinsic elements. Custom component output is left alone.

PropDefaultPurpose
asspanWrapper element; Fragment removes it
emotes / syntax / animatedProviderPer-component overrides
recursivetrueVisit intrinsic element children
excludeElementsSafe defaultsReplace the excluded-tag list
emotePropsPass options to the image renderer
renderEmoteEmote7tvCustom React renderer

Emote7tv

Requires an EmoteModel7tv. Accepts animated, size, formatPreference, and image attributes except src/srcSet. The default image height is 1.5em.

use7tv

Must be called inside a provider. getEmote uses an exact alias lookup, independent of the configured matching syntax.

Provider state.tsx
const { emotes, status, error, getEmote } = use7tv();
// status: "idle" | "loading" | "ready" | "error"
const emote = getEmote("PETPET");
NextCore utilities