Last date modified: 2025-Jul-02

Interface: HighlightConfig

Style information for [[Highlight]] objects

Extends

Properties

activationMode

activationMode: HighlightActivationMode

Controls how the highlight is rendered when it is active and inactive.


activeStyle?

optionalactiveStyle: HighlightStyle

The style to use for the highlight when it is active


allowDelete?

optionalallowDelete: boolean

Determines if the highlight can be deleted, default is false


allowMove?

optionalallowMove: boolean

Determines if the highlight can be moved, default is false


allowResize?

optionalallowResize: boolean

Determines if the highlight can be resized, default is false


borderColor

borderColor: string

The border color. This property is ignored for text highlights and for any highlights where borderLineType is LineType.none.

The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the inverse of the fill color will be used. The border color for a highlight may be changed at any time by setting the [[Highlight.borderColor]] property.

Inherited from

HighlightStyle.borderColor


borderLineType

borderLineType: LineType

The border line type. This property is ignored for text highlights.

If not specified, the default value of LineType.none will be used (resulting in no border). The line type for a highlight may be changed at any time by setting the [[Highlight.borderLineType]] property.

Inherited from

HighlightStyle.borderLineType


borderWidth

borderWidth: number

The border width in pixels. This property is ignored for text highlights and for any highlights where borderLineType is LineType.none.

If not specified, the default value of 1 pixel will be used. The line type for a highlight may be changed at any time by setting the [[Highlight.borderLineType]] property.

Inherited from

HighlightStyle.borderWidth


cssClass

cssClass: string

A CSS class or space-separated list of classes to apply to the highlighted text. This property is ignored for cell and rectangular highlights.

Note that this property must be used very carefully to avoid affecting the layout of the text. Any CSS properties that change the box size or visibility of the text will cause layout issues in the viewer.

If not specified, the CSS class for the text will not be altered by the highlight. The CSS class for a highlight may be changed at any time by setting the [[Highlight.cssClass]] property.

Inherited from

HighlightStyle.cssClass


enableDelete

enableDelete: boolean

Controls whether the user is able to delete the highlight by pressing the DELETE key while the highlight is active.

If not specified, defaults to false. This value may be changed at any time by setting the [[Highlight.enableDelete]] property.

Inherited from

HighlightStyle.enableDelete


enableMove

enableMove: boolean

Controls whether the user is able to move the highlight using the mouse, touch, or keyboard while the highlight is active. This property is ignored for text highlights.

If not specified, defaults to false. This value may be changed at any time by setting the [[Highlight.enableMove]] property.

Inherited from

HighlightStyle.enableMove


enableResize

enableResize: boolean

Controls whether the user is able to resize the highlight using the mouse, touch, or keyboard while the highlight is active. This property is ignored for text highlights.

If not specified, defaults to false. This value may be changed at any time by setting the [[Highlight.enableResize]] property.

Inherited from

HighlightStyle.enableResize


fillColor

fillColor: string

The background fill color for text and rectangular highlights. The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the default will be based on the highlight properties: white (#fff) for cross redactions black (#000) for other redactions transparent yellow (rgba(255,255,0,0.5)) for highlights

The fill color for a highlight may be changed at any time by setting the [[Highlight.fillColor]] property.

Inherited from

HighlightStyle.fillColor


image

image: HighlightImage

The image to draw over the highlight. This property is ignored for text highlights.

The only supported value is "cross", which draws a diagonal cross and outline over the highlight in the inverse of the highlight color.

If not specified, no image will be drawn. The highlight image may be changed at any time by setting the [[Highlight.image]] property.

Inherited from

HighlightStyle.image


inverse

inverse: boolean

If true, the highlight will be treated as an inverse redaction - that is, the full page will be redacted except or the highlight range. If there are multiple inverse redactions on the page, they will each be subtracted from the full page redaction.

This property is only supported for rectangular redactions. If specified for any other type of highlight, it will be ignored.

If not specified, defaults to false. The inverse flat may not be changed once a highlight is created.


label

label: string

A string value specifying a label to attach to each highlight. This property is ignored for text highlights.

If not specified, the highlight will no label. The label may be changed at any time by setting the [[Highlight.label]] property.

Inherited from

HighlightStyle.label


labelColor

labelColor: string

The color for text labels. This property is ignored for text highlights and highlights without labels.

The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the inverse of the fill color will be used. The label color for a highlight may be changed at any time by setting the [[Highlight.labelColor]] property.

Inherited from

HighlightStyle.labelColor


labelFontFace

labelFontFace: string

The label font name. This property is ignored for text highlights and for any highlights without a label.

If not specified, defaults to "Arial". The label font may be changed at any time by setting the [[Highlight.labelFont]] property.

Inherited from

HighlightStyle.labelFontFace


labelFontSize

labelFontSize: FontSizeOrAuto

The label font size. This property is ignored for text highlights and for any highlights without a label.

May be a numeric value in points, a [[FontSize]] object with a size in either points or pixels, or "auto" to automatically scale the label with the size of the highlight.

If not specified, defaults to "auto". The label size may be changed at any time by setting the [[Highlight.labelFontSize]] property.

Inherited from

HighlightStyle.labelFontSize


labelFontWeight

labelFontWeight: FontWeight

The label font weight. This property is ignored for text highlights and for any highlights without a label.

If not specified, defaults to FontWeight.normal. The label font weight may be changed at any time by setting the [[Highlight.labelFontWeight]] property.

Inherited from

HighlightStyle.labelFontWeight


redaction

redaction: boolean

If true, the highlight will be treated as a redaction.

If not specified, defaults to false. The redaction flag may not be changed once a highlight is created.


relativeOrder?

optionalrelativeOrder: RelativeOrderType

For cell highlights, controls whether the highlight renders above embeddings, or below embeddings.

If not specified, defaults to aboveEmbeddings.


reversion

reversion: boolean

If true, the highlight will be treated as a redaction reversion. Any redacted cells under a redaction reversion will be displayed unredacted.

Redaction reversions are only supported for cell redactions in spreadsheets. For cell highlights and rectangular and text highlights and redactions, this flag is ignored.

All other [[HighlightStyle]] properties (fill color, label properties, etc.) are ignored for reversions.

If not specified, defaults to false. The reversion flag may not be changed once a highlight is created.


strokeColor

strokeColor: string

The stroke color for cross redactions. This property is ignored for other highlight types.

The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the inverse of the fill color will be used. The stroke color for a highlight may be changed at any time by setting the [[Highlight.strokeColor]] property.

Inherited from

HighlightStyle.strokeColor


textColor

textColor: string

The text color for text highlights. The value of this string may be any valid CSS color value, as defined here:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

If not specified, the text color will not be altered by the highlight. The text color for a highlight may be changed at any time by setting the [[Highlight.textColor]] property.

Inherited from

HighlightStyle.textColor


userData?

optionaluserData: UserDataMap

User data to apply to any highlights created using this PartialRangeHighlightConfig. The individual properties in this userData object are copied by value to each highlight.

Return to top of the page
Feedback