# Mark

> Highlights text with a background color for emphasis. Defaults to warning (yellow) appearance for a natural highlighter effect.

Source: https://vaneui.com/docs/basic-components/mark

Import: `import { Mark, Col, PageTitle, Row, SectionTitle, Text, Title } from "@vaneui/ui"`

Mark picks out a search match or a changed value in running text. It renders the native `<mark>` element with no padding and `sharp` corners, so the tint sits flush around the glyphs. In the default `outline` variant, the text keeps the body text color whatever the appearance. For literal values and identifiers, use [Code](/docs/basic-components/code); for a short standalone status label, use a [Badge](/docs/basic-components/badge).

## Basic usage

Highlight text with the `Mark` component. Defaults to `warning` (yellow) appearance for a natural highlighter effect.

```tsx demo
<Row flexWrap>
  <Mark>Highlighted text</Mark>
  <Mark>Important</Mark>
  <Mark>Key term</Mark>
</Row>
```

## Appearances

Different color appearances for highlights. `warning` is the default.

```tsx demo
<Row flexWrap>
  <Mark primary>Primary</Mark>
  <Mark accent>Accent</Mark>
  <Mark secondary>Secondary</Mark>
  <Mark tertiary>Tertiary</Mark>
  <Mark success>Success</Mark>
  <Mark danger>Danger</Mark>
  <Mark warning>Warning</Mark>
  <Mark info>Info</Mark>
</Row>
```

## Variants

Mark supports `outline` (default) and `filled` variants.

```tsx demo
<Col>
  <Row flexWrap>
    <Mark>outline (default)</Mark>
    <Mark primary>primary outline</Mark>
    <Mark success>success outline</Mark>
    <Mark danger>danger outline</Mark>
  </Row>
  <Row flexWrap>
    <Mark filled>filled</Mark>
    <Mark primary filled>primary filled</Mark>
    <Mark success filled>success filled</Mark>
    <Mark danger filled>danger filled</Mark>
  </Row>
</Col>
```

## Shapes

```tsx demo
<Text>
  A <Mark>sharp</Mark> default, a <Mark rounded>rounded</Mark> highlight, and a <Mark pill>pill</Mark> one.
</Text>
```

## Highlight matches context

Mark defaults to `inheritSize: true` so a highlight always renders at the same size as the surrounding text (body copy, subheading, section heading, or page title) without passing any size prop.

```tsx demo
<Col>
  <Text>Body text with a <Mark>highlighted phrase</Mark> inline.</Text>
  <Title>Subheading with <Mark>highlighted text</Mark> inside.</Title>
  <SectionTitle>Section heading with <Mark>a highlight</Mark>.</SectionTitle>
  <PageTitle>Page title <Mark>highlight</Mark></PageTitle>
</Col>
```

## Opting out with noInheritSize

Pass `noInheritSize` together with a size prop to render Mark at a fixed size regardless of the parent.

```tsx demo
<Title>
  Subheading with a <Mark sm noInheritSize>fixed-small highlight</Mark> inside.
</Title>
```

## In text context

Mark elements blend naturally within body text for inline highlights.

```tsx demo
<Col>
  <Text>VaneUI uses a <Mark>boolean props API</Mark> for styling components.</Text>
  <Text>Always wrap your app in <Mark primary>ThemeProvider</Mark> for theming to work.</Text>
  <Text>Components marked with <Mark danger>danger</Mark> indicate destructive actions.</Text>
</Col>
```

## Search highlight pattern

Use Mark to highlight search matches within text content.

```tsx demo
<Col>
  <Text sm secondary>Search results for &quot;React&quot;:</Text>
  <Text>VaneUI is a <Mark>React</Mark> component library built with TypeScript.</Text>
  <Text>All components are <Mark>React</Mark> 19 compatible with server component support.</Text>
  <Text>Use <Mark>React</Mark> hooks like useState with VaneUI form components.</Text>
</Col>
```

## Props

