AI Input Generator.

Describe your form and MeDo generates the text input and textarea together — labels, helper text, error states, prefix and suffix affixes, character counters, and autosizing, all wired to the right accessibility attributes.

Input
Input

The Box Is the Smallest Part of an Input

Most of the work in an input has nothing to do with the field itself. The label, the helper text, the error slot, and the spacing between them are what make a form usable, and they are the parts component libraries tend to leave to the consumer. So teams write bespoke wrapper markup for each form, and the vertical rhythm drifts field by field until nothing lines up. Generating the label, description, and error region as one unit fixes their relationship once. It also removes the most common accessibility defect in web forms, which is an error message rendered next to a field but never programmatically connected to it.

6 templates

Input Templates You Can Generate

Every template is a real prompt, not a screenshot. Copy it into any AI editor, or run it in MeDo and get React + Tailwind code back.

BasicLabel + Field

Labeled Input With Helper Text

The baseline every other field extends. Label, field, and a message region that already occupies its line at rest so the form does not grow when an error appears.

Create a text input component with a visible label above the field, wired with a generated id and a matching for attribute rather than wrapping the input in the label. Below it, a helper text line linked through aria-describedby. Reserve the height of that line at rest so the form does not shift when an error replaces it. The field is 40px tall with an 8px radius, a 1px grey border, and a 2px focus-visible ring offset from the border. Add a required prop that sets the required attribute and appends a visually hidden "required" to the label rather than relying on an asterisk alone. Accept type, inputMode and autocomplete as props with no defaults, so each call site declares them.

Try in MeDo
ErrorsValidation States

Error, Success and Warning States

Where most form bugs live. An error message rendered beside a field but never connected to it is the most common accessibility defect in web forms.

Add validation states to a text input: error with a red border, a red message replacing the helper text, aria-invalid="true", and the message linked through aria-describedby so it is announced when focus enters the field. Add success and warning states that change the border and the leading icon but keep the same message slot and line height. Never signal state by border color alone — pair every state with an icon and text. Validate on blur, then revalidate on change only once the field is already in an error state, so a half-typed email is not flagged mid-entry. Announce late server-side errors through a polite live region.

Try in MeDo
AffixesAffix Slots

Prefix and Suffix Inside the Field

Search icons, currency symbols, unit suffixes, password toggles. The trap is padding — an affix rendered over the field without matching inset padding lets typed text slide underneath it.

Create a text input with optional prefix and suffix slots rendered inside the field border. Static affixes such as a currency symbol or a .com suffix get aria-hidden and muted text; interactive affixes such as a password visibility toggle or a clear button render as real buttons with their own aria-label and stay reachable by keyboard. Increase the field padding to match each affix width so typed text never slides under it. Keep the focus ring on the outer wrapper, not the bare input, so the ring surrounds the affixes too. Include a search variant with a leading magnifier and a trailing clear button that appears only when the field has a value.

Try in MeDo
TextareaAutosize Textarea

Growing Textarea With a Counter

A fixed three-row box for a support message forces people to scroll inside a scroll. Growing to a cap keeps the submit button on screen.

Create a textarea that shares the label, helper text and error layout of the text input. Autosize from a three-row minimum up to eight rows, recalculating the height from scrollHeight on input after resetting it, then switch to internal scrolling at the cap so a long message cannot push the submit button off screen. Add an optional character counter in the bottom right showing used and total, turning amber at 90 percent of the limit and red at the limit, announced through a polite live region rather than on every keystroke. Disable the native resize handle only when autosizing is on, otherwise leave it available.

Try in MeDo
FormattingMasked Field

Card, Phone and Date Inputs

Formatted fields where the input event rewrites the value. Get the caret handling wrong and editing the middle of a card number jumps the cursor to the end on every keystroke.

Create a formatted input for card numbers, phone numbers and expiry dates. Insert separators as the user types — spaces every four digits for cards, a slash after the month for expiry — while storing the unformatted value in state and submitting that. Preserve the caret position when the mask inserts a character mid-string, rather than letting the value reset send it to the end. Set inputMode="numeric" and the correct autocomplete token: cc-number, tel, cc-exp. Accept paste of an already-formatted value by stripping non-digits first. Validate length on blur and keep the field editable in the error state.

Try in MeDo
LayoutField Group

Multi-Field Row With Shared Rhythm

City and postcode on one line, expiry and CVC side by side. The point is a single spacing scale, since per-form wrapper markup is what makes vertical rhythm drift.

Create a form field group component that lays out two or three inputs on one row using a grid, collapsing to a single column below 640px. Keep a shared vertical gap between rows and align the labels on a single baseline even when one field carries helper text and its neighbor does not, by reserving the message line in every field. Group semantically related fields in a fieldset with a legend, such as an address block, so screen readers announce the group name before each field. Let each field declare its own width in grid columns rather than a hardcoded percentage, so a postcode field can be narrower than a city field.

Try in MeDo

How to Customize Your Input

Always ask for a real label

A placeholder is not a label. It disappears the moment someone starts typing, which strands anyone who is interrupted mid-form, and most screen readers treat it as optional text. Ask for a visible label tied to the field with a for attribute, and use the placeholder only for format examples like MM/YY.

