Token field
Addresses turn into removable tokens inside the field as you type them. A bad one stays, dashed and flagged, until it is fixed, and a count shows how many are left.
Press comma or Enter after each address. Up to 5.
- dispatch@norrlandtimber.se
- ana.ferreira@quaysideimports.pt
- gate3@kestrel
On this shipment
The code
Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.
<div class="ukc-input-token-field">
<div class="tk">
<label for="ukc-input-token-field-in">Send proof of delivery to</label>
<p class="hint" id="ukc-input-token-field-h">Press comma or Enter after each address. Up to 5.</p>
<div class="box">
<ul class="toks" role="list">
<li class="tok"><span class="t">dispatch@norrlandtimber.se</span><button type="button" aria-label="Remove dispatch@norrlandtimber.se"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg></button></li>
<li class="tok"><span class="t">ana.ferreira@quaysideimports.pt</span><button type="button" aria-label="Remove ana.ferreira@quaysideimports.pt"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg></button></li>
<li class="tok bad"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l9.5 17h-19z"/><path d="M12 10v4M12 17h.01"/></svg><span class="t">gate3@kestrel</span><button type="button" aria-label="Remove gate3@kestrel, not a full address"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg></button></li>
</ul>
<input id="ukc-input-token-field-in" type="email" value="ops@" autocomplete="off" aria-describedby="ukc-input-token-field-h ukc-input-token-field-err">
</div>
<div class="meta">
<p class="err" id="ukc-input-token-field-err"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l9.5 17h-19z"/><path d="M12 10v4M12 17h.01"/></svg><span>gate3@kestrel is not a full address. Fix it or remove it.</span></p>
<p class="cnt">3 of 5</p>
</div>
<div class="sug">
<span>On this shipment</span>
<button type="button"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>Consignee</button>
<button type="button"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>Customs broker</button>
</div>
</div>
</div>
.ukc-input-token-field { position: relative; font-family: var(--uk-font-body, system-ui, sans-serif); color: var(--uk-ink); font-size: 15px; line-height: 1.5;
--tint: color-mix(in srgb, var(--uk-accent) 12%, var(--uk-paper));
--tint-strong: color-mix(in srgb, var(--uk-accent) 22%, var(--uk-paper));
--accent-deep: color-mix(in srgb, var(--uk-accent) 72%, black);
--ink-soft: color-mix(in srgb, var(--uk-ink) 8%, var(--uk-paper));
--line-strong: color-mix(in srgb, var(--uk-ink) 32%, var(--uk-paper));
--danger-tint: color-mix(in srgb, var(--uk-danger) 12%, var(--uk-paper));
--high-tint: color-mix(in srgb, var(--uk-highlight) 28%, var(--uk-paper)); }
.ukc-input-token-field *, .ukc-input-token-field *::before, .ukc-input-token-field *::after { box-sizing: border-box; }
.ukc-input-token-field :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-input-token-field :where(ul, ol) { padding: 0; list-style: none; }
.ukc-input-token-field :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-input-token-field :where(a) { color: inherit; }
.ukc-input-token-field svg { flex: none; }
.ukc-input-token-field .tk { display: grid; gap: 6px; max-width: 480px; }
.ukc-input-token-field label { font-weight: 700; }
.ukc-input-token-field .hint { margin-top: -4px; font-size: 13px; color: var(--uk-muted); }
.ukc-input-token-field .box { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid var(--line-strong); border-radius: min(var(--uk-radius-md), 12px); background: var(--uk-paper); cursor: text; }
.ukc-input-token-field .box:focus-within { border-color: var(--uk-accent); box-shadow: 0 0 0 3px var(--tint-strong); }
.ukc-input-token-field .toks { display: contents; }
.ukc-input-token-field .tok { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; height: 30px; padding: 0 3px 0 10px; border: 1px solid var(--uk-line); border-radius: var(--uk-radius-sm); background: var(--ink-soft); font-size: 13px; }
.ukc-input-token-field .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ukc-input-token-field .tok button { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--uk-radius-sm); background: transparent; color: var(--uk-muted); cursor: pointer; }
.ukc-input-token-field .tok button:hover { background: var(--uk-ink); color: var(--uk-paper); }
.ukc-input-token-field .tok button:focus-visible { outline: 2px solid var(--uk-accent); outline-offset: 1px; }
.ukc-input-token-field .tok.bad { padding-left: 8px; border: 1px dashed var(--uk-danger); background: var(--danger-tint); font-weight: 600; }
.ukc-input-token-field .tok.bad > svg { color: var(--uk-danger); }
.ukc-input-token-field .box input { flex: 1 1 110px; min-width: 0; height: 30px; padding: 0 4px; border: 0; background: transparent; font-size: 14px; }
.ukc-input-token-field .box input:focus { outline: none; }
.ukc-input-token-field .meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ukc-input-token-field .err { display: flex; gap: 7px; font-size: 13px; font-weight: 600; color: var(--uk-danger); }
.ukc-input-token-field .err svg { margin-top: 2px; }
.ukc-input-token-field .cnt { flex: none; font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 12px; color: var(--uk-muted); }
.ukc-input-token-field .sug { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--uk-line); font-size: 13px; color: var(--uk-muted); }
.ukc-input-token-field .sug span { margin-right: 4px; }
.ukc-input-token-field .sug button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px; border: 1px solid var(--line-strong); border-radius: var(--uk-radius-sm); background: transparent; color: var(--uk-ink); font-size: 13px; cursor: pointer; }
.ukc-input-token-field .sug button:hover { background: var(--ink-soft); }
.ukc-input-token-field .sug button:focus-visible { outline: 2px solid var(--uk-accent); outline-offset: 2px; }
More inputs
All 27Capitals, numbers and spaces. 16 characters fit on one strip.
14 of 16
Lot 0417. Ercol armchair, 1962
Whole pounds. Buyers see the asking price only, and lower offers are turned down for you.