Zoeken...  ⌘K GitHub

FormComplex Forms

Uitgebreid projectaanvraagformulier met contact-, bedrijfs- en projectsecties.

/form-complex
src/components/forms/FormComplex.astro
---
/**
 * FormComplex — uitgebreid projectaanvraagformulier met contact-, bedrijfs- en
 * projectsecties, dienstkeuze en akkoordverklaringen.
 *
 * Props:
 * - headline?: string
 * - sub?: string
 * - sectors?: string[]
 * - companySizes?: string[]
 * - revenues?: string[]
 * - services?: string[]
 * - budgets?: string[]
 * - goals?: string[]
 * - sources?: string[]
 * - termsHref?: string
 * - privacyHref?: string
 * - newsletterLabel?: string
 * - button?: string
 * - action?: string
 */
interface Props {
  headline?: string;
  sub?: string;
  sectors?: string[];
  companySizes?: string[];
  revenues?: string[];
  services?: string[];
  budgets?: string[];
  goals?: string[];
  sources?: string[];
  termsHref?: string;
  privacyHref?: string;
  newsletterLabel?: string;
  button?: string;
  action?: string;
}
const {
  headline = 'Uitgebreid projectaanvraagformulier',
  sub = 'Vul dit formulier zo volledig mogelijk in. Hoe meer informatie je geeft, hoe gerichter we onze offerte kunnen opstellen.',
  sectors = ['E-commerce', 'B2B dienstverlening', 'SaaS / Tech', 'Retail', 'Zorg', 'Horeca', 'Overheid', 'Anders'],
  companySizes = ['1–10 medewerkers', '11–50', '51–200', '200+'],
  revenues = ['< €250K', '€250K – €1M', '€1M – €5M', '€5M+'],
  services = ['Google Ads', 'Meta Ads', 'LinkedIn Ads', 'SEO', 'Content marketing', 'E-mail marketing', 'Website bouwen', 'Branding & design', 'Analytics setup', 'Strategie consult'],
  budgets = ['< €1.000', '€1.000 – €2.500', '€2.500 – €5.000', '€5.000 – €10.000', '> €10.000'],
  goals = ['Meer online omzet genereren', 'Lead generatie voor sales', 'Naamsbekendheid opbouwen', 'Klantretentie verbeteren', 'Nieuwe markten betreden'],
  sources = ['Google / zoekmachine', 'LinkedIn', 'Aanbeveling', 'Social media', 'Evenement', 'Anders'],
  termsHref = '/voorwaarden',
  privacyHref = '/privacy',
  newsletterLabel = 'Stuur mij de maandelijkse nieuwsbrief',
  button = 'Aanvraag indienen',
  action = '#',
} = Astro.props;
---

