For examples and details on the usage of this React components, visit the feature demo page.

Basic usage

You don’t need to import the component. It’s available in the NEAR Components through the Layout Managers.

<Highlighter target={target} isFirstTargetOnly={isFirstTargetOnly} />

Props

It takes in properties defined by THighlighterTask, including target, styles, icon, action, and an optional filled state.

NameTypeOptionalDescription
targetInjectableTargetThe target context to be highlighted
isFirstTargetOnlyboolean✔️If true, only the first visible context of the specified type on the page will be selected. If the page is scrolled, a new visible context will be selected.
stylesReact.CSSProperties✔️CSS styles for the highlighting. Can be set: position, backgroundColor, border, borderWidth, borderStyle, borderColor, borderRadius, zIndex, opacity, cursor
isFilledboolean✔️If true, a color overlay will be placed on the target context. You can add a click interaction to it using the action prop.
iconReactElement✔️The image that will be displayed in the center of the filled target context.
action() => void✔️A callback that will be called when a filled context is clicked.