Reserve space for the error message

If the error text appears only when validation fails, the field below it jumps down on submit. Say that the helper and error region occupies a fixed line height at rest so the form height never changes when messages appear.

Name the input types you need

Specify type and inputMode per field: email, tel, and numeric all summon different mobile keyboards. Pair them with the right autocomplete tokens, such as email, tel, current-password, and one-time-code, so browsers and password managers can fill the form.

Decide when validation fires

Validating on every keystroke marks a half-typed email as wrong before anyone finishes. Ask for validation on blur with revalidation on change once a field is already in an error state, which corrects mistakes without nagging.

Who Uses the Input Component

Signup or login form

Email and password fields with an inline visibility toggle in the suffix slot, a password strength hint in the helper text, and autocomplete tokens set so browsers offer saved credentials instead of blank fields.

Checkout flow

Card number, expiry, and postal code inputs with numeric input modes, a currency prefix on the amount field, and validation that runs on blur so a partially typed card number is never flagged as invalid.

Support or contact form

A short subject input above an autosizing message textarea with a 1,000-character counter, so long messages expand the field rather than forcing people to scroll inside a fixed box.

Dashboard settings panel

Dense rows of small inputs with labels aligned to the left, read-only fields for values the user cannot change, and helper text explaining what each setting affects.

Input Patterns for Different Websites

The same input component, tuned to the kind of site it ships on.

01 / 06

SaaS Signup and Login Inputs

Two fields decide whether the account gets created, so the autocomplete tokens matter more than the styling. Set email and current-password on login and new-password on signup, or password managers offer the wrong entry and people retype credentials they already saved. Put the visibility toggle in the suffix slot as a real button, not a click handler on an icon.

Input Styles and Variants

Pick the variant that matches the rest of the page, then generate it.

01 / 06

Outlined Input

A 1px border on a light surface with the label above — the default that works in the widest range of layouts. Keep the focus ring offset from the border rather than replacing it, so the resting and focused widths match and the field does not appear to move on focus.

Input in React, Next.js, Vue and Svelte

React, Next.js, Vue 3, SvelteKit, Astro or plain HTML — the same input, six ways to drop it in.

01 / 06

React Input

Generate the id with useId so label association survives rendering the field twice on one page. Forward the ref so form libraries like React Hook Form can register the element directly.

src/components/Input.tsx

export const Input = forwardRef(function Input(
  { label, hint, error, ...props },
  ref
) {
  const id = useId()
  return (
    <div className="space-y-1.5">
      <label htmlFor={id}>{label}</label>
      <input id={id} ref={ref} aria-invalid={!!error}
        aria-describedby={id + '-msg'} {...props} />
      <p id={id + '-msg'}>{error ?? hint}</p>
    </div>
  )
})

How to Add Your Input to a Project

Four steps, from picking a input template to shipping it in production.

01~30s

Pick an Input Template

Scan the six templates and start from the field you actually need — labeled text input, affix slots for search or currency, autosizing textarea, or a masked card field.

02~10s

Copy the Prompt

Take the prompt into MeDo, Lovable, Bolt, v0 or Cursor. Name the type, inputMode and autocomplete token per field before you run it, since those three decide which mobile keyboard opens and whether autofill works.

03~1min

Generate and Refine

You get React + Tailwind back with a live preview. Follow up in plain English — "validate on blur only", "add a clear button in the suffix", "reserve the error line" — rather than editing the aria wiring by hand.

04~2min

Wire It to Your Form State

Register the forwarded ref with React Hook Form, Formik or a Server Action and pass the resolver error straight into the error prop. The component owns layout and aria; your form library owns the validation rules.

Common Questions About Input

How do I generate a form input with AI?

Describe the field, its label, its helper text, and the states you need in one prompt, such as "email input with a label, hint text, and an error state." MeDo generates the label, field, and message region as a single component with the aria attributes already connected. You can list several field types in the same prompt and get a consistent set back.

What is the difference between a placeholder and a label?

A label names the field permanently and stays visible while someone types. A placeholder is temporary hint text inside the field that vanishes on input, so using it as the only label leaves people guessing what they already filled in. Use a label for the name of the field and a placeholder only for a format example.

Should input errors appear while typing or after submit?

Validate on blur rather than on every keystroke, so a partially typed value is not marked wrong mid-entry. Once a field is already showing an error, revalidate on change so the message clears as soon as the input becomes valid. Reserve submit-time validation for checks that need the whole form, such as password confirmation.

Can AI generate accessible input fields?

Yes. MeDo associates the label with the field using for and id, links helper and error text through aria-describedby, and sets aria-invalid when validation fails. Mention required fields in your prompt and it will mark them with the required attribute rather than relying on an asterisk alone.

How do I make a textarea grow with its content?

Ask for an autosizing textarea with a minimum and maximum row count, for example three rows growing to eight before it scrolls. The height is recalculated from the scroll height on input, and capping the maximum keeps a long message from pushing the submit button off screen.

Does the autocomplete attribute actually matter?

It does. Correct autocomplete tokens let browsers and password managers fill fields in one step, which measurably reduces abandonment on signup and checkout forms. Tell MeDo what each field collects and it will set the matching token, including the address and payment values that are easy to get wrong.