Composite

CallToAction

A headline paired with action buttons to drive a single conversion.

Default configuration

Call to Action

Astro + Tailwind CSS

Be very surprised by these huge fake numbers you are seeing on this page. Don't waste more time!

default
---
import CallToActionBlock from '@alfadormx/blocks/composite/CallToAction.astro';
---

<CallToActionBlock
  headline={{
    tagline: 'Call to Action',
    title: 'Astro + Tailwind CSS',
    subtitle:
      "Be very surprised by these huge fake numbers you are seeing on this page. Don't waste more time!",
    align: 'center',
  }}
  actions={[
    {
      label: 'Get template',
      icon: { name: 'heroicons:arrow-down-tray' },
      intent: 'primary',
      size: 'lg',
      variant: 'solid',
      shape: 'pill',
    },
    {
      label: 'Subscribe Now',
      icon: { name: 'heroicons:arrow-top-right-on-square' },
      intent: 'secondary',
      size: 'lg',
      variant: 'solid',
      shape: 'pill',
      iconPosition: 'right',
    },
  ]}
/>

Shared action defaults

defaultActionConfig is merged under every action, so each entry only lists what differs. actionsClass styles the wrapper around the buttons.

Call to Action

Shared button styling

Both buttons take size, shape, and variant from one place.

shared-action-defaults
---
import CallToActionBlock from '@alfadormx/blocks/composite/CallToAction.astro';
---

<CallToActionBlock
  headline={{
    tagline: 'Call to Action',
    title: 'Shared button styling',
    subtitle: 'Both buttons take size, shape, and variant from one place.',
  }}
  defaultActionConfig={{ size: 'lg', shape: 'pill', variant: 'solid' }}
  actionsClass="md:justify-start"
  actions={[
    { label: 'Get template', intent: 'primary' },
    { label: 'Subscribe Now', intent: 'secondary' },
  ]}
/>

API Reference

PropTypeDefaultDescription
containerContainerProps—Container/layout configuration wrapping the headline and actions; merged with the block's default centered card styling.
headlineHeadlineProps—Headline content rendered at the top of the call-to-action block.
actionsButtonProps[][]List of button configs rendered as the call-to-action buttons below the headline.
defaultActionConfigLayerConfig<ButtonProps>—Button config merged under every entry in `actions`
actionsClassstring—Custom classes for the wrapper around the action buttons (default: 'flex flex-col md:flex-row gap-4 justify-center mb-8')