Inline monospace text primitive. Renders {``} by default applying the
foundation's --style-code-* tokens. Sits inline within prose — for keywords,
identifiers, file names. Multi-line code blocks use the separate
{`
primitive. Single part. Eidos-native: no soma backing, no semantic events.
Run the command
{content}
to start the dev server.
Code is eidos-native — no soma split. The
variant
picks chrome treatment; size + color override the foundation defaults.
{eidosSnippet}
Code wraps inline monospace text. variant='plain' is the bare default;
'soft' and 'outline' add chrome for surfacing from surrounding
prose.
| Prop | Type | Default | Notes |
|---|---|---|---|
| variant | 'plain' | 'soft' | 'outline' | 'plain' | Visual chrome. |
| size | 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | inherit | Maps to {`var(--font-size-{key})`}. |
| color | 'primary' | 'secondary' | 'muted' | 'disabled' | 'on-solid' | inherit | Content-role color slot. |
| language | string | — | Reserved hint for future syntax-highlighting. Stamped as data-language. |
| as | string | 'code' | Override rendered tag. |
| tagStyle | string | — | Extra inline CSS. |
| Use case | Snippet |
|---|---|
| Inline command | {` |
| Soft-pill identifier | {` |
| Outline shortcut hint | {` |
| Inside a heading |
{`
|
| With language hint (future highlighting) | {` |
| Library | Closest equivalent | Difference |
|---|---|---|
| radix-themes | <Code> | Radix has size + variant (solid/soft/outline/surface); UIX consolidates to 3. |
| chakra-ui | <Code> | Chakra uses colorScheme; UIX restricts to content-role. |
| mantine | <Code> | Mantine has block boolean; UIX splits into Code + CodeBlock. |
MDN <code> | HTML primitive | UIX wraps the native element with the foundation tokens. |
| Field | Value |
|---|---|
| name | {codeMorfo.name} |
| kebab | {codeMorfo.kebab} |
| scope | {codeMorfo.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-code on the rendered tag (default
{``}), plus data-variant and (when set) data-language.
Code declares no semantic events. The primitive is passive — there is no commit, no emerge. If the consumer needs click-to-copy on inline code, they typically use the multi-line CodeBlock primitive instead.
Recipe lives in src/uix/eidos/components/code/code.css. Base typography
comes from --style-code-*; variants apply chrome through the
data-variant selector.
| Selector | Owner | Purpose |
|---|---|---|
[data-code] | morfo | Provider marker. Base mono typography. |
{`[data-code][data-variant='soft']`} | eidos | Subtle background pill. |
{`[data-code][data-variant='outline']`} | eidos | Outlined pill. |
| Concern | Contract |
|---|---|
| Role | Native HTML {` |
| Inside prose | Composes inline. AT read the surrounding text as a single utterance with the code embedded. |
| Color contrast | Soft / outline variants use neutral palette tokens that meet WCAG AA on the foundation surfaces. |
| Language hint | data-language is not announced by AT; it's a styling / tooling hint. |