---
title: "Mark · Ark UI — StyleX Blocks"
description: "Inline text highlights with subtle, solid, and text-decoration treatments."
url: "https://stylexblocks.com/components/ark-ui/mark/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Mark

Inline text highlights with subtle, solid, and text-decoration treatments.

- Behavior engine: Ark UI
- Also available for: [Base UI](https://stylexblocks.com/components/base-ui/mark.md), [UI SDK](https://stylexblocks.com/components/ui-sdk/mark.md)
- Category: Typography
- Variants: subtle, solid, text, plain
- HTML page: https://stylexblocks.com/components/ark-ui/mark/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init
```

Then add the item as source you own:

```sh
npx stylexblocks add mark
```

Equivalent: `npx shadcn add @stylexblocks/mark`. Registry item JSON: https://stylexblocks.com/r/ark-ui/mark.json

## Usage

```tsx
import { Mark } from "#components/ui/ark-ui/mark.tsx";

export function Example() {
  return (
    <p>
      Styles are <Mark variant="subtle">compiled at build time</Mark> and
      shipped as <Mark variant="text">static CSS</Mark>.
    </p>
  );
}
```

## Source

`components/ui/ark-ui/mark.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { createComponent } from "#lib/ark-ui/create-component.tsx";
import { defineRecipe } from "#lib/recipe-props.ts";
import { colorPalette } from '@stylexblocks/ui/color-palette.stylex.ts'
import { fontWeights } from '@stylexblocks/ui/tokens/font-weights.stylex.ts'

const markStyles = stylex.create({
  base: {
    backgroundColor: 'transparent',
    color: 'inherit',
    whiteSpace: 'nowrap',
  },
})

const markVariants = stylex.create({
  subtle: {
    backgroundColor: colorPalette.subtle,
    color: 'inherit',
  },
  solid: {
    backgroundColor: colorPalette.solid,
    color: colorPalette.contrast,
  },
  text: {
    fontWeight: fontWeights.medium,
  },
  plain: {},
})

export type MarkVariant = keyof typeof markVariants

/**
 * Mark — recipe and component colocated in one file. The variant prop
 * resolves mechanically from the axis map. Composition via `asChild`.
 */
const markRecipe = defineRecipe({
  styles: markStyles,
  axes: { variant: markVariants },
  defaultVariants: { variant: "subtle" },
});

export const Mark = createComponent("mark", markRecipe, "Mark");

export type MarkProps = React.ComponentProps<typeof Mark>;
```
