Content Quality Text With Annotation Style
Type: React component
How to get ContentQualityTextWithAnnotationStyle?
JavaScript
import ContentQualityTextWithAnnotationStyle from 'fontoxml-content-quality/src/ContentQualityTextWithAnnotationStyle.jsx'
Render a text which (partially) has the same squiggle style applied as in the content view.
Other
```javascript
import ContentQualityTextWithAnnotationStyle from 'fontoxml-content-quality/ContentQualityTextWithAnnotationStyle.jsx';
import t from 'fontoxml-localization/t';
<ContentQualityTextWithAnnotationStyle
text={t('Replace %style_start%{ANNOTATION_TEXT}%style_end% with {REPLACEMENT}', {
ANNOTATION_TEXT: annotation.text,
REPLACEMENT: annotation.metadata.replacement
})}
annotationType={annotation.type}
/>
```
Props
text
(Required)
Type: String
The text to display. Wrap the part of the text which should be styled with the annotation type's squiggle style with
%style_start%
and%style_end%
.annotation
Type (Required)
The ContentQualityAnnotationType to use the style of. Can usually be retrieved from ContentQualityAnnotation.type.
selected
(Optional)
Type: Boolean
Visualizes the text as being selected. Defaults to true.
Default value