Bundles save up to 25%. See every bundle

Code Boss
Dark

Full screen

What it does

A complete "enter your sign-in code" card, lit from below like a fire. Each slot has a small coal at its foot. When you type, the digit catches white-hot, throws a few sparks and cools to a warm glow. While the code is checked, heat runs along the row. A wrong code puts the coals out: the digits go grey and crumble away as ash. A right one makes every digit flare and burn off, and a spark etches a check that cools to gold before a Continue button appears.

Good for
Sign-in codes, two-step verification, email and phone confirmation, any screen that asks for a one-time code.
How it works
One real input sits invisibly over the slots, so paste, SMS and email autofill and screen readers work the usual way. Your check runs as soon as the code is complete, and its answer picks the ending. A resend button counts down before it can be pressed.
How to use
Copy two files, paste the markup, pass your own onComplete(code). Four or eight digits: add or remove slots.

Specs

Price
$12, one payment
Version
1.0.0
Code size
9.3 KB gzipped
Dependencies
None
Built with
HTML, CSS, JavaScript
Category
Form
Licence
Unlimited personal and client projects
In the zip
  • ember.css ember.jsthe component
  • index.htmla plain example page
  • README.md package.json vite.config.js LICENSE.md

Use it in your project

  1. Copy ember.css and ember.js into your project.
  2. Add the markup from index.html (the block between the COMPONENT comments). One .ember-slot per digit: six are in the example, four or eight work the same.
  3. Start it and connect your own check:
import { init } from './ember.js';

const ember = init(document.querySelector('.ember'), {
  onComplete: async (code) => {
    const res = await fetch('/api/verify', { method: 'POST', body: JSON.stringify({ code }) });
    if (!res.ok) throw new Error('That code has expired. Send a new one.'); // shown under the field
  },
  onResend: () => fetch('/api/send-code', { method: 'POST' }),
  onContinue: () => { location.href = '/dashboard'; },
});

onComplete runs as soon as the last digit is in. Return false or throw to show an error: the digits go grey and crumble away as ash so the user can type again. Resolve and the digits burn off, a spark etches a check that cools to gold, and a Continue button appears.

There is one real <input> under the slots, so the things that normally work with a code field still do: paste, SMS and email autofill (autocomplete="one-time-code"), the numeric keyboard on phones, and screen readers.

Questions

What exactly do I get?

The full source, an example page and a README. No account, no framework.

Can I use it in client projects?

Yes, in unlimited projects. You can't resell or share the source itself.

Does it check the code?

It calls your function with the code and shows the answer. Checking belongs on your server; the demo only compares against a fixed code.

Does autofill work?

Yes. It's a normal input with autocomplete="one-time-code", so phones offer the code from the message, and the digits light one after another.

Is it accessible?

One labelled field, numeric keyboard on phones, live status messages, aria-invalid on errors, and focus moves to Continue once signed in. With reduced motion there are no sparks or ash.

Can I turn the sparks off?

Yes, sparks: false keeps the glow and drops the particles.

Light and dark?

Both are designed, and every colour is a CSS variable.

What if it doesn't work for me?

If it doesn't work like the demo, you get a refund within 14 days.

Still have a question? Email us. The person who made it answers.

Your cart

Your cart is empty. Browse components

Full screen