Skip to content

Feature request: provision to mask certain views #576

Open

Description

@JJSLIoT

It would be an excellent addition for this library if it could mask certain views from the captured screenshot. Maybe some wrapper component that, when used, just renders the children as a black box.

This would be useful to prevent password/secure text inputs from being captured inside the screenshot.

Activity

  1. gre commented on May 1, 2026

    @gre
    Owner

    Hi @JJSLIoT, sounds useful for sensitive content (password fields, payment numbers, etc.). A simple workaround today: overlay a placeholder view conditionally during capture (toggle a state right before captureRef, restore after).

    A first-class API would be nice though. We'd accept a PR. One workable approach: a <MaskView> component that renders normally but exposes a flag (e.g., nativeID or a setter) that the native capture path detects and replaces with a solid rect during draw.

    Labels updated: enhancement, help wanted. Leaving open.

  2. bhumikabiyani commented on Nov 14, 2026

    @bhumikabiyani

    Hi @gre, I came across this feature request and noticed your suggestion for a first-class <MaskView> API.

    I've opened #764 implementing this approach.

    The implementation adds a cross-platform MaskView component, using an internal nativeID marker detected by the Android and iOS capture paths to replace the marked content with a solid mask during capture.

    I've also included tests and README documentation.

    The PR is currently awaiting maintainer approval for GitHub Actions workflows. Would appreciate your feedback when you get a chance. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions