Skip to documentation content

Marketing foundation

The type scale, spacing, frames, and product scenes that marketing blocks share.

Every block installs the foundation with it. Use the same pieces for sections of your own, and they will sit next to the blocks without adjustment.

npx honestui@latest add marketing-foundation

The files go to components/marketing/foundation. Tokens and classes are prefixed with mkt, so product screens keep the proportions of your theme.

Pieces

PieceResponsibility
MarketingSectionThe space above and below a section, and its surface: plain, wash, or inverse
MarketingContainerThe shared edge and gutter: content is 1200 pixels, wide is 1440, prose is 736
MarketingHeadingA heading whose level and size are chosen separately
SectionHeadingEyebrow, title, description, and action, aligned start, center, or split
ActionGroup, TextLinkOne primary action with others that wrap, and a quiet text action
ProductFrame, ProductStageThe elevated treatment for an interface preview, and the ground it stands on
StageBackdropRibbed glass for a stage, in tints of the accent color
MediaFrameImage proportions, a separate mobile crop, a dark version, and a caption
Portrait, PersonAttributionName, role, and organization in one fixed order
LogoItem, LogoGroupOptical sizing, and a row that becomes a grid

Compose a section

import { ActionGroup } from "@/components/marketing/foundation/action-group"
import { MarketingContainer, MarketingSection } from "@/components/marketing/foundation/section"
import { SectionHeading } from "@/components/marketing/foundation/section-heading"

<MarketingSection aria-labelledby="security-title">
  <MarketingContainer>
    <SectionHeading
      align="split"
      titleId="security-title"
      title="Kept where you ask us to."
      description="Documents stay in the region you choose, backups included."
      action={<ActionGroup actions={[{ label: "Read the policy", href: "/security" }]} />}
    />
  </MarketingContainer>
</MarketingSection>

Type and spacing

Sizes are fluid between a 375 pixel and a 1440 pixel viewport. Change the tokens in marketing.css to change every block at once.

TokenPhoneDesktopUsed for
--mkt-size-hero42px80pxEditorial heroes and closing lines
--mkt-size-product40px68pxProduct heroes
--mkt-size-section31px48pxSection headings
--mkt-size-quote24px38pxLarge quotes
--mkt-size-title20px22pxFeature titles
--mkt-size-lead17px19pxSupporting paragraphs
--mkt-section72px128pxThe whole gap between two sections
--mkt-gutter20px40pxThe page edge

One owner sets each gap. Sections set the space between sections, the container sets the edge, and blocks set only what is inside them.

Product scenes

Scenes are pictures of an interface built from real markup. They follow your theme, stay sharp at every size, and reflow in a small container. They share one story, one cast, and one set of rules for text, icons, padding, and status.

npx honestui@latest add marketing-scenes
SceneShows
DocumentReviewSceneA document with tracked changes, comments, and approvals
ApprovalPanelSceneWho was asked, who has answered, and when it is due
VersionCompareSceneWhat changed, who changed it, and every version before
SearchResultsSceneA phrase found across several documents
ReviewScheduleSceneWho reads when, and what the publish date waits for
SignoffAnalyticsSceneOne measure over time, from zero, with its ends labeled
WorkflowStepsSceneThe path a document takes, in order
FileLibrarySceneEvery document with its state, and the selected one in detail
ApiResponseSceneA request and what comes back

Place a scene in a ProductFrame and describe it. The frame is announced as one image and nothing inside it can be focused.

import { ProductFrame, ProductStage } from "@/components/marketing/foundation/product-frame"
import { ApprovalPanelScene } from "@/components/marketing/scenes/approval-panel"

<ProductStage className="p-12">
  <ProductFrame label="An approval panel. Two of three people have approved.">
    <ApprovalPanelScene />
  </ProductFrame>
</ProductStage>

Stage backdrop

StageBackdrop draws Fluted Glass behind a product frame. Its three colors are --mkt-glass-1, --mkt-glass-2, and --mkt-glass-3, which follow the accent color and the theme. It stops when it leaves the screen, holds one still frame with reduced motion, and is a flat tint without WebGL.

Every block with a stage takes a backdrop: an image, an element of your own, or null for no backdrop.

import { HeroCenteredProduct } from "@/components/marketing/hero-centered-product"
import { Silk } from "honestui/shaders"

<HeroCenteredProduct backdrop={<Silk className="absolute inset-0 -z-1" color="#1d2536" />} />

Motion

Small feedback takes 150 to 220 milliseconds and panels take 250 to 400. Entrances move ten pixels at most. When someone prefers reduced motion, everything appears in its finished state.

Accessibility

  • Text meets 4.5:1 in both themes. --mkt-ink-faint does not, so use it only for marks and rules.
  • Headings keep their level when you change their size. Give the first block on a page as="h1" if you compose your own.
  • Sections reflow at 320 pixels without horizontal scrolling.
  • Links and controls reach 44 pixels on touch screens.