ChronicStone/nuxt-ui-tools / skills/consumer/display
nuxt-ui-tools-display
VerifiedUse this skill when showing read-only content with nuxt-ui-tools display blocks, inside a form (the `info` field with `display` and `props`) or on their own (`UiDisplay`). Covers the 19 kinds (heading, text, alert, facts, stat, breakdown, meter, chart, table, diff, record, person, list, timeline, date, media, code, empty, accordion) and their variants, props that follow form values or load through a promise or TanStack Query options with skeleton and error states, the form api in props callbacks, the label shell, lazy file links, presets, slot classes, and tones, including tones an app registers.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.3 KB |
| references/info-field.md | markdown | 4.5 KB |
| references/kinds.md | markdown | 17.1 KB |
| references/theming.md | markdown | 4.8 KB |
references/theming.md
View on GitHub# Theming display blocks
## Tones
A tone is a color role: `primary`, `secondary`, `success`, `info`, `warning`, `error`, `neutral`.
Each one reads five CSS variables, so a tone is restyled in CSS without touching the blocks:
| Variable | Used for |
| ------------------------------- | ----------------------------------------- |
| `--nut-display-<tone>` | solid fills: bars, dots, the current step |
| `--nut-display-<tone>-ink` | text and icons on the page |
| `--nut-display-<tone>-soft` | tinted backgrounds |
| `--nut-display-<tone>-line` | borders |
| `--nut-display-<tone>-contrast` | text on the solid fill |
They default to the Nuxt UI colors, with the soft and line colors mixed into the page background,
so dark mode follows on its own. Badges of built-in tones are `UBadge` with that `color`, so your
badge theme applies to them.
### Restyling and registering tones
Set colors in `appConfig.nuxtUiTools.display.tones`. A built-in tone takes only the colors it
changes; a new tone needs `color`, and gets its ink, soft, line and contrast colors from it unless
you set them. `dark` holds the colors used in dark mode.
```ts
// app.config.ts
export default defineAppConfig({
nuxtUiTools: {
display: {
tones: {
primary: { ink: '#b85e00', dark: { ink: '#ffb558' } },
violet: {
color: 'var(--color-violet-500)',
ink: 'var(--color-violet-700)',
dark: { ink: 'var(--color-violet-300)' },
},
teal: { color: 'var(--color-teal-500)' },
},
},
},
})
```
Then register the new names so `tone: 'violet'` type-checks on chips, records, headings, facts and
every other `tone`:
```ts
// types/display-tones.d.ts
declare module '#ui-tools/display' {
interface DisplayToneRegistry {
violet: true
teal: true
}
}
export {}
```
A registered tone renders through the same five variables; its badges are neutral `UBadge`s
recolored with them, in the requested `variant`.
## Slot classes
Every block has named slots. Override them app-wide in `appConfig.nuxtUiTools.display.ui.<kind>`,
or on one block with its `ui` prop. Later layers win, merged with tailwind-merge.
```ts
nuxtUiTools: {
display: {
ui: {
facts: { label: 'text-[13px] text-muted', value: 'font-semibold' },
alert: { root: 'rounded-[9px]' },
heading: { title: 'tracking-tight' },
},
},
}
```
Slots per kind are the `Display<Kind>Slot` types, for example `DisplayFactsSlot`:
`root`, `group`, `groupHeader`, `groupTitle`, `groupAside`, `item`, `label`, `hint`, `value`,
`empty`, `actions`.
## Chips
Every chip the blocks draw (facts chips, record and person chips, record badges, list chips, stat
and breakdown chips, diff notes, the date range duration) is a `UBadge`. Give them all the app's
badge style once with `display.ui.chip`, a class map over the badge slots (`base`, `label`,
`leadingIcon`, `leadingAvatar`, `leadingAvatarSize`, `trailingIcon`):
```ts
nuxtUiTools: {
display: {
ui: { chip: { base: 'rounded-full px-2 py-0.5 text-[11.5px]', label: 'font-semibold' } },
},
}
```
A chip's own `ui` merges over it per slot. Tones still color the chips: keep colors out of these
classes.
## Presets
Presets are named default props per kind, picked with `preset`. A block's props override the
preset's, and its `ui` merges over the preset's `ui` per slot with tailwind-merge:
```ts
nuxtUiTools: {
display: {
presets: {
text: { legal: { appearance: 'legal', icon: 'i-lucide-shield' } },
record: { dossier: { variant: 'row', surface: 'muted' } },
},
},
}
```
## Other variables
| Variable | Default |
| -------------------------------------------------------------------------------------------- | ---------------------------- |
| `--nut-display-radius` | `calc(var(--ui-radius) * 2)` |
| `--nut-display-track` | empty part of bars and rings |
| `--nut-display-code-bg`, `-ink`, `-muted`, `-line`, `-key`, `-string`, `-number`, `-literal` | code blocks |
Charts use the dashboard palette (`--nut-dash-s1…s6`, `--nut-dash-muted`, `--nut-dash-grid`).
Skeletons use the dashboard ghost and shimmer.
## Icons and words
Icons come from `appConfig.ui.icons` (`info`, `success`, `warning`, `error`, `copy`, `copyCheck`,
`eye`, `eyeOff`, `chevronDown`, `external`, …). Words such as « Show more · {count} »,
« Copied », « Today » or « This content could not be loaded. » are the `display` messages of the
ui-tools locale, overridable like any other ui-tools message.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |