← Back to Docs
  • index.html
  • Clayground
  • Clayground.Text
  • HighlightedText
  • Clayground 2025.2
  • HighlightedText QML Type

    A TextArea with regular expression highlighting support. More...

    Import Statement: import Clayground.Text

    Detailed Description

    HighlightedText extends TextArea to provide real-time text highlighting based on a regular expression pattern. Useful for search functionality, quest logs, or any text that needs visual emphasis on matching patterns.

    Example usage:

    import Clayground.Text
    
    HighlightedText {
        width: 300
        height: 200
        text: "Find the sword and defeat the dragon."
        searchRegEx: "\\b(sword|dragon)\\b"
    }

    Properties

    Regular expression pattern for text to highlight. Set this to a regex pattern string. All matching text will be visually highlighted. The highlighting updates automatically when the pattern or text changes.