Back to API Reference
Class

SpoilerModifier

Hides text ranges behind an opaque decoration until activated and exposes the revealed state as a typed range signal for arbitrary modifier, property or externally driven rules.

Remarks

The revealed set is keyed by stable source identity, so unchanged entities keep their state across parsing and layout. The default presentation is an ordinary transient HighlightModifier above the text; replace or extend Rules to use blur, glyph modifiers, custom geometry or a project animation driver.

Example

csharp
[ctor]public SpoilerModifier()
public bool IsRevealed()

Returns whether a current spoiler entity is revealed.

public void SetRevealed()

Changes one current spoiler entity and drives every rule bound to RevealedSignal.

public void ConcealAll()

Conceals every currently revealed spoiler and animates the configured rules.

protected override void OnApply()
protected override void HandleDefaultAction()
protected override void HandleRangesRebuilt()
public static readonly RangeSignal<bool> RevealedSignal

Typed signal published for every spoiler entity. Project selectors and external drivers can observe the same state as the built-in cover rule.

public SpoilerRevealChangedHandler RevealChanged

Occurs after one current range changes its revealed state.