Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

emil-forms-and-inputs

БесплатноБез исполняемых скриптовНе проверен

Build forms, inputs, buttons, and controls that feel right — label association, 16px inputs to stop iOS zoom, focus states, validation timing…

freekmurzeот freekmurze★ 1 019 звёзд на GitHub

Об этом скилле

Forms & Inputs

Forms are where users do real work, and they notice every rough edge: the label that doesn't focus the input, the page that zooms on iOS, the button that fires twice, the Enter key that does nothing. None of these are hard to fix — they're just easy to forget. Wire up the semantics the platform gives you (<form>, <label>, <button>), then layer on the details below. Where CSS is involved, implement it in the project's existing styling system (Tailwind, CSS Modules, styled-components — whatever is already there); the values matter, the syntax doesn't.

Core Principles

1. Every input gets an associated label

Clicking the label must focus the input:

<label for="email">Email</label>
<input id="email" type="email" />

<!-- Or wrap the input -->
<label>
  Email
  <input type="email" />
</label>

2. Use the right input type

<input type="email" />    <input type="password" />
<input type="tel" />      <input type="url" />
<input type="number" />   <input type="search" />

This gets you the right mobile keyboard, browser validation, and autofill behavior for free.

3. Input font size ≥ 16px, always

Inputs smaller than 16px cause iOS Safari to zoom in on focus. Set it globally:

input, textarea, select {
  font-size: 16px;
}

If the design calls for smaller text, keep the computed font-size at 16px on touch devices and scale visually some other way — never below 16px.

4. Visible focus states

Every input and control needs a clear focus state. Style :focus-visible (not bare :focus) so keyboard users get a ring without mouse users seeing one on every click, and never outline: none without a replacement:

input:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }

5. Kill noisy browser behaviors when they don't help

Disable spellcheck and autocomplete most of the time for cleaner UX (usernames, search fields, codes, slugs — anything that isn't a real address/identity field). Keep autocomplete ON for email, name, address, and payment fields — there it genuinely helps. Disable 1Password's overlay on fields where it doesn't belong:

<input type="text" spellcheck="false" autocomplete="off" />
<input data-lpignore="true" data-1p-ignore />

6. Input decorations overlay the input, they don't sit beside it

Prefix/suffix icons and labels should be absolutely positioned on top of the input (with padding making room), not rendered as sibling elements — otherwise clicking them does nothing and the "input" border lies about the hit area:

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-field { padding-left: 40px; }

Clickable decorations (like a clear button) should refocus the input:

<button
  className="input-icon-button"
  onClick={() => inputRef.current?.focus()}
>
  <SearchIcon />
</button>

7. Autofocus: yes in modals, never on touch

Autofocus the first input when a modal opens (if the modal contains one). Do NOT autofocus on touch devices — it pops the keyboard open unexpectedly:

const isTouchDevice = 'ontouchstart' in window;

<input autoFocus={!isTouchDevice} />

8. Always wrap inputs in a <form> — Enter must submit

<form onSubmit={handleSubmit}>
  <input type="text" />
  <button type="submit">Submit</button>
</form>

For textareas (where Enter inserts a newline), support Cmd+Enter (Mac) / Ctrl+Enter (Windows) to submit:

function handleKeyDown(e) {
  if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
    handleSubmit();
  }
}

9. Buttons are <button> elements — with a loading state

Never put click handlers on elements that aren't buttons:

<!-- Good -->
<button onClick={handleClick}>Click me</button>
<!-- Bad -->
<div onClick={handleClick}>Click me</div>
<span onClick={handleClick}>Click me</span>

Disable the button while submitting to prevent duplicate network requests, and say what's happening:

const [isSubmitting, setIsSubmitting] = useState(false);

<button
  disabled={isSubmitting}
  onClick={async () => {
    setIsSubmitting(true);
    await submitForm();
    setIsSubmitting(false);
  }}
>
  {isSubmitting ? 'Submitting...' : 'Submit'}
</button>

Make buttons feel pressable with a subtle scale on :active:

.button:active { transform: scale(0.97); }

If a button's action has a keyboard shortcut, surface it as a tooltip:

<Tooltip content="Save (Cmd+S)">
  <button onClick={save}>Save</button>
</Tooltip>

10. Validate late, not on every keystroke

Don't flag a field as invalid while the user is still typing their first attempt — validate on blur or on submit. Once a field HAS shown an error, switch to validating on change so the error clears the moment they fix it ("reward early, punish late").

Colocate error messages wi

Полный SKILL.md на GitHub

Установить emil-forms-and-inputs в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл emil-forms-and-inputs?

Build forms, inputs, buttons, and controls that feel right — label association, 16px inputs to stop iOS zoom, focus states, validation timing, loading/disabled button states, Enter and Cmd+Enter submission, and autofocus rules. Use when building or reviewing any form, text input, textarea, search field, login/signup flow, settings page, checkout, button, checkbox, or submit handler. Triggers on: form, input, textarea, select, button, checkbox, radio, toggle, submit, onSubmit, validation, error message, placeholder, label, autofocus, autocomplete, spellcheck, iOS zoom, font-size 16px, focus ring, focus-visible, loading state, disabled, double submit, duplicate request, Enter to submit, Cmd+Enter, keyboard shortcut, destructive action, confirmation, delete, clear button, input icon, prefix, suffix, search field, login form, signup form, 1Password, password manager.

Как установить скилл emil-forms-and-inputs?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл emil-forms-and-inputs запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить emil-forms-and-inputs с