Files
AndreaSlopFotografie/aidlc-docs/features/homepage-sections/construction/prijzen/functional-design/frontend-components.md
T
SluijsensandClaude Opus 5.5 30dab1af42 Adds the Prijzen section to the homepage
Shows the three live packages as cards with their price and what is
included. Each card links to the contact section with ?pakket=<id>, so
the contact form can preselect it. Invalid packages from the CMS are
skipped and the pakket value is only accepted when it names a package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 01:07:36 +02:00

3.3 KiB

Frontend Components — Unit 3: Prijzen

Hierarchy

graph TD
    Route["routes/index.tsx"] --> Pricing["home/Pricing"]
    Pricing --> Section["HomeSection"]
    Pricing --> Deco["Decorations x2"]
    Pricing --> Heading["SectionHeading"]
    Pricing --> Card["home/Pricing/PriceCard x n"]
    Card --> Link["Book link: Chakra Link with linkButton style around RouterLink"]
    Lib["lib: formatPrice, visiblePackages, bookLabel"] -.-> Pricing
    Lib -.-> Card

    classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
    classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
    classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
    class Route root;
    class Pricing,Section,Deco,Heading,Card,Link ui;
    class Lib logic;

Text alternative: the home route renders Pricing, which uses HomeSection, two decorations, SectionHeading and one PriceCard per shown package; each card has a book link; the pure helpers supply the shown packages, prices and link labels.

Pricing

  • Props: { content: HomeContent['pricing']; packages: PricingPackage[] }
  • Behaviour: renders visiblePackages(packages); if none remain, the section is not rendered at all (no empty heading).
  • Layout: HomeSection on paper (plain), data-testid="pricing", heading centred with lead. Cards in a grid: 1 column, centred, max 460 px below lg; 3 columns from lg; gap gridGap.
  • Decorations: two decorative images (alt="", aria-hidden), absolutely positioned (top-left 8% / 2%, bottom-right 6% / 3%), clamp(90px, 10vw, 160px) wide, opacity 0.55, behind the content, not clickable; loaded deferred.
  • Reveal: heading and each card fade in, cards staggered by 0.08 s.

PriceCard

  • Props: { pkg: PricingPackage }
  • Markup: article with h3 (name), price paragraph, ul of features, book link. data-testid="price-card-<id>", link data-testid="price-card-<id>-book".
  • Style: white background, 1 px line border, centred text, padding clamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 3vw, 2.5rem); name in heading font 1.75 rem; price in heading font 2.25 rem, accent.deep (contrast, NFR-HP-01); features small text ink.soft between two hairlines, gap 0.75 rem; link aligned to the bottom (cards in a row get equal button positions).
  • Hover (whole card, decorative): lift 6 px, accent border, shadow-md; transition interaction; no lift under reduced motion.
  • Book link: the outline linkButton style; text per bookLabel (BR-BOOK-02) with VisuallyHidden for the hidden part; white-space: nowrap; horizontal padding 1.25 rem on phones, the design's 2.4 rem from sm (BR-BOOK-03). Target / with search={{ pakket: id }} and hash="contact".

Route (/)

  • validateSearch: { pakket?: string } — keeps a string, drops anything else (BR-PARAM-01, first half).
  • Passes homeContent.pricing and packages to Pricing. Resolving and applying the value, and removing it from the URL, follow in unit 5.

Accessibility (NFR-HP-01)

  • Region named by the h2 "Prijzen"; each card has an h3; features are a real list.
  • Every link has a unique accessible name containing the package name.
  • Decorations are hidden from assistive technology.
  • Focus ring from the theme on the link; touch target ≥ 44 px high.