Spoiler

Hidden text as invisible ink, dust that drifts and twinkles over the lines the words take, until a press reveals them.

import { Spoiler } from "@plexui/react-native"

Examples

Overview

Platforms

iOS 26Android
Native componentNone: hidden text drawn as invisible inkNone: the same ink
LookDust in the text's color over each hidden line, drifting and twinklingThe same

API

PropTypeDefaultDescription
lines(number | `${number}%`)[]["100%"]The hidden lines, each by its width: points, or a share of the spoiler's width
variantTextVariant"body"The text the lines stand for: its line height sets each line's room, its size the ink's band
tone"primary" | "secondary""primary"The ink's color: the text's or the secondary text's
coverbooleanfalseDust over a whole box instead of lines: hidden media, as the messenger covers a hidden or timed picture, light dots over the dark picture, fewer and a little larger than over words (about one in every 17 square points, 1 to 2 across). The spoiler fills the box its style gives it (StyleSheet.absoluteFill over the picture); lines and variant are not read. In a Message's picture no dot stands under its marks (the time's capsule, Message.MediaBadge, Message.MediaButton)
colorstring—The dots' color: white with cover, else the text's for tone
onPress() => void—Called on a press, for the app to show the text; without it the ink takes no press
aria-labelstring"Hidden text", "Hidden media" with coverWhat a screen reader says for it
testIDstring—Test id
styleStyleProp<ViewStyle>—Style of the spoiler