Skip to content

Self-Dismissing Hint Chip

A copy-paste onboarding & coachmarks component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Onboarding & CoachmarksHTMLCSSany framework
Press K to search anywhere

Copy into your project

HTML
<!-- Self-Dismissing Hint Chip — inline tip with a countdown bar that auto-fades -->
<div class="nuda-ob2-hint-chip" role="status" aria-live="polite">
  <svg class="nuda-ob2-hint-chip__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    <circle cx="12" cy="12" r="9" />
    <path d="M12 8 L12 13 M12 16 L12 16.01" />
  </svg>
  <span class="nuda-ob2-hint-chip__text">Press <kbd>⌘</kbd><kbd>K</kbd> to search anywhere</span>
  <button class="nuda-ob2-hint-chip__close" type="button" aria-label="Dismiss tip">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
      <path d="M6 6 L18 18 M18 6 L6 18" />
    </svg>
  </button>
  <span class="nuda-ob2-hint-chip__bar" aria-hidden="true"></span>
</div>
CSS
.nuda-ob2-hint-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 290px;
  padding: 10px 12px;
  background: rgba(20,20,24,.96);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
  animation: nuda-ob2-hint-chip-in .4s cubic-bezier(.34,1.56,.64,1);
}

.nuda-ob2-hint-chip__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #e4ff54;
}

.nuda-ob2-hint-chip__text {
  flex: 1;
  font: 500 11px/1.4 ui-sans-serif,system-ui;
  color: #cfcfcf;
}

.nuda-ob2-hint-chip__text kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin: 0 1px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  font: 700 10px ui-monospace,monospace;
  color: #fafafa;
}

.nuda-ob2-hint-chip__close {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #777;
  cursor: pointer;
  border-radius: 5px;
}

.nuda-ob2-hint-chip__close::before {
  content: "";
  position: absolute;
  inset: -13px;
}

.nuda-ob2-hint-chip__close:hover {
  color: #fafafa;
}

.nuda-ob2-hint-chip__close:focus-visible {
  outline: 2px solid #e4ff54;
  outline-offset: 2px;
}

.nuda-ob2-hint-chip__close svg {
  width: 11px;
  height: 11px;
}

.nuda-ob2-hint-chip__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: #e4ff54;
  transform: scaleX(1);
  transform-origin: right;
  animation: nuda-ob2-hint-chip-countdown 6s linear forwards;
}

@keyframes nuda-ob2-hint-chip-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nuda-ob2-hint-chip-countdown {
  to {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-ob2-hint-chip {
    animation: none;
  }
  .nuda-ob2-hint-chip__bar {
    animation: none;
    transform: scaleX(1);
  }
}

How to use Self-Dismissing Hint Chip

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More onboarding & coachmarks components

← Browse all NudaUI components