|
1 | 1 | # Components |
2 | 2 |
|
3 | | -**Last Updated:** March 20, 2026 |
| 3 | +**Last Updated:** March 21, 2026 |
4 | 4 |
|
5 | 5 | Complete component specifications and guidelines for the Design System Starter Kit. |
6 | 6 |
|
@@ -505,6 +505,7 @@ Brengt consistente verticale ruimte aan tussen directe child-elementen via `flex |
505 | 505 | - Heading component tokens with full set per level (font-family, font-weight, color, font-size, line-height, margin-block-end) |
506 | 506 | - Token namespace `dsn.heading.level-{1-6}.*` — avoids collision with core `dsn.heading.*` tokens |
507 | 507 | - Font-size scale shifted one level down: heading-1 = 3xl, heading-2 = 2xl, ... heading-6 = sm |
| 508 | +- `text-wrap: balance` op de heading-basis-klasse — verdeelt regeleinden evenwichtig voor meerdere korte regels |
508 | 509 |
|
509 | 510 | **Tests:** React (13 tests), Web Component (24 tests) |
510 | 511 |
|
@@ -639,6 +640,123 @@ Brengt consistente verticale ruimte aan tussen directe child-elementen via `flex |
639 | 640 |
|
640 | 641 | **Tests:** React (20 tests) |
641 | 642 |
|
| 643 | +### Image Component |
| 644 | + |
| 645 | +**Status:** Complete (HTML/CSS, React) |
| 646 | + |
| 647 | +**Location:** `packages/components-{html|react}/src/image/` / `packages/components-react/src/Image/` |
| 648 | + |
| 649 | +**Component Tokens:** `tokens/components/image.json` |
| 650 | + |
| 651 | +**Features:** |
| 652 | + |
| 653 | +- Semantische `<figure>` + `<img>` structuur — altijd correct HTML |
| 654 | +- Verplichte `width` en `height` props — browser reserveert ruimte vooraf, voorkomt CLS |
| 655 | +- `loading="lazy"` + `decoding="async"` standaard — laadt afbeeldingen buiten de viewport pas wanneer nodig |
| 656 | +- `priority` prop — `loading="eager"` + `fetchpriority="high"` voor de primaire LCP-afbeelding (max. één per pagina) |
| 657 | +- `ratio` prop — CSS `aspect-ratio` met drie opties: `16:9`, `4:3`, `1:1` |
| 658 | +- `objectFit` prop — `cover` (default, bijsnijden) of `contain` (volledig zichtbaar) |
| 659 | +- `caption` prop — optioneel `<figcaption>` bijschrift |
| 660 | +- `srcSet` / `sizes` pass-through — voor responsive afbeeldingen |
| 661 | +- `alt=""` activeert automatisch `aria-hidden="true"` op de `<figure>` voor decoratieve afbeeldingen |
| 662 | + |
| 663 | +**CSS klassen:** |
| 664 | + |
| 665 | +| Klasse | Beschrijving | |
| 666 | +| ------------------------------- | ------------------------------------ | |
| 667 | +| `dsn-image` | Root `<figure>` container | |
| 668 | +| `dsn-image__img` | Native `<img>` element | |
| 669 | +| `dsn-image__caption` | `<figcaption>` bijschrift | |
| 670 | +| `dsn-image--ratio-16-9` | Beeldverhouding 16:9 | |
| 671 | +| `dsn-image--ratio-4-3` | Beeldverhouding 4:3 | |
| 672 | +| `dsn-image--ratio-1-1` | Beeldverhouding 1:1 (vierkant) | |
| 673 | +| `dsn-image--object-fit-contain` | Volledig zichtbaar zonder bijsnijden | |
| 674 | + |
| 675 | +**HTML/CSS:** |
| 676 | + |
| 677 | +```html |
| 678 | +<!-- Basis --> |
| 679 | +<figure class="dsn-image"> |
| 680 | + <img |
| 681 | + class="dsn-image__img" |
| 682 | + src="foto.jpg" |
| 683 | + alt="Beschrijving" |
| 684 | + width="800" |
| 685 | + height="600" |
| 686 | + loading="lazy" |
| 687 | + decoding="async" |
| 688 | + /> |
| 689 | +</figure> |
| 690 | + |
| 691 | +<!-- Met vaste beeldverhouding --> |
| 692 | +<figure class="dsn-image dsn-image--ratio-16-9"> |
| 693 | + <img |
| 694 | + class="dsn-image__img" |
| 695 | + src="hero.jpg" |
| 696 | + alt="Hero" |
| 697 | + width="1600" |
| 698 | + height="900" |
| 699 | + loading="lazy" |
| 700 | + decoding="async" |
| 701 | + /> |
| 702 | +</figure> |
| 703 | + |
| 704 | +<!-- LCP-afbeelding --> |
| 705 | +<figure class="dsn-image dsn-image--ratio-16-9"> |
| 706 | + <img |
| 707 | + class="dsn-image__img" |
| 708 | + src="hero.jpg" |
| 709 | + alt="Pagina hero" |
| 710 | + width="1600" |
| 711 | + height="900" |
| 712 | + loading="eager" |
| 713 | + fetchpriority="high" |
| 714 | + decoding="async" |
| 715 | + /> |
| 716 | +</figure> |
| 717 | + |
| 718 | +<!-- Met bijschrift --> |
| 719 | +<figure class="dsn-image"> |
| 720 | + <img |
| 721 | + class="dsn-image__img" |
| 722 | + src="foto.jpg" |
| 723 | + alt="Beschrijving" |
| 724 | + width="800" |
| 725 | + height="600" |
| 726 | + loading="lazy" |
| 727 | + decoding="async" |
| 728 | + /> |
| 729 | + <figcaption class="dsn-image__caption"> |
| 730 | + Bijschrift bij de afbeelding |
| 731 | + </figcaption> |
| 732 | +</figure> |
| 733 | + |
| 734 | +<!-- Decoratief --> |
| 735 | +<figure class="dsn-image" aria-hidden="true"> |
| 736 | + <img |
| 737 | + class="dsn-image__img" |
| 738 | + src="decoratief.jpg" |
| 739 | + alt="" |
| 740 | + width="800" |
| 741 | + height="600" |
| 742 | + loading="lazy" |
| 743 | + decoding="async" |
| 744 | + /> |
| 745 | +</figure> |
| 746 | +``` |
| 747 | + |
| 748 | +**React:** |
| 749 | + |
| 750 | +```tsx |
| 751 | +<Image src="foto.jpg" alt="Beschrijving" width={800} height={600} /> |
| 752 | +<Image src="hero.jpg" alt="Hero" width={1600} height={900} ratio="16:9" /> |
| 753 | +<Image src="hero.jpg" alt="Pagina hero" width={1600} height={900} ratio="16:9" priority /> |
| 754 | +<Image src="foto.jpg" alt="Beschrijving" width={800} height={600} caption="Bijschrift" /> |
| 755 | +<Image src="decoratief.jpg" alt="" width={800} height={600} /> |
| 756 | +``` |
| 757 | + |
| 758 | +**Tests:** React (27 tests) |
| 759 | + |
642 | 760 | --- |
643 | 761 |
|
644 | 762 | ## Display & Feedback Components |
|
0 commit comments