FormField

App

Form field wrapper: label + slot + hint + error. Exposes computed `id`, `aria-describedby` and `aria-invalid` via the `data-form-field` container — the static EJS counterpart of the NextJS react-hook-form binding.

With hint

Preview

We'll never share your email.

Code
<%- include('modules/app/FormField', {
  name:  'email',
  label: 'Email',
  hint:  "We'll never share your email.",
  children: ``
}) %>

Required with error

Preview
Code
<%- include('modules/app/FormField', {
  name:     'password',
  label:    'Password',
  required: true,
  error:    'Password must be at least 8 characters.',
  children: ``
}) %>
Source modules/app/FormField.ejs