---
title: "Radiomark · Ark UI — StyleX Blocks"
description: "The standalone circular radio indicator with a scaled center dot."
url: "https://stylexblocks.com/components/ark-ui/radiomark/"
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/"
---

# Radiomark

The standalone circular radio indicator with a scaled center dot.

- Behavior engine: Ark UI
- Also available for: [Base UI](https://stylexblocks.com/components/base-ui/radiomark.md), [UI SDK](https://stylexblocks.com/components/ui-sdk/radiomark.md)
- Category: Form
- Variants: solid, subtle, outline, inverted
- Sizes: xs, sm, md, lg
- HTML page: https://stylexblocks.com/components/ark-ui/radiomark/

## 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 radiomark
```

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

## Usage

```tsx
import { Radiomark } from "#components/ui/ark-ui/radiomark.tsx";
import { indigoPalette } from "@stylexblocks/ui/themes/palettes.ts";

export function Example() {
  return (
    <>
      {/* checked by default — pass checked={false} for the empty circle */}
      <Radiomark variant="solid" size="md" palette={indigoPalette} />
      <Radiomark variant="outline" size="md" checked={false} />

      {/* composition: asChild forwards everything onto your element */}
      <Radiomark asChild variant="subtle">
        <li />
      </Radiomark>
    </>
  );
}
```

## Source

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

```tsx
import * as stylex from "@stylexjs/stylex";
import { ark, type HTMLArkProps } from "@ark-ui/react/factory";
import type { StyleOverrideProps } from "#lib/recipe-props.ts";
import { radiomarkDotVars } from '@stylexblocks/ui/recipes/radiomark.stylex.ts'

import { colorPalette } from '@stylexblocks/ui/color-palette.stylex.ts'
import { colors } from '@stylexblocks/ui/tokens/colors.stylex.ts'
import { cursor } from '@stylexblocks/ui/tokens/cursor.stylex.ts'
import { radii } from '@stylexblocks/ui/tokens/radii.stylex.ts'
import { semanticColors } from '@stylexblocks/ui/semantic-tokens/colors.stylex.ts'
import { sizes } from '@stylexblocks/ui/tokens/sizes.stylex.ts'


const radiomarkStyles = stylex.create({
  base: {
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    flexShrink: 0,
    verticalAlign: 'top',
    color: colors.white,
    borderWidth: '1px',
    borderColor: {
      default: 'transparent',
      ':is([data-invalid], [aria-invalid="true"])':
        semanticColors.borderDestructive,
    },
    borderRadius: radii.full,
    cursor: {
      default: cursor.radio,
      ':is(:disabled, [disabled], [data-disabled])': cursor.disabled,
    },
    outlineWidth: {
      default: null,
      ':focus-visible': '1px',
    },
    outlineOffset: {
      default: null,
      ':focus-visible': '2px',
    },
    outlineStyle: {
      default: null,
      ':focus-visible': 'solid',
    },
    outlineColor: {
      default: null,
      ':focus-visible': colorPalette.focusRing,
    },
    opacity: {
      default: null,
      ':is(:disabled, [disabled], [data-disabled])': 0.5,
    },
    [radiomarkDotVars.height]: '100%',
    [radiomarkDotVars.width]: '100%',
    [radiomarkDotVars.borderRadius]: radii.full,
    [radiomarkDotVars.backgroundColor]: 'currentColor',
    [radiomarkDotVars.scale]: 0.4,
  },
})

const radiomarkVariants = stylex.create({
  solid: {
    borderWidth: '1px',
    borderColor: {
      default: semanticColors.border,
      ':is([data-invalid], [aria-invalid="true"])':
        semanticColors.borderDestructive,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.solid,
    },
    backgroundColor: {
      default: null,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.solid,
    },
    color: {
      default: colors.white,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.contrast,
    },
  },
  subtle: {
    borderWidth: '1px',
    backgroundColor: colorPalette.muted,
    borderColor: {
      default: colorPalette.muted,
      ':is([data-invalid], [aria-invalid="true"])':
        semanticColors.borderDestructive,
    },
    color: {
      default: 'transparent',
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.fg,
    },
  },
  outline: {
    borderWidth: '1px',
    borderColor: {
      default: 'inherit',
      ':is([data-invalid], [aria-invalid="true"])':
        semanticColors.borderDestructive,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.solid,
    },
    color: {
      default: colors.white,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.fg,
    },
    [radiomarkDotVars.scale]: 0.6,
  },
  inverted: {
    backgroundColor: semanticColors.bg,
    borderWidth: '1px',
    borderColor: {
      default: 'inherit',
      ':is([data-invalid], [aria-invalid="true"])':
        semanticColors.borderDestructive,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        'currentcolor',
    },
    color: {
      default: colors.white,
      ':is(:checked, [data-checked], [aria-checked="true"], [data-state="checked"])':
        colorPalette.solid,
    },
  },
})

const radiomarkSizes = stylex.create({
  xs: {
    width: sizes._3,
    height: sizes._3,
  },
  sm: {
    width: sizes._3_5,
    height: sizes._3_5,
  },
  md: {
    width: sizes._4,
    height: sizes._4,
  },
  lg: {
    width: sizes._5,
    height: sizes._5,
  },
})

const radiomarkDot = stylex.create({
  base: {
    height: radiomarkDotVars.height,
    width: radiomarkDotVars.width,
    borderRadius: radiomarkDotVars.borderRadius,
    backgroundColor: radiomarkDotVars.backgroundColor,
    scale: radiomarkDotVars.scale,
  },
})

export type RadiomarkVariant = keyof typeof radiomarkVariants

export type RadiomarkSize = keyof typeof radiomarkSizes

// Checked styling restated locally — the generated recipe expresses checked
// state as `:checked`, which only matches real form elements, so it is
// applied conditionally from the `checked` prop instead.
const radiomarkChecked = stylex.create({
  solid: {
    backgroundColor: colorPalette.solid,
    color: colorPalette.contrast,
    borderColor: colorPalette.solid,
  },
  subtle: { color: colorPalette.fg },
  outline: { color: colorPalette.fg, borderColor: colorPalette.solid },
  inverted: { color: colorPalette.solid, borderColor: "currentcolor" },
});

function cx(a?: string, b?: string) {
  return b ? (a ? `${a} ${b}` : b) : a;
}

export type RadiomarkProps = Omit<HTMLArkProps<"span">, "style"> &
  StyleOverrideProps & {
    variant?: RadiomarkVariant;
    size?: RadiomarkSize;
    checked?: boolean;
  };

/**
 * Radiomark — the standalone circular radio indicator with a scaled center
 * dot, composed with Ark's factory so it stays polymorphic via `asChild`.
 */
export function Radiomark({
  variant = "solid",
  size = "md",
  checked = true,
  palette,
  style,
  className,
  children,
  ...props
}: RadiomarkProps) {
  const sx = stylex.props(
    palette,
    radiomarkStyles.base,
    radiomarkVariants[variant],
    radiomarkSizes[size],
    checked && radiomarkChecked[variant],
    style,
  );
  return (
    <ark.span
      aria-hidden="true"
      {...props}
      className={cx(sx.className, className)}
      style={sx.style}
    >
      {checked ? (children ?? <span {...stylex.props(radiomarkDot.base)} />) : null}
    </ark.span>
  );
}
```
