Substring highlighter primitive. Wraps a {``} shell around the input text
and replaces matches of query (string or array) with {``}
elements that inherit the same recipe as the standalone Mark primitive. Composes inside any
inline-flow primitive. Single part. Eidos-native: no soma backing, no semantic events.
Highlight is eidos-native — no soma split. Multiple terms via comma-separated input. Terms are regex-escaped automatically.
{eidosSnippet}
Highlight scans text for matches of query (string or array of
strings, regex-escaped) and wraps each match in {``}.
| Prop | Type | Default | Notes |
|---|---|---|---|
| text | string | — | Required. The full text to render. |
| query | string | string[] | — | Substring(s) to highlight. |
| ignoreCase | boolean | true | Case-insensitive match. |
| color | 'primary' | 'secondary' | 'neutral' | 'affirm' | 'fulfill' | 'risk' | 'threat' | 'loss' | 'fulfill' | Intent palette for the highlight tint. |
| as | string | 'span' | Override outer shell tag. |
| Use case | Snippet |
|---|---|
| Single-term search result |
{`
|
| Multi-term filter |
{`
|
| Case-sensitive code search |
{`
|
| Inside a Heading |
{`
|
| List of results |
{`{#each results as r}
|
| Library | Closest equivalent | Difference |
|---|---|---|
| radix-themes | — | Radix has no substring highlighter; consumer composes manually. |
| chakra-ui | <Highlight> | Chakra uses colorScheme; UIX restricts to intent palette. |
| mantine | <Highlight> | Mantine supports regex via highlight={"{ regex: true }"}; UIX reserves for v2. |
| react-highlight-words | library | Bundles highlighting + regex + custom render; UIX is intentionally minimal. |
| Field | Value |
|---|---|
| name | {highlightMorfo.name} |
| kebab | {highlightMorfo.kebab} |
| scope | {highlightMorfo.scope.join(', ')} |
| parts | {partsList.length} |
| events | 0 |
| kebab | marker | element | archetype | optional |
|---|---|---|---|---|
| {part.kebab} | [{part.marker}] |
<{part.defaultElement}> | {part.archetype} | {part.optional ? 'yes' : 'no'} |
The Provider stamps data-highlight on the outer shell. Inner matches reuse
the Mark recipe via the embedded data-mark attr, sharing
data-color.
Highlight declares no semantic events. The primitive is a formatter: given
text + query it produces a tree of segments and decorates the
matches. No commit, no emerge. Animating the appearance of matched text belongs to a
containing list / popover.
Recipe lives in src/uix/eidos/components/highlight/highlight.css. The outer
shell is structural (font: inherit); inner Mark elements pick up the
palette from the standalone Mark recipe.
| Selector | Owner | Purpose |
|---|---|---|
[data-highlight] | morfo | Outer shell. Inherits ambient typography. |
[data-highlight] [data-mark] | eidos | Reuses the Mark recipe via shared data-mark attr. |
| Concern | Contract |
|---|---|
| Role | The shell is a generic {``}; inner matches are {``}. |
| Full text in DOM | Highlight doesn't truncate or hide content. AT read the full text including the marked segments. |
| Multi-term ordering | Matches are found left-to-right in text order. Reading order follows the source. |
| Color contrast | Inherits the Mark recipe's contract — each intent's bg + text meets WCAG AA. |