Skip to content

Call to action

Closing and in-page calls to action, from a slim banner to a full form or a ledger of customer results.

Installation & usage

npx @youj/cli add marketing-cta

Also installs button, icon-arrow-right, illustrations, magnetic, mesh-gradient, reveal, youj-ui-core.

The CLI copies the block to blocks/marketing/cta.tsx with every component it uses, so it’s yours to edit.

Every prop is optional and falls back to the demo, so it renders as you see it until you pass your own. Give it your data, rewrite or translate its strings through copy, and connect its actions:

marketingCta-view.tsx
'use client'

import Link from 'next/link'
import { MarketingCta, type MarketingCtaProps } from '@/blocks/marketing/cta'

export function MarketingCtaView({ primaryCta }: Pick<MarketingCtaProps, 'primaryCta'>) {
  return (
    <MarketingCta
      primaryCta={primaryCta}
      copy={{ title: 'Your next deploy could be your first one here' }}
      linkComponent={Link}
    />
  )
}

Reference

Props8 props, 1 types

Props

MarketingCta props
PropType
titlestring

The headline. Overrides copy.title.

–
descriptionstring

The line under the headline. Overrides copy.description.

–
illustrationIllustrationSlot

The picture on the end side: a scene from the illustrations by id, your own node, or null for none.

default 'deploy'

'deploy'
primaryCtaCtaBandCta

The magnetic primary button.

default Start deploying → `#signup`

Start deploying → `#signup`
secondaryCtaCtaBandCta | null

The quiet link beside it; null hides it.

default Talk to sales → `#sales`

Talk to sales → `#sales`
copyPartial<MarketingCtaCopy>

Any of the block's strings, to rewrite or translate.

–
headingLevel1 | 2 | 3

The headline's level.

default 2

2
linkComponentLinkComponent

The element every internal link renders as, e.g. Next.js Link.

default 'a'

'a'

CtaBandCta

CtaBandCta props
PropType
labelRequiredstring–
hrefRequiredstring–
onClickMouseEventHandler<HTMLAnchorElement>–
Strings2 keys for copy

Strings

copy takes any of these keys; the rest keep their defaults. A key whose text holds a value (a count, a name) takes a function.

titledescription
Built from5 components
Accessibilitylandmarks, headings, forms

Accessibility

Each call to action is a <section> named by its own heading (aria-labelledby). The heading is an h2 by default; headingLevel changes it.

Form and Contact sales use real form elements with labelled fields. Contact sales moves focus to each step's heading as it arrives; its days and times are labelled toggle groups (one tab stop, arrow keys between them) that read each day's open times and say a taken time is taken; a missing time or field is said in an alert and focused; the region is a labelled menu. Proof marks its toggle with aria-pressed, announces changes in a live region and hides decorative marks from assistive technology.

Banner checks the reduced-motion setting. The links and buttons are real a and button elements with the kit’s focus ring.