<section class="bl-section fcx">
  <div class="bl-inner fcx-inner">
    <div class="fcx-wrap">
      <div class="fcx-header">
        {headline && <h2 class="fcx-heading">{headline}</h2>}
        {sub && <p class="fcx-subtext">{sub}</p>}
      </div>
      <form class="fcx-form" action={action} novalidate>
        <fieldset class="fcx-section">
          <legend class="fcx-section-title">Contactgegevens</legend>
          <div class="fcx-grid-3">
            <div class="fcx-field"><label class="fcx-label" for="fcx-first">Voornaam *</label><input class="fcx-input" type="text" id="fcx-first" name="first_name" placeholder="Jan" required /></div>
            <div class="fcx-field"><label class="fcx-label" for="fcx-last">Achternaam *</label><input class="fcx-input" type="text" id="fcx-last" name="last_name" placeholder="de Vries" required /></div>
            <div class="fcx-field"><label class="fcx-label" for="fcx-title">Functietitel</label><input class="fcx-input" type="text" id="fcx-title" name="job_title" placeholder="Marketing Director" /></div>
          </div>
          <div class="fcx-grid-2">
            <div class="fcx-field"><label class="fcx-label" for="fcx-email">E-mailadres *</label><input class="fcx-input" type="email" id="fcx-email" name="email" placeholder="Je e-mailadres" required /></div>
            <div class="fcx-field"><label class="fcx-label" for="fcx-phone">Telefoonnummer</label><input class="fcx-input" type="tel" id="fcx-phone" name="phone" placeholder="Je telefoonnummer" /></div>
          </div>
        </fieldset>
        <fieldset class="fcx-section">
          <legend class="fcx-section-title">Bedrijfsinformatie</legend>
          <div class="fcx-grid-2">
            <div class="fcx-field"><label class="fcx-label" for="fcx-company">Bedrijfsnaam *</label><input class="fcx-input" type="text" id="fcx-company" name="company" placeholder="Bedrijf BV" required /></div>
            <div class="fcx-field"><label class="fcx-label" for="fcx-kvk">KvK-nummer</label><input class="fcx-input" type="text" id="fcx-kvk" name="kvk" placeholder="12345678" maxlength="8" /></div>
          </div>
          <div class="fcx-grid-3">
            <div class="fcx-field">
              <label class="fcx-label" for="fcx-sector">Branche *</label>
              <select class="fcx-select" id="fcx-sector" name="sector" required>
                <option value="">Selecteer</option>
                {sectors.map((s) => <option>{s}</option>)}
              </select>
            </div>
            <div class="fcx-field">
              <label class="fcx-label" for="fcx-size">Bedrijfsgrootte</label>
              <select class="fcx-select" id="fcx-size" name="company_size">
                <option value="">Selecteer</option>
                {companySizes.map((s) => <option>{s}</option>)}
              </select>
            </div>
            <div class="fcx-field">
              <label class="fcx-label" for="fcx-revenue">Jaaromzet (indicatief)</label>
              <select class="fcx-select" id="fcx-revenue" name="revenue">
                <option value="">Selecteer</option>
                {revenues.map((r) => <option>{r}</option>)}
              </select>
            </div>
          </div>
          <div class="fcx-field"><label class="fcx-label" for="fcx-website">Website URL</label><input class="fcx-input" type="url" id="fcx-website" name="website" placeholder="https://jouwbedrijf.nl" /></div>
        </fieldset>
        <fieldset class="fcx-section">
          <legend class="fcx-section-title">Projectdetails</legend>
          <div class="fcx-field">
            <span class="fcx-label">Gewenste diensten * (meerdere mogelijk)</span>
            <div class="fcx-checkgrid">
              {services.map((sv) => (
                <label class="fcx-check-item">
                  <input class="fcx-check" type="checkbox" name="services" value={sv} /> <span>{sv}</span>
                </label>
              ))}
            </div>
          </div>
          <div class="fcx-grid-2">
            <div class="fcx-field">
              <label class="fcx-label" for="fcx-budget">Maandelijks budget</label>
              <select class="fcx-select" id="fcx-budget" name="budget">
                <option value="">Selecteer</option>
                {budgets.map((b) => <option>{b}</option>)}
              </select>
            </div>
            <div class="fcx-field"><label class="fcx-label" for="fcx-start">Gewenste startdatum</label><input class="fcx-input" type="date" id="fcx-start" name="start_date" /></div>
          </div>
          <div class="fcx-field">
            <label class="fcx-label" for="fcx-goal">Primaire doelstelling *</label>
            <select class="fcx-select" id="fcx-goal" name="primary_goal" required>
              <option value="">Selecteer doelstelling</option>
              {goals.map((g) => <option>{g}</option>)}
            </select>
          </div>
          <div class="fcx-field"><label class="fcx-label" for="fcx-description">Projectomschrijving *</label><textarea class="fcx-textarea" id="fcx-description" name="description" rows="5" placeholder="Beschrijf je project, huidige situatie, uitdagingen en verwachtingen..." required></textarea></div>
          <div class="fcx-field"><label class="fcx-label" for="fcx-competitors">Bekende concurrenten</label><input class="fcx-input" type="text" id="fcx-competitors" name="competitors" placeholder="Bijv. Bedrijf A, Bedrijf B" /></div>
        </fieldset>
        <fieldset class="fcx-section">
          <legend class="fcx-section-title">Overige informatie</legend>
          <div class="fcx-field">
            <label class="fcx-label" for="fcx-source">Hoe heb je ons gevonden?</label>
            <select class="fcx-select" id="fcx-source" name="source">
              <option value="">Selecteer</option>
              {sources.map((s) => <option>{s}</option>)}
            </select>
          </div>
          <div class="fcx-field"><label class="fcx-label" for="fcx-remarks">Overige opmerkingen</label><textarea class="fcx-textarea" id="fcx-remarks" name="remarks" rows="3" placeholder="Alles wat niet in bovenstaande velden past..."></textarea></div>
          <div class="fcx-checks-final">
            <label class="fcx-check-label"><input class="fcx-check-single" type="checkbox" name="terms" required /> Ik ga akkoord met de <a href={termsHref} class="fcx-link">algemene voorwaarden</a> *</label>
            <label class="fcx-check-label"><input class="fcx-check-single" type="checkbox" name="privacy" required /> Ik ga akkoord met de <a href={privacyHref} class="fcx-link">privacyverklaring</a> *</label>
            <label class="fcx-check-label"><input class="fcx-check-single" type="checkbox" name="newsletter" /> {newsletterLabel}</label>
          </div>
        </fieldset>
        <button class="fcx-submit" type="submit">{button}</button>
      </form>
    </div>
  </div>
