Highlight
Highlight discovers literal queries in plain text through exact Atom behavior and renders finished semantic match styling.
Built from the published package
FLOWSTACK keeps C++ and café searches literal, predictable, and accessible.
Know when Highlight is the right part
Use it when
Use Highlight when one plain text string needs deterministic visible query matches.
Choose another path when
Use Mark when relevance is already authored. Keep arbitrary React-node traversal, active-result navigation, result counts, search input state, and announcements in the application.
Installation and imports
For modular CSS:
Highlight and its public types are also available from @flowstack-ui/brick.
Quick start
Visual recipes and states
Subtle provides quiet filled relevance, solid provides stronger contrast, and underline preserves an unfilled reading surface. Accent and neutral are semantic tones. These are passive recipes, not active-search-result state.
Examples
API
Start with the public parts and root options below. Components with multiple parts separate each area into its own named subsection.
| Prop | Values | Default |
|---|---|---|
text | plain string | required |
query | string or readonly string array | required |
ignoreCase | boolean | true |
matchAll | boolean | true |
exactMatch | boolean | false |
variant | subtle, solid, underline | subtle |
tone | accent, neutral | accent |
Public exports are Highlight, HighlightProps, HighlightVariant, and HighlightTone.
Accessibility
Native mark communicates relevance in context. Highlight adds no focus, role, live region, search result count, or keyboard behavior. Forced colors uses system highlight colors for filled recipes and system underline visibility for underline.
Responsive behavior
Highlight stays inline, preserves whitespace and text order, and wraps with surrounding copy. Each marked fragment uses cloned inline decoration across line breaks.
Styling and tokens
Customization
Choose variant and tone first, then documented variables for a deliberate local recipe. Do not restyle Atom internals other than the documented match slot.
Tokens and CSS hooks
Use .brick-highlight, [data-slot="highlight-match"], data-slot, data-tone, data-variant, --brick-highlight-background, --brick-highlight-foreground, --brick-highlight-radius, --brick-highlight-padding-inline, --brick-highlight-decoration-color, --brick-highlight-decoration-thickness, and --brick-highlight-decoration-offset.
Advanced reference
Open these details only when you need to inspect DOM ownership, native forwarding, or lower-level composition.