@deriv-com/dds-marketing 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.llm/components/awards.md +209 -0
- package/.llm/components/background.md +89 -40
- package/.llm/components/bottomsheet.md +5 -0
- package/.llm/components/comparisoncards.md +257 -0
- package/.llm/components/comparisontable.md +231 -0
- package/.llm/components/ctabanner.md +9 -12
- package/.llm/components/ctabannerslider.md +15 -2
- package/.llm/components/datatable.md +273 -0
- package/.llm/components/downloadbanner.md +283 -0
- package/.llm/components/featurecards.md +41 -3
- package/.llm/components/featurecardscarousel.md +311 -0
- package/.llm/components/featuresplit.md +5 -0
- package/.llm/components/featurestack.md +227 -0
- package/.llm/components/illustrationcard.md +2 -2
- package/.llm/components/illustrationscene.md +6 -10
- package/.llm/components/imagebanner.md +278 -0
- package/.llm/components/navbar.md +1 -1
- package/.llm/components/navbaritem.md +4 -0
- package/.llm/components/pageheader.md +4 -3
- package/.llm/components/paginationdots.md +6 -1
- package/.llm/components/producthero.md +35 -11
- package/.llm/components/resourcebanner.md +247 -0
- package/.llm/components/scenescroll.md +222 -0
- package/.llm/components/select.md +17 -0
- package/.llm/components/stats.md +219 -0
- package/.llm/components/steps.md +286 -0
- package/.llm/components/stickycards.md +251 -0
- package/.llm/components/tableheadercell.md +19 -0
- package/.llm/components/teamgrid.md +243 -0
- package/.llm/components/testimonialrow.md +5 -0
- package/.llm/components/testimonialslider.md +14 -1
- package/.llm/components/textarea.md +13 -0
- package/.llm/components/textinput.md +13 -0
- package/.llm/components/textscroll.md +187 -0
- package/.llm/components/tiers.md +227 -0
- package/.llm/digest/awards.md +45 -0
- package/.llm/digest/background.md +11 -10
- package/.llm/digest/bottomsheet.md +2 -0
- package/.llm/digest/comparisoncards.md +51 -0
- package/.llm/digest/comparisontable.md +53 -0
- package/.llm/digest/ctabanner.md +4 -4
- package/.llm/digest/ctabannerslider.md +4 -0
- package/.llm/digest/datatable.md +65 -0
- package/.llm/digest/downloadbanner.md +65 -0
- package/.llm/digest/featurecards.md +1 -1
- package/.llm/digest/featurecardscarousel.md +54 -0
- package/.llm/digest/featuresplit.md +1 -0
- package/.llm/digest/featurestack.md +48 -0
- package/.llm/digest/illustrationscene.md +2 -3
- package/.llm/digest/imagebanner.md +64 -0
- package/.llm/digest/navbaritem.md +1 -0
- package/.llm/digest/pageheader.md +2 -1
- package/.llm/digest/paginationdots.md +3 -1
- package/.llm/digest/producthero.md +4 -2
- package/.llm/digest/resourcebanner.md +53 -0
- package/.llm/digest/scenescroll.md +49 -0
- package/.llm/digest/select.md +5 -0
- package/.llm/digest/stats.md +46 -0
- package/.llm/digest/steps.md +55 -0
- package/.llm/digest/stickycards.md +52 -0
- package/.llm/digest/tableheadercell.md +4 -0
- package/.llm/digest/teamgrid.md +53 -0
- package/.llm/digest/testimonialrow.md +2 -0
- package/.llm/digest/testimonialslider.md +4 -0
- package/.llm/digest/textarea.md +4 -0
- package/.llm/digest/textinput.md +4 -0
- package/.llm/digest/textscroll.md +43 -0
- package/.llm/digest/tiers.md +50 -0
- package/.llm/index.md +19 -3
- package/.llm/tokens.md +26 -1
- package/AGENTS.md +17 -1
- package/dist/components/awards-data.d.ts +24 -0
- package/dist/components/awards-data.js +11 -0
- package/dist/components/block-image-data.d.ts +24 -0
- package/dist/components/block-image-data.js +9 -0
- package/dist/components/blocks/awards/Awards.css +134 -0
- package/dist/components/blocks/awards/Awards.d.ts +24 -0
- package/dist/components/blocks/awards/Awards.js +114 -0
- package/dist/components/blocks/awards/Awards.types.d.ts +31 -0
- package/dist/components/blocks/awards/Awards.types.js +16 -0
- package/dist/components/blocks/awards/awards-impl.css +222 -0
- package/dist/components/blocks/cards-of.d.ts +16 -0
- package/dist/components/blocks/cards-of.js +23 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.css +195 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.d.ts +24 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.js +75 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.types.d.ts +49 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.types.js +26 -0
- package/dist/components/blocks/comparison-cards/comparison-cards-impl.css +262 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.css +111 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.d.ts +25 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.js +100 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.types.d.ts +36 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.types.js +15 -0
- package/dist/components/blocks/comparison-table/comparison-table-impl.css +143 -0
- package/dist/components/blocks/cta-banner/CtaBanner.css +1 -0
- package/dist/components/blocks/cta-banner/CtaBanner.js +2 -2
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +4 -3
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +1 -1
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.css +1 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +1 -1
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +6 -2
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +8 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +1 -1
- package/dist/components/blocks/data-table/DataTable.css +170 -0
- package/dist/components/blocks/data-table/DataTable.d.ts +29 -0
- package/dist/components/blocks/data-table/DataTable.js +84 -0
- package/dist/components/blocks/data-table/DataTable.types.d.ts +69 -0
- package/dist/components/blocks/data-table/DataTable.types.js +19 -0
- package/dist/components/blocks/data-table/data-table-impl.css +155 -0
- package/dist/components/blocks/download-banner/DownloadBanner.css +228 -0
- package/dist/components/blocks/download-banner/DownloadBanner.d.ts +28 -0
- package/dist/components/blocks/download-banner/DownloadBanner.js +75 -0
- package/dist/components/blocks/download-banner/DownloadBanner.types.d.ts +56 -0
- package/dist/components/blocks/download-banner/DownloadBanner.types.js +23 -0
- package/dist/components/blocks/download-banner/download-banner-impl.css +216 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.css +1 -0
- package/dist/components/blocks/faq-accordion/faq-accordion-impl.css +3 -7
- package/dist/components/blocks/feature-bullets/FeatureBullets.css +1 -0
- package/dist/components/blocks/feature-bullets/feature-bullets-impl.css +14 -1
- package/dist/components/blocks/feature-cards/FeatureCards.css +1 -0
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +2 -1
- package/dist/components/blocks/feature-cards/FeatureCards.js +4 -21
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +10 -9
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.css +115 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.d.ts +30 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.js +160 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.d.ts +52 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.js +17 -0
- package/dist/components/blocks/feature-cards-carousel/feature-cards-carousel-impl.css +207 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.css +1 -0
- package/dist/components/blocks/feature-split/FeatureSplit.css +1 -0
- package/dist/components/blocks/feature-split/feature-split-impl.css +14 -1
- package/dist/components/blocks/feature-stack/FeatureStack.css +86 -0
- package/dist/components/blocks/feature-stack/FeatureStack.d.ts +19 -0
- package/dist/components/blocks/feature-stack/FeatureStack.js +27 -0
- package/dist/components/blocks/feature-stack/FeatureStack.types.d.ts +34 -0
- package/dist/components/blocks/feature-stack/FeatureStack.types.js +14 -0
- package/dist/components/blocks/feature-stack/feature-stack-impl.css +87 -0
- package/dist/components/blocks/image-banner/ImageBanner.css +133 -0
- package/dist/components/blocks/image-banner/ImageBanner.d.ts +32 -0
- package/dist/components/blocks/image-banner/ImageBanner.js +41 -0
- package/dist/components/blocks/image-banner/ImageBanner.types.d.ts +54 -0
- package/dist/components/blocks/image-banner/ImageBanner.types.js +14 -0
- package/dist/components/blocks/image-banner/image-banner-impl.css +281 -0
- package/dist/components/blocks/landing-hero/LandingHero.css +1 -0
- package/dist/components/blocks/logo-columns/LogoColumns.css +1 -0
- package/dist/components/blocks/logo-rows/LogoRows.css +1 -0
- package/dist/components/blocks/page-header/PageHeader.css +1 -0
- package/dist/components/blocks/page-header/PageHeader.js +2 -2
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +4 -2
- package/dist/components/blocks/page-header/PageHeader.types.js +1 -1
- package/dist/components/blocks/page-header/page-header-impl.css +5 -3
- package/dist/components/blocks/product-hero/ProductHero.css +8 -3
- package/dist/components/blocks/product-hero/ProductHero.d.ts +1 -1
- package/dist/components/blocks/product-hero/ProductHero.js +5 -2
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +5 -1
- package/dist/components/blocks/product-hero/ProductHero.types.js +1 -0
- package/dist/components/blocks/product-hero/product-hero-impl.css +43 -12
- package/dist/components/blocks/resource-banner/ResourceBanner.css +106 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.d.ts +32 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.js +51 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.types.d.ts +44 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.types.js +14 -0
- package/dist/components/blocks/resource-banner/resource-banner-impl.css +69 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.css +93 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.d.ts +36 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.js +54 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.types.d.ts +32 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.types.js +15 -0
- package/dist/components/blocks/scene-scroll/scene-scroll-impl.css +275 -0
- package/dist/components/blocks/stats/Stats.css +139 -0
- package/dist/components/blocks/stats/Stats.d.ts +24 -0
- package/dist/components/blocks/stats/Stats.js +120 -0
- package/dist/components/blocks/stats/Stats.types.d.ts +36 -0
- package/dist/components/blocks/stats/Stats.types.js +19 -0
- package/dist/components/blocks/stats/stats-count.d.ts +34 -0
- package/dist/components/blocks/stats/stats-count.js +61 -0
- package/dist/components/blocks/stats/stats-impl.css +284 -0
- package/dist/components/blocks/stats/use-wheel.d.ts +37 -0
- package/dist/components/blocks/stats/use-wheel.js +126 -0
- package/dist/components/blocks/steps/Steps.css +202 -0
- package/dist/components/blocks/steps/Steps.d.ts +32 -0
- package/dist/components/blocks/steps/Steps.js +65 -0
- package/dist/components/blocks/steps/Steps.types.d.ts +48 -0
- package/dist/components/blocks/steps/Steps.types.js +21 -0
- package/dist/components/blocks/steps/steps-impl.css +216 -0
- package/dist/components/blocks/steps/use-turn.d.ts +33 -0
- package/dist/components/blocks/steps/use-turn.js +75 -0
- package/dist/components/blocks/sticky-cards/StickyCards.css +154 -0
- package/dist/components/blocks/sticky-cards/StickyCards.d.ts +35 -0
- package/dist/components/blocks/sticky-cards/StickyCards.js +153 -0
- package/dist/components/blocks/sticky-cards/StickyCards.types.d.ts +43 -0
- package/dist/components/blocks/sticky-cards/StickyCards.types.js +18 -0
- package/dist/components/blocks/sticky-cards/sticky-cards-impl.css +393 -0
- package/dist/components/blocks/team-grid/TeamGrid.css +159 -0
- package/dist/components/blocks/team-grid/TeamGrid.d.ts +28 -0
- package/dist/components/blocks/team-grid/TeamGrid.js +74 -0
- package/dist/components/blocks/team-grid/TeamGrid.types.d.ts +51 -0
- package/dist/components/blocks/team-grid/TeamGrid.types.js +20 -0
- package/dist/components/blocks/team-grid/team-grid-impl.css +129 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +1 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +1 -1
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +4 -3
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +3 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.js +1 -1
- package/dist/components/blocks/testimonial-row/testimonial-row-impl.css +8 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +1 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.d.ts +1 -1
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.js +2 -2
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +8 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.js +1 -1
- package/dist/components/blocks/text-scroll/TextScroll.css +53 -0
- package/dist/components/blocks/text-scroll/TextScroll.d.ts +5 -0
- package/dist/components/blocks/text-scroll/TextScroll.js +71 -0
- package/dist/components/blocks/text-scroll/TextScroll.types.d.ts +22 -0
- package/dist/components/blocks/text-scroll/TextScroll.types.js +10 -0
- package/dist/components/blocks/text-scroll/text-scroll-impl.css +115 -0
- package/dist/components/blocks/tiers/Tiers.css +233 -0
- package/dist/components/blocks/tiers/Tiers.d.ts +32 -0
- package/dist/components/blocks/tiers/Tiers.js +68 -0
- package/dist/components/blocks/tiers/Tiers.types.d.ts +45 -0
- package/dist/components/blocks/tiers/Tiers.types.js +25 -0
- package/dist/components/blocks/tiers/tiers-impl.css +185 -0
- package/dist/components/blocks/use-rotation.d.ts +12 -2
- package/dist/components/blocks/use-rotation.js +6 -28
- package/dist/components/comparison-cards-data.d.ts +59 -0
- package/dist/components/comparison-cards-data.js +12 -0
- package/dist/components/comparison-table-data.d.ts +39 -0
- package/dist/components/comparison-table-data.js +11 -0
- package/dist/components/core/accordion-item/AccordionItem.css +1 -5
- package/dist/components/core/background/Background.css +23 -0
- package/dist/components/core/background/Background.d.ts +10 -4
- package/dist/components/core/background/Background.js +16 -7
- package/dist/components/core/background/Background.types.d.ts +11 -8
- package/dist/components/core/background/Background.types.js +3 -1
- package/dist/components/core/background/background-impl.css +334 -1
- package/dist/components/core/background/halftone.d.ts +11 -0
- package/dist/components/core/background/halftone.js +43 -3
- package/dist/components/core/background/patterns.d.ts +66 -0
- package/dist/components/core/background/patterns.js +244 -0
- package/dist/components/core/background/shader.d.ts +44 -0
- package/dist/components/core/background/shader.js +307 -0
- package/dist/components/core/background/use-shader.d.ts +11 -0
- package/dist/components/core/background/use-shader.js +25 -0
- package/dist/components/core/background/use-spotlight.d.ts +2 -1
- package/dist/components/core/background/use-spotlight.js +9 -1
- package/dist/components/core/bottom-sheet/BottomSheet.js +2 -2
- package/dist/components/core/bottom-sheet/BottomSheet.types.d.ts +3 -1
- package/dist/components/core/breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/components/core/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/core/breadcrumb/breadcrumb-impl.css +11 -0
- package/dist/components/core/button/button-impl.css +14 -1
- package/dist/components/core/illustration-card/IllustrationCard.js +1 -1
- package/dist/components/core/illustration-card/illustration-card-impl.css +20 -0
- package/dist/components/core/illustration-scene/IllustrationScene.css +4 -7
- package/dist/components/core/illustration-scene/IllustrationScene.types.d.ts +2 -3
- package/dist/components/core/illustration-scene/illustration-scene-impl.css +22 -1
- package/dist/components/core/link/Link.js +7 -3
- package/dist/components/core/link/link-impl.css +29 -2
- package/dist/components/core/navbar/Navbar.css +2 -2
- package/dist/components/core/navbar/Navbar.types.d.ts +1 -1
- package/dist/components/core/navbar-item/NavbarItem.d.ts +2 -1
- package/dist/components/core/navbar-item/NavbarItem.js +3 -10
- package/dist/components/core/navbar-item/NavbarItem.types.d.ts +4 -1
- package/dist/components/core/navbar-item/NavbarItem.types.js +1 -1
- package/dist/components/core/navbar-item/navbar-item-impl.css +10 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +9 -0
- package/dist/components/core/navbar-switcher/navbar-switcher-impl.css +19 -0
- package/dist/components/core/pagination/Pagination.js +1 -1
- package/dist/components/core/pagination/pagination-impl.css +9 -0
- package/dist/components/core/pagination-dots/PaginationDots.d.ts +1 -1
- package/dist/components/core/pagination-dots/PaginationDots.js +3 -3
- package/dist/components/core/pagination-dots/PaginationDots.types.d.ts +3 -1
- package/dist/components/core/segmented-control/SegmentedControl.css +4 -3
- package/dist/components/core/segmented-control/SegmentedControl.js +17 -3
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +2 -1
- package/dist/components/core/select/Select.js +3 -3
- package/dist/components/core/select/Select.types.d.ts +11 -1
- package/dist/components/core/select/Select.types.js +1 -1
- package/dist/components/core/tab-list/TabList.js +9 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.d.ts +1 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.js +5 -2
- package/dist/components/core/table-header-cell/TableHeaderCell.types.d.ts +7 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.types.js +1 -1
- package/dist/components/core/text-area/TextArea.d.ts +1 -1
- package/dist/components/core/text-area/TextArea.js +2 -2
- package/dist/components/core/text-area/TextArea.types.d.ts +9 -1
- package/dist/components/core/text-area/TextArea.types.js +1 -1
- package/dist/components/core/text-input/TextInput.d.ts +1 -1
- package/dist/components/core/text-input/TextInput.js +2 -2
- package/dist/components/core/text-input/TextInput.types.d.ts +9 -1
- package/dist/components/core/text-input/TextInput.types.js +1 -1
- package/dist/components/data-table-data.d.ts +33 -0
- package/dist/components/data-table-data.js +12 -0
- package/dist/components/download-banner-data.d.ts +52 -0
- package/dist/components/download-banner-data.js +11 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.js +32 -0
- package/dist/components/resource-banner-data.d.ts +34 -0
- package/dist/components/resource-banner-data.js +13 -0
- package/dist/components/scene-scroll-data.d.ts +24 -0
- package/dist/components/scene-scroll-data.js +9 -0
- package/dist/components/stats-data.d.ts +28 -0
- package/dist/components/stats-data.js +11 -0
- package/dist/components/steps-data.d.ts +38 -0
- package/dist/components/steps-data.js +13 -0
- package/dist/components/sticky-cards-data.d.ts +43 -0
- package/dist/components/sticky-cards-data.js +12 -0
- package/dist/components/team-grid-data.d.ts +38 -0
- package/dist/components/team-grid-data.js +11 -0
- package/dist/components/tiers-data.d.ts +47 -0
- package/dist/components/tiers-data.js +13 -0
- package/dist/marketing.css +77 -28
- package/package.json +1 -1
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
<!-- GENERATED from feature-cards-carousel.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# FeatureCardsCarousel
|
|
4
|
+
|
|
5
|
+
A feature band that sets its cards in a row a reader moves along rather than a grid: a heading and a line over a row of the page's own cards, the next one's edge showing past the last in view, with dots saying where the reader is and two arrows stepping it a card at a time. One card is the focus at a time and the rest wait at the edge, so each gets a screen's attention without the page paying a screen of scrolling for it.
|
|
6
|
+
|
|
7
|
+
The reference design's FeatureCardsCarousel. Each card is the page's own Card or CardButton with a CardBody inside, as in FeatureCards — its fill, its picture, its words and where it leads are the card's; this decides the heading, the row and the way along it, and nothing about a card.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- A "what you get" band of five or six authored cards, each a benefit with a line and a picture, too many for one row of a grid, where one card in focus with a peek of the next is the point. Three or four cards are FeatureCards, which shows the whole set at once
|
|
12
|
+
- A platform or product page whose feature cards are too many for one row of a grid and too equal to be a sequence
|
|
13
|
+
|
|
14
|
+
## Do not use
|
|
15
|
+
|
|
16
|
+
- Three or four cards — the set a grid shows in one row → `FeatureCards`
|
|
17
|
+
- The cards are read in order, one leading to the next → `FeatureScroll`
|
|
18
|
+
- Two or three promotions on the brand's coral, one at a time → `CtaBannerSlider`
|
|
19
|
+
- Live prices, market data or anything on a feed. A card is authored copy that holds still while a reader reads it
|
|
20
|
+
- A static set flattened into a carousel to save height. Fewer than three cards is a FeatureCards grid; a carousel of two is a grid with a hidden half
|
|
21
|
+
- Reviews or quotes. A rated review is TestimonialRow's and a chosen quote TestimonialSlider's, each with the attribution this does not draw
|
|
22
|
+
|
|
23
|
+
## Anatomy
|
|
24
|
+
|
|
25
|
+
FeatureCardsCarousel renders 11 elements. A token binding names the part it applies to.
|
|
26
|
+
|
|
27
|
+
- `root` — `<section>`, class `dds-featurecardscarousel`. The section. It paints the ground and the ink to go with it — see `ground` — and asks its own width, which the row's breakout and a card's width are measured against. A region named by its heading.
|
|
28
|
+
- `inner` — `<div>`, class `dds-featurecardscarousel__inner`. The measure and the gutter, the same column every band holds its content in, and the step from the heading to the row: space.heading.content.
|
|
29
|
+
- `header` — `<div>`, class `dds-featurecardscarousel__header`. The heading, the line under it and the way on. Ranged to the start on a phone and centred from the fold, PageHeader's rule and its reason. It sets no gap: each part's own margin is the step, so a header without a line closes up rather than leaving its gap behind.
|
|
30
|
+
- `title` — `<h2>`, class `dds-featurecardscarousel__title`. What the cards are. `h2` because a section sits under the page's own heading; the cards' titles come below it in the outline.
|
|
31
|
+
- `description` — `<p>`, class `dds-featurecardscarousel__description`. The line under the heading, at the description measure. Rendered only when `description` is set.
|
|
32
|
+
- `carousel` — `<div>`, class `dds-featurecardscarousel__carousel`. The row and the footer under it, held together at space.gap.xl — closer than the section's own step from the heading, so the controls read as belonging to the row.
|
|
33
|
+
- `track` — `<div>`, class `dds-featurecardscarousel__track`. The row: the cards side by side at space.grid.gutter, scrolling across with a stop at each card. It runs out to the band's edges while its first card lines up with the heading — a gutter on the row itself that scrolls away with it, so a card is cut off by the band rather than by the column. A named group with a tab stop of its own, Scroller's rule, so a keyboard can reach the cards a pointer scrolls to. No scrollbar: the dots and arrows under it are the standing sign that it moves.
|
|
34
|
+
- `item` — `<div>`, class `dds-featurecardscarousel__item`. One place in the row, holding one card. Most of the column on a phone — 85% — so the next card's edge shows past it; size.feature-cards-carousel.card from the fold, held to the column, so the row shows the next card's edge at full width. A grid of its own so the card stretches to it and every card is as tall as the tallest. On a painted ground it is also where a card is re-coloured for it, as in FeatureCards — see `ground`.
|
|
35
|
+
- `footer` — `<div>`, class `dds-featurecardscarousel__footer`. The way along the row, back in the column under it: the dots at the start and the arrows at the end, the reference design's arrangement at every width. Drawn only for two cards or more, and hidden while the row holds every card and has nowhere to go.
|
|
36
|
+
- `nav` — `<div>`, class `dds-featurecardscarousel__nav`. Two ButtonIcons in their secondary variant, stepping the row back and on by one stop. On the dark band they take the inverse tone, which keeps the tint and turns it white. Set at the end of the footer, after the dots.
|
|
37
|
+
- `nav-slot` — `<span>`, class `dds-featurecardscarousel__nav-slot`. Where one arrow stands. At either end of the row the arrow that has nowhere to go stays in its slot, receded to opacity.disabled and inert — so both directions show from the first render, the pair keeps its width and does not shift as the reader scrolls, and a keyboard never lands on a control that does nothing. ButtonIcon has no disabled state, by its own ruling, which is why this is its slot's job.
|
|
38
|
+
|
|
39
|
+
Apply these classes from the generated `featureCardsCarouselParts` constant rather than writing the strings by hand.
|
|
40
|
+
|
|
41
|
+
## Composition
|
|
42
|
+
|
|
43
|
+
- Can contain: `Card`, `CardButton`
|
|
44
|
+
- Never contains: `FeatureCards`, `FeatureCardsCarousel`, `LandingHero`, `ProductHero`, `PageHeader`, `Footer`, `Navbar` — in children or in any prop that takes a node
|
|
45
|
+
- Holds at least 1 and at most 8
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
### ground — `page` | `subtle` | `strong` (default `page`)
|
|
50
|
+
|
|
51
|
+
- `page` — The default, and the page's own white. A section that has nothing to separate itself from what is above it — most of them — and the ground a reader is already on
|
|
52
|
+
- `subtle` — A quiet step off the page, for a band that wants to read as its own section without changing the page's voice. The one to reach for first when two sections need telling apart. A light card — surface-light — turns white on it, color.bg.surface-card-light-raised, because its own gray.50 is the band's and would vanish into it. A dark card — accent-strong — is lifted to color.bg.surface-card-strong-raised, a step lighter in dark mode, where the band is within a shade of its gray.900. A plain surface card is raised off it the same way, to color.bg.surface-card-raised, because the recessed fill is the band's gray too. Painted as the band's tint laid over the page's own ground, so it is the same grey whatever is behind the section — in dark mode the tint alone took on whatever it was set against, and on a light surface it was light ink on white.
|
|
53
|
+
- `strong` — `color.bg.brand-strong`, the dark band. It stops the page rather than dividing it, so it is for a section a reader should arrive at — and one per page is usually one more than enough. The coloured cards keep their own grounds on it; a neutral card — surface or surface-raised — turns to Card's inverse fill and white ink, and a plain card takes the white ink alone, because their own would be dark ink on near-black; an eyebrow inside any of them takes the band's quieter ink
|
|
54
|
+
|
|
55
|
+
Use when: Which of the page's three grounds this section paints. A marketing page is white, and a band that wants to be seen as a band takes one of the other two — so this is how a page builds its rhythm: white, white, grey, white, dark. Two in a row is a deliberate pair rather than an accident, and the section above knows nothing about the one below it, so the page is the only thing that can decide.
|
|
56
|
+
|
|
57
|
+
The ink follows the ground and is not a second decision: a dark band carries white type because this sets both halves in one value, which is what the painted-ground-carries-its-ink rule exists to stop a page getting wrong.
|
|
58
|
+
Never for: Marking importance. Every section on a page painted dark is a page with no emphasis left, and a reader stops reading the grounds as meaning anything. Alternating for its own sake is the same mistake more slowly.
|
|
59
|
+
|
|
60
|
+
And never the brand's own coral, `color.bg.brand`, which is not offered here. That ground belongs to the band that asks a reader to do something — the one place on a page where the brand colour is the point rather than decoration — and a feature section wearing it is a page with two calls to action, one of which does nothing. It is `color.bg.brand-strong` that this offers: the dark brand ground, which is a band breaking a page rather than a band asking for something.
|
|
61
|
+
|
|
62
|
+
### title — `string` **Required.**
|
|
63
|
+
|
|
64
|
+
Use when: Always. What the cards are, in the fewest words that name them — "What you get", "Built for every trader".
|
|
65
|
+
Never for: A sentence. The line under it is for the sentence.
|
|
66
|
+
|
|
67
|
+
### description — `string`
|
|
68
|
+
|
|
69
|
+
Use when: A line saying what the set has in common, when the title alone does not.
|
|
70
|
+
Never for: A paragraph, or a summary of every card. The cards say what they are; this only says why they are together.
|
|
71
|
+
|
|
72
|
+
### autoplay — `boolean` (default `false`)
|
|
73
|
+
|
|
74
|
+
Use when: Whether the row moves on to the next stop on its own, holding each for motion.duration.dwell and returning to the start after the last. Off by default, so a row nobody configured stays still. On, it holds while the pointer is over the band or focus is inside it, never moves for a reader who asked for less motion, and stops for good once the reader presses anything in it — a card, an arrow, a dot — or swipes the row: the WAI carousel pattern's rule that a reader who has touched it is reading, not watching. That gives a reader a way to stop it, which WCAG 2.2.2 asks for, but not a visible one, as in CtaBannerSlider: a page that needs 2.2.2 met plainly should leave it off.
|
|
75
|
+
Never for: A row whose cards carry more than a reader takes in during motion.duration.dwell. Several cards are in view at once, so a moving row is moving cards out from under a reader who may be reading the second one.
|
|
76
|
+
|
|
77
|
+
### label — `string` (default `Features`)
|
|
78
|
+
|
|
79
|
+
Use when: The name the row is announced by. The row is a scrolling region a keyboard has to be able to reach, so it carries a tab stop and a name of its own — Scroller's rule, as in TestimonialRow. Its own name rather than the section's, so a screen reader moving into it hears what it is. Translate it with the page.
|
|
80
|
+
|
|
81
|
+
### previousLabel — `string` (default `Previous cards`)
|
|
82
|
+
|
|
83
|
+
Use when: The accessible name of the arrow stepping the row back. A glyph announces nothing, so this is the whole of the control's name. Translate it with the page, and keep it parallel to nextLabel.
|
|
84
|
+
|
|
85
|
+
### nextLabel — `string` (default `Next cards`)
|
|
86
|
+
|
|
87
|
+
Use when: The accessible name of the arrow stepping the row on, for the reason previousLabel exists.
|
|
88
|
+
|
|
89
|
+
### controlsLabel — `string` (default `Positions`)
|
|
90
|
+
|
|
91
|
+
Use when: The name the dots are announced by, as a group inside the band. Its own name rather than the row's, so a screen reader moving into the dots hears what they are. Translate it with the page, like label.
|
|
92
|
+
|
|
93
|
+
### stopLabel — `string` (default `Position`)
|
|
94
|
+
|
|
95
|
+
Use when: The word each dot is announced by, before its number — "Position 2". A dot is a place the row stops, not a card: at full width the last few cards share the last stop, so there are fewer dots than cards. Translate it with the page, as controlsLabel is.
|
|
96
|
+
|
|
97
|
+
## Accessibility
|
|
98
|
+
|
|
99
|
+
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
100
|
+
|
|
101
|
+
- Announced as: `region`
|
|
102
|
+
- `Tab` — Moves to the row, then through the cards a reader can press, then to the dots and the arrows that have somewhere to go.
|
|
103
|
+
- `Enter` — On a card that links, follows it. On a dot, moves the row to that stop; on an arrow, steps it by one.
|
|
104
|
+
- `ArrowLeft` — On the focused row: scrolls it the way the key points — the browser's own scrolling, made reachable by the row's tab stop.
|
|
105
|
+
- `ArrowRight` — On the focused row: scrolls it the way the key points, the mirror of ArrowLeft.
|
|
106
|
+
- accessible name from title, so the section is a named region a reader can jump to and skip
|
|
107
|
+
- The row is a named group with a tab stop of its own, so a keyboard can reach and scroll it whether or not any card links.
|
|
108
|
+
- The cards' order in the markup is their order along the row, so a reader tabbing through meets them as a sighted reader scrolls to them.
|
|
109
|
+
- An arrow with nowhere to go is drawn receded and inert rather than left a control that does nothing.
|
|
110
|
+
- Under autoplay, a hold while the pointer is over the band or focus is inside it, no movement for a reader who asked for less motion, and a stop for good once the reader presses anything in it or swipes the row.
|
|
111
|
+
|
|
112
|
+
## Rules
|
|
113
|
+
|
|
114
|
+
- **On a phone a section's actions stack and each fills the width, including when there is only one** — On a phone a page's actions stack, and each one fills the width. Not most of it, and not the width its label happens to need — the whole column.
|
|
115
|
+
|
|
116
|
+
Two side by side is what this replaces. On the narrowest screen each gets half a column minus the gap, which is rarely enough for a real label: the words wrap inside the pills, the two buttons come out different heights, and the pair reads as a broken row rather than as a choice. Stacked, each has the whole width and neither has to shorten its words to fit.
|
|
117
|
+
|
|
118
|
+
A single action fills too, and that is the part worth saying, because it is the one that looks unnecessary. A lone button has the room to sit at its natural width and still should not: a full-width control is the phone's convention for the thing the screen is asking you to do, and a pill hugging its label reads as one option among others that are not there. It also makes the target predictable — the whole width, wherever the thumb lands — which a centred pill does not.
|
|
119
|
+
|
|
120
|
+
Filling is the row's job rather than the button's. A button has no width of its own and is not given one; the row it sits in becomes a column and stretches its children, so nothing about the control changes and the same button is full width here and its own size on a desktop.
|
|
121
|
+
|
|
122
|
+
This is the phone's breakpoint, size.breakpoint.md, and not the wider one that decides whether a heading is centred. Those are different questions and they break at different widths: a heading stops being centred when the measure is the screen, while a button stops being full width much sooner than that — stretched across a tablet it is a long way from its own label, and a label centred in a metre of pill is harder to hit than one in a pill the size of the words.
|
|
123
|
+
|
|
124
|
+
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
125
|
+
Guidance only — cannot be checked automatically.
|
|
126
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
127
|
+
Guidance only — cannot be checked automatically.
|
|
128
|
+
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
129
|
+
|
|
130
|
+
color.bg.brand carries a second limit that is not about forgetting. Its ink measures 3.39:1, which clears the 3:1 a heading needs and misses the 4.5:1 running copy needs. A coral band may carry a headline and a call to action; a paragraph on one is text the reader has to work through at a ratio the waiver on that role does not cover — the waiver says so itself. A section with copy in it takes color.bg.brand-strong, which is near-black and carries white at full contrast.
|
|
131
|
+
|
|
132
|
+
color.bg.strong is not a section ground. It is the inverted fill for an action that has to outrank what surrounds it, and the components that paint it — Button and ButtonIcon in their inverse form — already set both halves in one rule, which is the pattern a hand-painted section has to copy.
|
|
133
|
+
Guidance only — cannot be checked automatically.
|
|
134
|
+
- **Every gap inside a section names the relationship it expresses, and the same relationship keeps its measure when it turns on its side** — A section's spacing is named by the relationship it expresses, not chosen by size. Every gap in a section has a role token, and reaching for a step off the generic scale because it happens to be the right number is how two sections written by two people stop lining up: the numbers agree today and drift the first time one of them is tuned.
|
|
135
|
+
|
|
136
|
+
The heading group is three steps, not one gap. An eyebrow sits nearer its title than the title sits to its description, and the actions sit further from the description than either — space.heading.eyebrow-title, space.heading.title-description, space.heading.description-actions, in that order. A single `gap` on the group cannot say this; it sets all three the same and the block reads as evenly spaced lines rather than as a mark, a name and a paragraph. The eyebrow has to identify itself for this to work, because a group that opens with a title must not give its description the eyebrow's tighter step.
|
|
137
|
+
|
|
138
|
+
The step between a title and its description follows the size of the title, which is why there are two of it. What a reader sees is not the gap but the gap plus the leading above it, and leading scales with the type: under a display title the leading is most of the space, under a card's title it is half as deep. One value for both makes a card look loose at the size that made a section look right. So space.heading.title-description is the display step and space.heading.title-description-compact is the step at a card's size, and the choice is made by how big the title is rather than by what kind of block it sits in.
|
|
139
|
+
|
|
140
|
+
Every one of those steps is smaller than the gap below the group, and that ordering is what holds the group together as one thing. space.heading.content is the step between a heading group and the content it introduces, and it is the widest measure inside a section: the one gap the eye reads as a change of subject rather than as a continuation.
|
|
141
|
+
|
|
142
|
+
That step is the same whether the content is under the heading or beside it. A split is the same relationship turned on its side — a heading group and the content it introduces — so the space between the two halves is space.heading.content, not a gutter. When the split collapses to one column on a phone the gap becomes vertical again, which is where it started, and nothing has to change for that to be right.
|
|
143
|
+
|
|
144
|
+
space.grid.gutter is between two things of the same kind. Two cards in a row are the same kind; the two halves of a split are not, which is why the gutter is the wrong measure there even when the number would have looked acceptable. The gutter runs on both axes, so a grid reads as an even field rather than as rows with a seam down them.
|
|
145
|
+
|
|
146
|
+
space.inset.card is the card's, not the page's. A row of cards padded differently is a row of different cards, and the fill is the only edge they have. A page composing a row does not get to choose it.
|
|
147
|
+
|
|
148
|
+
Column count is not a breakpoint decision. A row holds as many columns as fit before a column would be narrower than size.grid.column-min, and drops one when they would not. Written as a fixed count that collapses at a breakpoint, a four-up row keeps four columns at every width above the phone and sets its copy two or three words to a line through the whole of the tablet range — and on a narrow desktop, which no breakpoint sits on at all. The threshold is a property of the row rather than of a card: a card fills whatever cell it is given.
|
|
149
|
+
|
|
150
|
+
What this does not cover is the space above and below a section, which is space.section.default and space.section.compact, and the page's own side margin, which is space.inset.page. Those are the section's outside; everything here is its inside.
|
|
151
|
+
Guidance only — cannot be checked automatically.
|
|
152
|
+
- **A section's title is centred over stacked content, starts beside content in columns, and starts on a phone** — Two arrangements, and the title's alignment is decided by which one it is introducing rather than chosen per section.
|
|
153
|
+
|
|
154
|
+
Content stacked under the title — a row of cards, an accordion, a set of steps — takes a centred title. The heading group and the block below it share one axis, so a centred title is symmetric with the thing it names, and the eye drops from the middle of the words to the middle of the set. A title starting at the left over a centred or full-width block reads as belonging to the first column rather than to all of them.
|
|
155
|
+
|
|
156
|
+
Content beside the title — a split, a picture in the other half, anything laid out in columns — takes a title that starts where its content starts. The two share a left edge, and that edge is what says they are one thing read across rather than two stacked. Centring the title there breaks the only alignment the reader has to hold the halves together, and it drifts further from its content the wider the page gets.
|
|
157
|
+
|
|
158
|
+
The heading group is what carries this, not the heading alone. An eyebrow, a title and a description are read as one block and align together; aligning the title without them leaves a centred heading over start-aligned copy, which reads as a mistake rather than as a choice.
|
|
159
|
+
|
|
160
|
+
Centred means all of it, not just the words. A badge, a row of actions, a picture — these are flex children, and a flex child is placed by align-items rather than by text-align, so a block that only sets the text leaves everything that is not text at the start. A hero is the case that shows it: its title and copy centred while its badge and its buttons did not.
|
|
161
|
+
|
|
162
|
+
A capped block centres itself as well as its words. A heading group takes size.heading-group.max, and a cap that is not centred leaves the measure at the start of the column with the words centred inside it — composed, and a long way left of the middle it appears to be in.
|
|
163
|
+
|
|
164
|
+
Both arrangements go to the start on a phone. A centred block reverts below the breakpoint, and the reason is the measure: on a phone the measure is the screen, so a centred title wraps to three or four ragged lines and the eye loses the left edge it was tracking — the same symmetry that reads as composure on a desktop is what makes it hard to scan on a phone. Centring there has to be asked for twice, and a section title is not one of the things that asks: it is centred because there is room for it, and on a phone there is not. Going back to the start means all of it too, and a capped block is the one that hides a leftover: its words go to the start while its measure stays in the middle of the column, which reads as a title still centred over a badge and buttons that are not — the box in the middle and the line inside it at the edge.
|
|
165
|
+
|
|
166
|
+
A hero is a section like any other: its badge, title, copy and actions are one stacked block, so it is centred on a desktop and starts on a phone with everything else.
|
|
167
|
+
|
|
168
|
+
What this is not about is a page whose body is a form or a document. A title over a sign-up form or a guide is not introducing a set of content — it is the first line of the thing itself, and it keeps the alignment the body has, which for running text is the start. The distinction is whether the block below is content the title names or content the title is part of.
|
|
169
|
+
Guidance only — cannot be checked automatically.
|
|
170
|
+
- **Anything a pointer has to hit is at least 24px in both directions** — A control sized by its contents is as big as its contents, and a glyph is chosen for how it reads rather than for how easily it is hit. An icon-only button with no padding is a 16px target — smaller than the pad of a finger, and smaller than the tremor of a hand using a mouse.
|
|
171
|
+
|
|
172
|
+
WCAG 2.2 asks for 24 by 24 CSS pixels at AA. The exceptions are narrower than they look: inline targets inside a sentence are exempt, and so is a small target with 24px of clear space around it — but a clear button sits against the field it empties, and a field is itself a target, so the spacing exemption does not apply to the case that keeps arising.
|
|
173
|
+
|
|
174
|
+
The target and the mark are separate decisions, and conflating them is what produces both faults. Growing the glyph to 24px makes it shout; leaving the button at 16px makes it hard to hit. So the glyph keeps the size that reads correctly beside its text, and the box around it declares a minimum of its own — which is what size.target.min is for.
|
|
175
|
+
|
|
176
|
+
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
177
|
+
Guidance only — cannot be checked automatically.
|
|
178
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
179
|
+
|
|
180
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
181
|
+
|
|
182
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
183
|
+
|
|
184
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
185
|
+
Guidance only — cannot be checked automatically.
|
|
186
|
+
|
|
187
|
+
## Anti-examples
|
|
188
|
+
|
|
189
|
+
❌ FeatureCardsCarousel for: Three or four cards — the set a grid shows in one row
|
|
190
|
+
A grid shows the whole set at once; a row hides most of it behind a swipe, which is a cost a set that small does not need to pay
|
|
191
|
+
→ use `FeatureCards` instead.
|
|
192
|
+
|
|
193
|
+
❌ FeatureCardsCarousel for: The cards are read in order, one leading to the next
|
|
194
|
+
A sequence wants a screen per stop with its picture pinned beside it; a row lets the reader jump in anywhere
|
|
195
|
+
→ use `FeatureScroll` instead.
|
|
196
|
+
|
|
197
|
+
❌ FeatureCardsCarousel for: Two or three promotions on the brand's coral, one at a time
|
|
198
|
+
A promotion is a headline and an action on a full-bleed band, not a card in a row
|
|
199
|
+
→ use `CtaBannerSlider` instead.
|
|
200
|
+
|
|
201
|
+
## Example
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
import { FeatureCardsCarousel, Card, CardBody } from '@deriv-com/dds-marketing'
|
|
205
|
+
|
|
206
|
+
<FeatureCardsCarousel title="What you get" description="Everything you need to trade crypto in one place — the assets, the tools and the transfers you expect from a broker.">
|
|
207
|
+
<Card variant="accent">
|
|
208
|
+
<CardBody title="Top cryptos, ready to trade" description="Buy, hold and sell the assets that move the market — BTC, ETH, SOL and more, paired with USDT or USDC." src="/sample-card-image.svg" alt="" />
|
|
209
|
+
</Card>
|
|
210
|
+
<Card variant="accent-strong">
|
|
211
|
+
<CardBody title="Full exchange, whenever you're ready" description="Start with one-tap buys. When you want more, there are charts, a live order book and limit orders." src="/sample-card-image.svg" alt="" />
|
|
212
|
+
</Card>
|
|
213
|
+
<Card variant="accent-strong">
|
|
214
|
+
<CardBody title="Long or short, your call" description="Trade perpetual futures on 12 major pairs, with take profit and stop loss set when you open." src="/sample-card-image.svg" alt="" overMedia />
|
|
215
|
+
</Card>
|
|
216
|
+
<Card variant="surface-light">
|
|
217
|
+
<CardBody title="Send and receive crypto" description="Deposits are free and Deriv charges no withdrawal fees. You only pay the network charge." src="/sample-card-image.svg" alt="" />
|
|
218
|
+
</Card>
|
|
219
|
+
<Card variant="accent-strong">
|
|
220
|
+
<CardBody title="Crypto, plus everything else" description="Trade crypto alongside the CFDs, options and forex Deriv is known for. One login, nothing to juggle." src="/sample-card-image.svg" alt="" />
|
|
221
|
+
</Card>
|
|
222
|
+
</FeatureCardsCarousel>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## In use
|
|
226
|
+
|
|
227
|
+
Most rows below hold the same set, written once here:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { Card, CardBody } from '@deriv-com/dds-marketing'
|
|
231
|
+
|
|
232
|
+
const cards = (
|
|
233
|
+
<>
|
|
234
|
+
<Card variant="accent">
|
|
235
|
+
<CardBody title="Top cryptos, ready to trade" description="Buy, hold and sell the assets that move the market — BTC, ETH, SOL and more, paired with USDT or USDC." src="/sample-card-image.svg" alt="" />
|
|
236
|
+
</Card>
|
|
237
|
+
<Card variant="accent-strong">
|
|
238
|
+
<CardBody title="Full exchange, whenever you're ready" description="Start with one-tap buys. When you want more, there are charts, a live order book and limit orders." src="/sample-card-image.svg" alt="" />
|
|
239
|
+
</Card>
|
|
240
|
+
<Card variant="accent-strong">
|
|
241
|
+
<CardBody title="Long or short, your call" description="Trade perpetual futures on 12 major pairs, with take profit and stop loss set when you open." src="/sample-card-image.svg" alt="" overMedia />
|
|
242
|
+
</Card>
|
|
243
|
+
<Card variant="surface-light">
|
|
244
|
+
<CardBody title="Send and receive crypto" description="Deposits are free and Deriv charges no withdrawal fees. You only pay the network charge." src="/sample-card-image.svg" alt="" />
|
|
245
|
+
</Card>
|
|
246
|
+
<Card variant="accent-strong">
|
|
247
|
+
<CardBody title="Crypto, plus everything else" description="Trade crypto alongside the CFDs, options and forex Deriv is known for. One login, nothing to juggle." src="/sample-card-image.svg" alt="" />
|
|
248
|
+
</Card>
|
|
249
|
+
</>
|
|
250
|
+
)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Five cards, one in focus
|
|
254
|
+
|
|
255
|
+
The reference design's band: coral, dark and light cards, the next one's edge past the last in view. The third lays its words over its picture, CardBody's overMedia.
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
import { FeatureCardsCarousel } from '@deriv-com/dds-marketing'
|
|
259
|
+
|
|
260
|
+
// Five cards, one over its picture
|
|
261
|
+
<FeatureCardsCarousel title="What you get" description="Everything you need to trade crypto in one place — the assets, the tools and the transfers you expect from a broker.">{cards}</FeatureCardsCarousel>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Cards that lead somewhere
|
|
265
|
+
|
|
266
|
+
A card with a way on carries it as CardBody's link — inherit ink on the coloured cards, so it reads on coral and on dark.
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import { Card, CardBody, FeatureCardsCarousel, Link } from '@deriv-com/dds-marketing'
|
|
270
|
+
|
|
271
|
+
// Each card with a link
|
|
272
|
+
<FeatureCardsCarousel title="Built for every trader">
|
|
273
|
+
<Card variant="accent-strong">
|
|
274
|
+
<CardBody title="Trade on any device" description="Desktop, web and mobile, all from one account." src="/sample-card-image.svg" alt="" link={<Link href="/platforms" tone="inherit">Learn more</Link>} />
|
|
275
|
+
</Card>
|
|
276
|
+
<Card variant="surface-light">
|
|
277
|
+
<CardBody title="250+ markets" description="Forex, stocks, commodities and more, side by side." src="/sample-card-image.svg" alt="" link={<Link href="/markets">Learn more</Link>} />
|
|
278
|
+
</Card>
|
|
279
|
+
<Card variant="accent">
|
|
280
|
+
<CardBody title="Start in minutes" description="Open an account with as little as $5." src="/sample-card-image.svg" alt="" link={<Link href="/signup" tone="inherit">Learn more</Link>} />
|
|
281
|
+
</Card>
|
|
282
|
+
<Card variant="accent-strong">
|
|
283
|
+
<CardBody title="Copy the best" description="Follow traders whose results you can see, and stop whenever you like." src="/sample-card-image.svg" alt="" link={<Link href="/copy-trading" tone="inherit">Learn more</Link>} />
|
|
284
|
+
</Card>
|
|
285
|
+
</FeatureCardsCarousel>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### On the grey band and the dark one
|
|
289
|
+
|
|
290
|
+
The same cards on the other two grounds. The light card turns white on the grey band; on the dark band the dots take the band's ink and the arrows turn white.
|
|
291
|
+
|
|
292
|
+
```tsx
|
|
293
|
+
import { FeatureCardsCarousel } from '@deriv-com/dds-marketing'
|
|
294
|
+
|
|
295
|
+
// ground="subtle"
|
|
296
|
+
<FeatureCardsCarousel title="What you get" description="Everything you need to trade crypto in one place — the assets, the tools and the transfers you expect from a broker." ground="subtle">{cards}</FeatureCardsCarousel>
|
|
297
|
+
|
|
298
|
+
// ground="strong"
|
|
299
|
+
<FeatureCardsCarousel title="What you get" description="Everything you need to trade crypto in one place — the assets, the tools and the transfers you expect from a broker." ground="strong">{cards}</FeatureCardsCarousel>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Moving on its own
|
|
303
|
+
|
|
304
|
+
autoplay steps the row a stop at a time and returns to the start after the last. It holds under the pointer or focus, never moves for a reader who asked for less motion, and stops for good on a press.
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
import { FeatureCardsCarousel } from '@deriv-com/dds-marketing'
|
|
308
|
+
|
|
309
|
+
// autoplay
|
|
310
|
+
<FeatureCardsCarousel title="What you get" description="Everything you need to trade crypto in one place — the assets, the tools and the transfers you expect from a broker." autoplay>{cards}</FeatureCardsCarousel>
|
|
311
|
+
```
|
|
@@ -19,6 +19,7 @@ It sits on the page's own ground by default; `ground` paints the grey or the dar
|
|
|
19
19
|
- The point is several things the reader gets, each one line long → `FeatureBullets`
|
|
20
20
|
- There are three or four points and each needs its own picture → `FeatureCards`
|
|
21
21
|
- The section opens the page → `ProductHero`
|
|
22
|
+
- The picture is the section's weight, wide or tall enough to stand under the words rather than beside them → `FeatureStack`
|
|
22
23
|
- A list. Two sentences separated by a full stop is not a list, and a reader scanning for several things will miss the second — that is what FeatureBullets is for
|
|
23
24
|
- The page's opening or closing band. This is a section in the middle of a page and carries no navigation of its own
|
|
24
25
|
- A call to action. The way onward here is a link to somewhere that says more, not the thing the page wants a reader to do
|
|
@@ -190,6 +191,10 @@ Two things genuinely have no logical form and are not covered by this. A CSS gra
|
|
|
190
191
|
A page's opening band is a claim, not a supporting point
|
|
191
192
|
→ use `ProductHero` instead.
|
|
192
193
|
|
|
194
|
+
❌ FeatureSplit for: The picture is the section's weight, wide or tall enough to stand under the words rather than beside them
|
|
195
|
+
The same feature stacked: the words centred over a large picture that stands on the band's edge, where a split would hold the picture to half the width
|
|
196
|
+
→ use `FeatureStack` instead.
|
|
197
|
+
|
|
193
198
|
## Example
|
|
194
199
|
|
|
195
200
|
```tsx
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
<!-- GENERATED from feature-stack.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# FeatureStack
|
|
4
|
+
|
|
5
|
+
A section that leads with a statement and ends on a picture: a heading, a line under it where the heading needs one, a link on to more where the page has one, and a large illustration — a globe, a map, a product shot — standing on the band's foot. FeatureSplit stacked: where a split sets the words beside the picture, this sets them over it. From the fold the words are centred over the picture; on a phone they start at the edge and the picture takes the column.
|
|
6
|
+
|
|
7
|
+
The reference design's PartnersPayout layout, taken down to its frame. The figures the reference drew between the heading and the picture are the page's content and not the block's: a page that wants figures puts them in its own section, or in the copy.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- A statement with a picture that carries it — a global reach shown on a globe, a platform shown on a device — where the picture is the section's weight and the words introduce it
|
|
12
|
+
- Closing a page or a stretch of one on an image, with a way on for the reader who wants more
|
|
13
|
+
|
|
14
|
+
## Do not use
|
|
15
|
+
|
|
16
|
+
- The picture belongs beside the words, the two read side by side → `FeatureSplit`
|
|
17
|
+
- The section is a set of figures read as a set → `Stats`
|
|
18
|
+
- The section asks the reader to do one thing, now → `CtaBanner`
|
|
19
|
+
- A picture with words in it. The words are the heading and the line; a picture saying them again cannot be read by a screen reader, translated or selected
|
|
20
|
+
- A photograph a reader needs to see whole. The picture stands on the band's foot at its own proportions up to size.feature-stack.media, and is a scene rather than a document
|
|
21
|
+
|
|
22
|
+
## Anatomy
|
|
23
|
+
|
|
24
|
+
FeatureStack renders 8 elements. A token binding names the part it applies to.
|
|
25
|
+
|
|
26
|
+
- `root` — `<section>`, class `dds-featurestack`. The section. It paints the ground and the ink to go with it — see `ground` — and asks its own width, so the grid folds on the section's measure rather than the window's. A region named by its heading.
|
|
27
|
+
- `inner` — `<div>`, class `dds-featurestack__inner`. The measure and the gutter, the same column every band holds its content in. The step from the words to the picture is space.heading.content.
|
|
28
|
+
- `header` — `<div>`, class `dds-featurestack__header`. The heading, the line under it and the link, FeatureCards' header and its arrangement: ranged to the start on a phone and centred from the fold, over the picture.
|
|
29
|
+
- `title` — `<h2>`, class `dds-featurestack__title`. The statement. `h2` because a section sits under the page's own heading.
|
|
30
|
+
- `description` — `<p>`, class `dds-featurestack__description`. The line under the heading — the period, or the unit — at the description measure. Rendered only when `description` is set.
|
|
31
|
+
- `link` — `<div>`, class `dds-featurestack__link`. The way on, a standalone Link under the line, at space.heading.description-actions. Starts at the edge on a phone and is centred from the fold, with the words. Rendered only when `link` is set.
|
|
32
|
+
- `media` — `<div>`, class `dds-featurestack__media`. The picture, centred, standing on the section's foot — it reaches down through the section's bottom padding so the band ends on it, the reference design's globe. What arrives last.
|
|
33
|
+
|
|
34
|
+
It takes the picture's own shape. The picture shows at its own proportions — square, landscape or portrait as the page made it — and the frame wraps it, as wide as that shape allows up to the column and size.feature-stack.media. What the screen decides is only how tall it may grow: on a phone no taller than aspect.portrait of the column's width, from the fold no taller than aspect.landscape of its widest. A picture taller than that is drawn smaller, never cropped. Its top corners are rounded at radius.container, the corner the package's large cards take, and clip what it holds; its bottom corners stay square, where the picture meets the band's edge.
|
|
35
|
+
- `image` — `<img>`, class `dds-featurestack__image`. The picture, drawn from `image` at its own proportions: as wide as its shape allows up to the frame, and no taller than the screen's limit. Lazily loaded, since it is the last thing in the section.
|
|
36
|
+
|
|
37
|
+
Apply these classes from the generated `featureStackParts` constant rather than writing the strings by hand.
|
|
38
|
+
|
|
39
|
+
## Composition
|
|
40
|
+
|
|
41
|
+
- Takes no children. Everything it renders comes from props
|
|
42
|
+
- Never contains: `FeatureStack`, `LandingHero`, `ProductHero`, `PageHeader`, `Footer`, `Navbar` — in children or in any prop that takes a node
|
|
43
|
+
|
|
44
|
+
## Props
|
|
45
|
+
|
|
46
|
+
### ground — `page` | `subtle` | `strong` (default `page`)
|
|
47
|
+
|
|
48
|
+
- `page` — The default, and the page's own white
|
|
49
|
+
- `subtle` — The grey band, for a section that needs setting apart from the one above it. Painted as the band's tint laid over the page's own ground, so it is the same grey whatever is behind the section
|
|
50
|
+
- `strong` — `color.bg.brand-strong`, the dark band, and the reference design's ground for this layout. The heading and the line under it turn white; an illustration made for a dark ground sits best here
|
|
51
|
+
|
|
52
|
+
Use when: Which of the page's three grounds this section paints, FeatureCards' axis and its reason: the page builds its rhythm from these, and the ink follows the ground in the same value. The cards follow it too — each ground takes the page's own Card in the variant made for it.
|
|
53
|
+
Never for: Marking importance. Every section on a page painted a ground is a page with no emphasis left. And never the coral `color.bg.brand`, which belongs to the band that asks a reader to act.
|
|
54
|
+
|
|
55
|
+
### title — `string` **Required.**
|
|
56
|
+
|
|
57
|
+
Use when: Always. The statement the section makes, in a few words — "Trusted in 190+ countries", "One account, every device".
|
|
58
|
+
Never for: A sentence of explanation. That is the line under it.
|
|
59
|
+
|
|
60
|
+
### description — `string`
|
|
61
|
+
|
|
62
|
+
Use when: A short line under the heading that says what the statement means for the reader, or what the picture shows.
|
|
63
|
+
Never for: A paragraph. One line or two; anything longer is the page's own copy.
|
|
64
|
+
|
|
65
|
+
### link — `node`
|
|
66
|
+
|
|
67
|
+
Accepts: Link
|
|
68
|
+
Use when: A way on for the reader who wants more — "Learn more", "See where we operate". A standalone Link, under the line, the way FeatureCards takes one.
|
|
69
|
+
Never for: A button. The section is a statement and a picture; a Button would make it a banner, and CtaBanner is that.
|
|
70
|
+
|
|
71
|
+
### image — `data` `BlockImage` **Required.**
|
|
72
|
+
|
|
73
|
+
Use when: Always. The picture the section ends on — a globe, a map, a product shot — which the block draws at its own proportions: a square picture stays square, a tall one stays tall, held to the screen's limit. Use one at least as wide as the column, twice that for sharp screens, and give its width and height so the block reserves its shape before it loads. `alt` empty when the heading already says what it shows; otherwise describe it.
|
|
74
|
+
Never for: Artwork with words in it, or a chart. What a reader has to read belongs in the heading and the line, where a screen reader and a translation reach it.
|
|
75
|
+
|
|
76
|
+
## Accessibility
|
|
77
|
+
|
|
78
|
+
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
79
|
+
|
|
80
|
+
- Announced as: `region`
|
|
81
|
+
- `Tab` — Moves to the link, where there is one, and on past the section. Nothing else in it is operable, unless the page puts something operable in the illustration.
|
|
82
|
+
- accessible name from title, so the section is a named region a screen reader can jump to and skip
|
|
83
|
+
- An illustration that only illustrates is marked decorative; one that carries meaning the heading does not is described.
|
|
84
|
+
|
|
85
|
+
## Rules
|
|
86
|
+
|
|
87
|
+
- **On a phone a section's actions stack and each fills the width, including when there is only one** — On a phone a page's actions stack, and each one fills the width. Not most of it, and not the width its label happens to need — the whole column.
|
|
88
|
+
|
|
89
|
+
Two side by side is what this replaces. On the narrowest screen each gets half a column minus the gap, which is rarely enough for a real label: the words wrap inside the pills, the two buttons come out different heights, and the pair reads as a broken row rather than as a choice. Stacked, each has the whole width and neither has to shorten its words to fit.
|
|
90
|
+
|
|
91
|
+
A single action fills too, and that is the part worth saying, because it is the one that looks unnecessary. A lone button has the room to sit at its natural width and still should not: a full-width control is the phone's convention for the thing the screen is asking you to do, and a pill hugging its label reads as one option among others that are not there. It also makes the target predictable — the whole width, wherever the thumb lands — which a centred pill does not.
|
|
92
|
+
|
|
93
|
+
Filling is the row's job rather than the button's. A button has no width of its own and is not given one; the row it sits in becomes a column and stretches its children, so nothing about the control changes and the same button is full width here and its own size on a desktop.
|
|
94
|
+
|
|
95
|
+
This is the phone's breakpoint, size.breakpoint.md, and not the wider one that decides whether a heading is centred. Those are different questions and they break at different widths: a heading stops being centred when the measure is the screen, while a button stops being full width much sooner than that — stretched across a tablet it is a long way from its own label, and a label centred in a metre of pill is harder to hit than one in a pill the size of the words.
|
|
96
|
+
|
|
97
|
+
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
98
|
+
Guidance only — cannot be checked automatically.
|
|
99
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
100
|
+
Guidance only — cannot be checked automatically.
|
|
101
|
+
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
102
|
+
|
|
103
|
+
color.bg.brand carries a second limit that is not about forgetting. Its ink measures 3.39:1, which clears the 3:1 a heading needs and misses the 4.5:1 running copy needs. A coral band may carry a headline and a call to action; a paragraph on one is text the reader has to work through at a ratio the waiver on that role does not cover — the waiver says so itself. A section with copy in it takes color.bg.brand-strong, which is near-black and carries white at full contrast.
|
|
104
|
+
|
|
105
|
+
color.bg.strong is not a section ground. It is the inverted fill for an action that has to outrank what surrounds it, and the components that paint it — Button and ButtonIcon in their inverse form — already set both halves in one rule, which is the pattern a hand-painted section has to copy.
|
|
106
|
+
Guidance only — cannot be checked automatically.
|
|
107
|
+
- **Every gap inside a section names the relationship it expresses, and the same relationship keeps its measure when it turns on its side** — A section's spacing is named by the relationship it expresses, not chosen by size. Every gap in a section has a role token, and reaching for a step off the generic scale because it happens to be the right number is how two sections written by two people stop lining up: the numbers agree today and drift the first time one of them is tuned.
|
|
108
|
+
|
|
109
|
+
The heading group is three steps, not one gap. An eyebrow sits nearer its title than the title sits to its description, and the actions sit further from the description than either — space.heading.eyebrow-title, space.heading.title-description, space.heading.description-actions, in that order. A single `gap` on the group cannot say this; it sets all three the same and the block reads as evenly spaced lines rather than as a mark, a name and a paragraph. The eyebrow has to identify itself for this to work, because a group that opens with a title must not give its description the eyebrow's tighter step.
|
|
110
|
+
|
|
111
|
+
The step between a title and its description follows the size of the title, which is why there are two of it. What a reader sees is not the gap but the gap plus the leading above it, and leading scales with the type: under a display title the leading is most of the space, under a card's title it is half as deep. One value for both makes a card look loose at the size that made a section look right. So space.heading.title-description is the display step and space.heading.title-description-compact is the step at a card's size, and the choice is made by how big the title is rather than by what kind of block it sits in.
|
|
112
|
+
|
|
113
|
+
Every one of those steps is smaller than the gap below the group, and that ordering is what holds the group together as one thing. space.heading.content is the step between a heading group and the content it introduces, and it is the widest measure inside a section: the one gap the eye reads as a change of subject rather than as a continuation.
|
|
114
|
+
|
|
115
|
+
That step is the same whether the content is under the heading or beside it. A split is the same relationship turned on its side — a heading group and the content it introduces — so the space between the two halves is space.heading.content, not a gutter. When the split collapses to one column on a phone the gap becomes vertical again, which is where it started, and nothing has to change for that to be right.
|
|
116
|
+
|
|
117
|
+
space.grid.gutter is between two things of the same kind. Two cards in a row are the same kind; the two halves of a split are not, which is why the gutter is the wrong measure there even when the number would have looked acceptable. The gutter runs on both axes, so a grid reads as an even field rather than as rows with a seam down them.
|
|
118
|
+
|
|
119
|
+
space.inset.card is the card's, not the page's. A row of cards padded differently is a row of different cards, and the fill is the only edge they have. A page composing a row does not get to choose it.
|
|
120
|
+
|
|
121
|
+
Column count is not a breakpoint decision. A row holds as many columns as fit before a column would be narrower than size.grid.column-min, and drops one when they would not. Written as a fixed count that collapses at a breakpoint, a four-up row keeps four columns at every width above the phone and sets its copy two or three words to a line through the whole of the tablet range — and on a narrow desktop, which no breakpoint sits on at all. The threshold is a property of the row rather than of a card: a card fills whatever cell it is given.
|
|
122
|
+
|
|
123
|
+
What this does not cover is the space above and below a section, which is space.section.default and space.section.compact, and the page's own side margin, which is space.inset.page. Those are the section's outside; everything here is its inside.
|
|
124
|
+
Guidance only — cannot be checked automatically.
|
|
125
|
+
- **A section's title is centred over stacked content, starts beside content in columns, and starts on a phone** — Two arrangements, and the title's alignment is decided by which one it is introducing rather than chosen per section.
|
|
126
|
+
|
|
127
|
+
Content stacked under the title — a row of cards, an accordion, a set of steps — takes a centred title. The heading group and the block below it share one axis, so a centred title is symmetric with the thing it names, and the eye drops from the middle of the words to the middle of the set. A title starting at the left over a centred or full-width block reads as belonging to the first column rather than to all of them.
|
|
128
|
+
|
|
129
|
+
Content beside the title — a split, a picture in the other half, anything laid out in columns — takes a title that starts where its content starts. The two share a left edge, and that edge is what says they are one thing read across rather than two stacked. Centring the title there breaks the only alignment the reader has to hold the halves together, and it drifts further from its content the wider the page gets.
|
|
130
|
+
|
|
131
|
+
The heading group is what carries this, not the heading alone. An eyebrow, a title and a description are read as one block and align together; aligning the title without them leaves a centred heading over start-aligned copy, which reads as a mistake rather than as a choice.
|
|
132
|
+
|
|
133
|
+
Centred means all of it, not just the words. A badge, a row of actions, a picture — these are flex children, and a flex child is placed by align-items rather than by text-align, so a block that only sets the text leaves everything that is not text at the start. A hero is the case that shows it: its title and copy centred while its badge and its buttons did not.
|
|
134
|
+
|
|
135
|
+
A capped block centres itself as well as its words. A heading group takes size.heading-group.max, and a cap that is not centred leaves the measure at the start of the column with the words centred inside it — composed, and a long way left of the middle it appears to be in.
|
|
136
|
+
|
|
137
|
+
Both arrangements go to the start on a phone. A centred block reverts below the breakpoint, and the reason is the measure: on a phone the measure is the screen, so a centred title wraps to three or four ragged lines and the eye loses the left edge it was tracking — the same symmetry that reads as composure on a desktop is what makes it hard to scan on a phone. Centring there has to be asked for twice, and a section title is not one of the things that asks: it is centred because there is room for it, and on a phone there is not. Going back to the start means all of it too, and a capped block is the one that hides a leftover: its words go to the start while its measure stays in the middle of the column, which reads as a title still centred over a badge and buttons that are not — the box in the middle and the line inside it at the edge.
|
|
138
|
+
|
|
139
|
+
A hero is a section like any other: its badge, title, copy and actions are one stacked block, so it is centred on a desktop and starts on a phone with everything else.
|
|
140
|
+
|
|
141
|
+
What this is not about is a page whose body is a form or a document. A title over a sign-up form or a guide is not introducing a set of content — it is the first line of the thing itself, and it keeps the alignment the body has, which for running text is the start. The distinction is whether the block below is content the title names or content the title is part of.
|
|
142
|
+
Guidance only — cannot be checked automatically.
|
|
143
|
+
- **Anything a pointer has to hit is at least 24px in both directions** — A control sized by its contents is as big as its contents, and a glyph is chosen for how it reads rather than for how easily it is hit. An icon-only button with no padding is a 16px target — smaller than the pad of a finger, and smaller than the tremor of a hand using a mouse.
|
|
144
|
+
|
|
145
|
+
WCAG 2.2 asks for 24 by 24 CSS pixels at AA. The exceptions are narrower than they look: inline targets inside a sentence are exempt, and so is a small target with 24px of clear space around it — but a clear button sits against the field it empties, and a field is itself a target, so the spacing exemption does not apply to the case that keeps arising.
|
|
146
|
+
|
|
147
|
+
The target and the mark are separate decisions, and conflating them is what produces both faults. Growing the glyph to 24px makes it shout; leaving the button at 16px makes it hard to hit. So the glyph keeps the size that reads correctly beside its text, and the box around it declares a minimum of its own — which is what size.target.min is for.
|
|
148
|
+
|
|
149
|
+
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
150
|
+
Guidance only — cannot be checked automatically.
|
|
151
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
152
|
+
|
|
153
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
154
|
+
|
|
155
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
156
|
+
|
|
157
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
158
|
+
Guidance only — cannot be checked automatically.
|
|
159
|
+
|
|
160
|
+
## Anti-examples
|
|
161
|
+
|
|
162
|
+
❌ FeatureStack for: The picture belongs beside the words, the two read side by side
|
|
163
|
+
FeatureSplit is the same feature read across, the words beside the picture; this is it stacked, the words over a picture that stands on the band's edge
|
|
164
|
+
→ use `FeatureSplit` instead.
|
|
165
|
+
|
|
166
|
+
❌ FeatureStack for: The section is a set of figures read as a set
|
|
167
|
+
Figures are the content there; here the picture is, and figures under the heading would be the page's own composition rather than this block's
|
|
168
|
+
→ use `Stats` instead.
|
|
169
|
+
|
|
170
|
+
❌ FeatureStack for: The section asks the reader to do one thing, now
|
|
171
|
+
A banner is built around its action; this section's link is a way on, not the point of it
|
|
172
|
+
→ use `CtaBanner` instead.
|
|
173
|
+
|
|
174
|
+
## Example
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import { FeatureStack, Link } from '@deriv-com/dds-marketing'
|
|
178
|
+
|
|
179
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/">Learn more</Link>} image={{"src":"/sample-card-image.svg","alt":"","width":800,"height":600}} />
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## In use
|
|
183
|
+
|
|
184
|
+
### The picture keeps its shape
|
|
185
|
+
|
|
186
|
+
A plain image shows at its own proportions; the screen only limits how tall it grows — portrait of the column on a phone, landscape from the fold.
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import { FeatureStack, Link } from '@deriv-com/dds-marketing'
|
|
190
|
+
|
|
191
|
+
// A landscape picture
|
|
192
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/">Learn more</Link>} image={{"src":"/sample-card-image.svg","alt":"","width":800,"height":600}} />
|
|
193
|
+
|
|
194
|
+
// A square picture
|
|
195
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/">Learn more</Link>} image={{"src":"/sample-aspect-art.svg","alt":"","width":1200,"height":1200}} />
|
|
196
|
+
|
|
197
|
+
// A tall picture, held to the limit
|
|
198
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/">Learn more</Link>} image={{"src":"/sample-tall-image.svg","alt":"","width":600,"height":900}} />
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### The ground it sits on
|
|
202
|
+
|
|
203
|
+
The three grounds a section can take. The words take the ground's ink; the picture stands on the band's foot on each.
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
import { FeatureStack, Link } from '@deriv-com/dds-marketing'
|
|
207
|
+
|
|
208
|
+
// On the page itself
|
|
209
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/">Learn more</Link>} ground="page" image={{"src":"/sample-card-image.svg","alt":"","width":800,"height":600}} />
|
|
210
|
+
|
|
211
|
+
// On the grey band
|
|
212
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/">Learn more</Link>} ground="subtle" image={{"src":"/sample-card-image.svg","alt":"","width":800,"height":600}} />
|
|
213
|
+
|
|
214
|
+
// On the dark band
|
|
215
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." link={<Link href="/" tone="inherit">Learn more</Link>} ground="strong" image={{"src":"/sample-card-image.svg","alt":"","width":800,"height":600}} />
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Without a link
|
|
219
|
+
|
|
220
|
+
The link is optional. Without one the words end on the line under the heading, and the picture follows.
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import { FeatureStack } from '@deriv-com/dds-marketing'
|
|
224
|
+
|
|
225
|
+
// Heading, line and picture
|
|
226
|
+
<FeatureStack title="Section title goes here" description="The line under the heading that says what the picture shows." image={{"src":"/sample-card-image.svg","alt":"","width":800,"height":600}} />
|
|
227
|
+
```
|