</section>

<style>
.fcx-wrap{max-width:760px}
.fcx-header{margin-bottom:2rem}
.fcx-heading{font-size:clamp(1.5rem,3vw,2rem);font-weight:800;color:var(--color-primary, #0a0a0a);letter-spacing:-.03em;margin:0 0 .5rem}
.fcx-subtext{font-size:1rem;color:#6b7280;margin:0;line-height:1.6}
.fcx-form{display:flex;flex-direction:column;gap:2rem}
.fcx-section{border:1px solid #e5e5e5;border-radius:12px;padding:1.75rem;margin:0}
.fcx-section-title{font-size:.8125rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:#6b7280;padding:0 .5rem;margin-bottom:1.25rem}
.fcx-grid-2{display:grid;grid-template-columns:1fr;gap:1.1rem;margin-bottom:1.1rem}
.fcx-grid-3{display:grid;grid-template-columns:1fr;gap:1.1rem;margin-bottom:1.1rem}
.fcx-field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1.1rem}
.fcx-field:last-child{margin-bottom:0}
.fcx-label{font-size:1rem;font-weight:600;color:var(--color-primary, #0a0a0a)}
.fcx-input,.fcx-select,.fcx-textarea{padding:.65rem .875rem;border:1.5px solid #d1d5db;border-radius:8px;font-size:1rem;color:var(--color-primary, #0a0a0a);background:#fff;transition:border-color .2s;font-family:inherit;box-sizing:border-box;width:100%}
.fcx-input:focus,.fcx-select:focus,.fcx-textarea:focus{outline:none;border-color:var(--color-accent, #6366f1);box-shadow:0 0 0 3px #6366f11f}
.fcx-textarea{resize:vertical;min-height:100px}
.fcx-checkgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:.5rem}
.fcx-check-item{display:flex;align-items:center;gap:.4rem;padding:.5rem .8rem;background:#f9f9f9;border-radius:7px;font-size:.9375rem;color:#374151;cursor:pointer;border:1.5px solid transparent}
.fcx-check-item:has(input:checked){border-color:var(--color-accent, #6366f1);background:#eef2ff;color:var(--color-accent, #6366f1)}
.fcx-check{accent-color:var(--color-accent, #6366f1)}
.fcx-checks-final{display:flex;flex-direction:column;gap:.6rem}
.fcx-check-label{display:flex;align-items:flex-start;gap:.5rem;font-size:.9375rem;color:#374151;cursor:pointer;line-height:1.4}
.fcx-check-single{accent-color:var(--color-accent, #6366f1);flex-shrink:0;margin-top:2px}
.fcx-link{color:var(--color-accent, #6366f1);text-decoration:none}
.fcx-submit{padding:1rem 2.5rem;background:var(--color-accent, #6366f1);color:#fff;border:none;border-radius:10px;font-size:1rem;font-weight:700;cursor:pointer;transition:opacity .2s,transform .15s;align-self:flex-start}
.fcx-submit:hover{opacity:.88;transform:translateY(-1px)}
@media(min-width:640px){.fcx-grid-2{grid-template-columns:1fr 1fr}.fcx-grid-3{grid-template-columns:1fr 1fr 1fr}}
</style>

Props

Prop Type Default Beschrijving
headline string - Koptekst
sub string - Ondertitel
sectors string[] - Branche-opties
companySizes string[] - Bedrijfsgrootte-opties
revenues string[] - Jaaromzet-opties
services string[] - Diensten-checkboxes
budgets string[] - Budget-opties
goals string[] - Doelstelling-opties
sources string[] - Bron-opties
termsHref string '/voorwaarden' Link algemene voorwaarden
privacyHref string '/privacy' Link privacyverklaring
newsletterLabel string - Label nieuwsbrief-opt-in
button string 'Aanvraag indienen' Knoptekst
action string '#' Form action URL

* = verplicht