| Prop | Category | Default | Description |
| --- | --- | --- | --- |
| `primary` | Appearance |  | Primary color appearance (gray) |
| `accent` | Appearance |  | Accent color appearance (rose) |
| `secondary` | Appearance |  | Secondary color appearance (gray) |
| `tertiary` | Appearance |  | Tertiary color appearance |
| `success` | Appearance |  | Success color appearance (green) |
| `danger` | Appearance |  | Danger color appearance (red) |
| `warning` | Appearance | yes | Warning color appearance (amber) |
| `info` | Appearance |  | Info color appearance (cyan) |
| `inheritAppearance` | Appearance |  | Inherit appearance from parent — suppresses own data-appearance/data-variant, uses parent's CSS variables |
| `disabled` | Disabled |  | Disable the component — reduces opacity, changes cursor to not-allowed, and prevents interaction |
| `flex1` | Flex |  | Take up remaining space (= `flex-1`, i.e. `flex: 1 1 0%`) |
| `flexAuto` | Flex |  | Grow but respect intrinsic size (= `flex-auto`, i.e. `flex: 1 1 auto`) |
| `flexNone` | Flex |  | Don't grow and don't shrink (= `flex-none`, i.e. `flex: none`) |
| `fontSans` | Font Family |  | Sans-serif font family (default) — emits font-sans |
| `fontSerif` | Font Family |  | Serif font family — emits font-serif |
| `fontMono` | Font Family |  | Monospace font family — emits font-mono |
| `fontHeading` | Font Family |  | Heading font family (defaults to sans, customizable via --font-heading) — emits font-heading |
| `italic` | Font Style |  | Italic font style |
| `notItalic` | Font Style |  | Not italic (normal) font style |
| `fontThin` | Font Weight |  | Thin font weight (100) — emits font-thin |
| `fontExtralight` | Font Weight |  | Extra light font weight (200) — emits font-extralight |
| `fontLight` | Font Weight |  | Light font weight (300) — emits font-light |
| `fontNormal` | Font Weight |  | Normal font weight (400) — emits font-normal |
| `fontMedium` | Font Weight |  | Medium font weight (500) — emits font-medium |
| `fontSemibold` | Font Weight |  | Semibold font weight (600) — emits font-semibold |
| `fontBold` | Font Weight |  | Bold font weight (700) — emits font-bold |
| `fontExtrabold` | Font Weight |  | Extra bold font weight (800) — emits font-extrabold |
| `fontBlack` | Font Weight |  | Black font weight (900) — emits font-black |
| `inheritSize` | Inherit Size | yes | Inherit font-size and line-height from the nearest parent typography element |
| `noInheritSize` | Inherit Size |  | Keep own font-size; do not inherit from parent |
| `padding` | Padding |  | Enable internal padding |
| `paddingX` | Padding |  | Enable only horizontal padding |
| `paddingY` | Padding |  | Enable only vertical padding |
| `noPadding` | Padding | yes | Disable internal padding |
| `pill` | Shape |  | Fully rounded corners (circular) |
| `sharp` | Shape | yes | No rounded corners (square) |
| `rounded` | Shape |  | Medium rounded corners (default) |
| `noShrink` | Shrink |  | Prevent the flex item from shrinking below its content size (= `shrink-0`) |
| `xs` | Size |  | Extra small size |
| `sm` | Size |  | Small size |
| `md` | Size | yes | Medium size (default) |
| `lg` | Size |  | Large size |
| `xl` | Size |  | Extra large size |
| `skeleton` | Skeleton |  | Show the component as a loading placeholder in its own size and shape. On a container, every component inside it becomes a placeholder too |
| `textLeft` | Text Align |  | Align text to left (physical side, does not flip under RTL) |
| `textCenter` | Text Align |  | Align text to center |
| `textRight` | Text Align |  | Align text to right (physical side, does not flip under RTL) |
| `textJustify` | Text Align |  | Justify text |
| `textStart` | Text Align |  | Align text to the reading-direction start (left in LTR, right in RTL) |
| `textEnd` | Text Align |  | Align text to the reading-direction end (right in LTR, left in RTL) |
| `underline` | Text Decoration |  | Add underline decoration below text |
| `lineThrough` | Text Decoration |  | Add strikethrough/line-through decoration across text |
| `noUnderline` | Text Decoration |  | Remove ALL text-decoration — underline, line-through, and overline (text-decoration: none) |
| `overline` | Text Decoration |  | Add overline decoration above text |
| `uppercase` | Text Transform |  | Transform text to uppercase |
| `lowercase` | Text Transform |  | Transform text to lowercase |
| `capitalize` | Text Transform |  | Capitalize first letter of each word |
| `normalCase` | Text Transform |  | Normal text case (no transformation) |
| `filled` | Variant |  | Filled variant - solid background with contrasting text color |
| `outline` | Variant | yes | Outline variant - transparent background with border and colored text (default) |
| `ghost` | Variant |  | Ghost variant - transparent background, no border, appearance-colored text, tinted hover background |
| `breakNormal` | Word Break |  | Reset breaking - overflow-wrap and word-break normal |
| `breakWords` | Word Break |  | Break long words to prevent overflow - overflow-wrap: break-word |
| `breakAll` | Word Break |  | Break between any two characters - word-break: break-all |
| `breakKeep` | Word Break |  | Do not break CJK text - word-break: keep-all |

Layout and utility props (Border, Cursor, Display, Flex Direction, Focus Visible, Gap, Height, Hide, Items, Justify, Overflow, Position, Responsive Sizing, Responsive Width, Ring, Shadow, Show, Transition, Transparent, Whitespace, Width, Wrap) are listed on [Common Props](https://vaneui.com/docs/reference/common-props.md).
