# Result Item

> A copy-paste Command Palette component from NudaUI. Pure HTML + CSS, zero dependencies, MIT licensed.

| | |
| --- | --- |
| Id | `result-item` |
| Category | Command Palette (`command-palette`) |
| Languages | html, css |
| Needs JavaScript | no |
| Licence | MIT |
| JSON | https://nudaui.dev/api/components/result-item.json |

## Code

Paste this verbatim. Nothing here needs a build step.

### HTML

```html
<!-- Result Item — toggle .is-active for keyboard navigation -->
<div class="nuda-resitem is-active">
  <span class="nuda-resitem__icon">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
         stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
      <path d="M12 2 L13.5 8.5 L20 10 L13.5 11.5 L12 18 L10.5 11.5 L4 10 L10.5 8.5 Z" />
    </svg>
  </span>
  <div class="nuda-resitem__text">
    <span class="nuda-resitem__title">Generate code</span>
    <span class="nuda-resitem__hint">From prompt</span>
  </div>
  <span class="nuda-resitem__kbd"><kbd>↵</kbd></span>
</div>
```

### CSS

```css
/* Result Item
   Single command-palette row: icon, title + hint, enter shortcut.
   Customize: --res-accent */

.nuda-resitem {
  --res-accent: #e4ff54;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  max-width: 320px;
}

.nuda-resitem:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fafafa;
}

.nuda-resitem.is-active {
  background: rgba(228, 255, 84, 0.1);
  color: var(--res-accent);
}

.nuda-resitem__icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(228, 255, 84, 0.1);
  border-radius: 6px;
  color: var(--res-accent);
}

.nuda-resitem__icon svg { width: 14px; height: 14px; }

.nuda-resitem__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.nuda-resitem__title {
  font: 600 0.875rem ui-sans-serif, system-ui, sans-serif;
  color: inherit;
}

.nuda-resitem.is-active .nuda-resitem__title,
.nuda-resitem:hover .nuda-resitem__title { color: #fafafa; }

.nuda-resitem__hint {
  font: 500 0.7rem ui-sans-serif, system-ui, sans-serif;
  color: #63636e;
}

.nuda-resitem__kbd kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  font: 700 0.75rem ui-monospace, monospace;
  color: #a1a1aa;
  line-height: 1;
}
```

### Preview-only CSS

Extra styling the live preview injects. Copy it only if you want the demo's exact framing.

```css

      .nuda-resitem{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;background:transparent;color:#a1a1aa;cursor:pointer;transition:background .15s,color .15s;width:170px}
      .nuda-resitem:hover{background:rgba(255,255,255,.04);color:#fafafa}
      .nuda-resitem.is-active{background:rgba(228,255,84,.1);color:#e4ff54}
      .nuda-resitem__icon{flex-shrink:0;width:22px;height:22px;display:flex;align-items:center;justify-content:center;background:rgba(228,255,84,.1);border-radius:5px;color:#e4ff54}
      .nuda-resitem__icon svg{width:12px;height:12px}
      .nuda-resitem__text{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;line-height:1.2}
      .nuda-resitem__title{font:600 11px ui-sans-serif,system-ui;color:inherit}
      .nuda-resitem.is-active .nuda-resitem__title,.nuda-resitem:hover .nuda-resitem__title{color:#fafafa}
      .nuda-resitem__hint{font:500 9px ui-sans-serif,system-ui;color:#63636e}
      .nuda-resitem__kbd kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);border-radius:4px;font:700 10px ui-monospace,monospace;color:#a1a1aa;line-height:1}
    
```

## Using it

- Drop the HTML wherever you need it — JSX, Blade, Jinja, ERB, or a plain `.html` file.
- Put the CSS in a global stylesheet, a `<style>` block, or whatever your build expects.
- Colour, size and timing read from CSS custom properties: override them on `:root` or any parent.
- Class names are prefixed `nuda-*`, so nothing collides with Tailwind utilities.

---

Canonical HTML version: https://nudaui.dev/components/result-item
