Playground

Call to action block

A closing call to action with one sentence and one next step.

  • Built on native elements
  • A section named by its title; actions are ordinary buttons or links.
  • Styles in one file: container.css

Import

import '@monoline/css';
import {BlockCta} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add block-cta

Usage

import {BlockCta, Button} from '@monoline/react';

<BlockCta
  title="Start building today"
  description="Install the package and copy your first component."
  actions={<><Button variant="solid">Get started</Button><Button variant="line">Read the docs</Button></>}
/>

Examples

Default

Props

BlockCtaProps

PropTypeDefaultDescription
title requiredReactNode–The one-sentence call to action, rendered as the section heading.
descriptionReactNode–Optional muted supporting line under the title.
actions requiredReactNode–The next step: a solid Button and maybe a line one.
headingLevel1 | 2 | 3 | 4 | 52Outline level of the title, 1 to 5. Default 2.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

This component sets no state attributes.

CSS classes

ClassStylesheet
.containercontainer.css
.container-fullcontainer.css
.container-pagecontainer.css
.container-textcontainer.css
.headingheading.css
.heading-displayheading.css
.heading-lgheading.css
.heading-mdheading.css
.heading-smheading.css
.heading-xlheading.css
.texttext.css
.text-accenttext.css
.text-dangertext.css
.text-fulltext.css
.text-lgtext.css
.text-mdtext.css
.text-mutedtext.css
.text-oktext.css
.text-smtext.css
.text-successtext.css
.text-truncatetext.css
.text-warningtext.css
.text-xstext.css
.btn02-buttons.css
.btn-block02-buttons.css
.btn-danger02-buttons.css
.btn-ghost02-buttons.css
.btn-lg02-buttons.css
.btn-line02-buttons.css
.btn-sm02-buttons.css
.btn-solid02-buttons.css
.block-ctablock-cta.css
.block-cta-actionsblock-cta.css
.block-cta-boxblock-cta.css
.block-cta-copyblock-cta.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.container {
  border-color: var(--accent);
}

Accessibility

  • A section named by its title; actions are ordinary buttons or links.