Tapas UI
Esc
  • IntroductionGetting startedWhat Tapas UI is and where to start.
  • InstallationGetting startedSet up shadcn/ui and add your first section.
  • CLI & AI agentsGetting startedThe shadcn CLI, the @tapas namespace, the MCP server and AI prompts.
  • TemplatesGetting startedWhole pages built from sections, installed with one command.
  • Demo sitesGetting startedThree fictional sites built only from Tapas sections.
  • ThemingCustomizationHow sections pick up your colors and radius.
  • ColorsCustomizationEvery CSS variable sections read, what it is for and where it is used.
  • Dark modeCustomizationSections follow your .dark variables.
  • MotionCustomizationPlain and motion versions, reduced motion and pause controls.
  • AccessibilityCustomizationWhat every section guarantees.
  • Waitlist formsGuidesPost signups to your own API route and store them.
  • Checkout linksGuidesPoint pricing buttons at Stripe payment links or any URL.
Menu
Browse the docs

DocsEffects

Magnetic CTA

A call-to-action band with one large pill button.

Preview

Version
Preview theme color
More themes

Within a radius around it, the button is pulled toward the pointer on a spring, its label shifts a little further, a halo gathers behind it, and it squashes when pressed. With reduced motion turned on, it renders the plain layout.

Ready when you are

One button, hard to miss. Sample copy.

Ready when you are

One button, hard to miss. Sample copy.

Installation

Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.

Usage

import { MagneticCta } from "@/components/custom/magnetic-cta/magnetic-cta";

<MagneticCta
  title="Ready when you are"
  description="One button, hard to miss."
  primaryAction={{ label: "Start building", href: "/signup" }}
  secondaryAction={{ label: "or read the docs first", href: "/docs" }}
/>
import { MagneticCtaMotion } from "@/components/custom/magnetic-cta/magnetic-cta-motion";

<MagneticCtaMotion title="Ready when you are" primaryAction={{ label: "Start building", href: "/signup" }} />

Props

PropTypeDefaultDescription
title* (required)string–The heading, rendered as an h2.
primaryAction* (required){ label: string; href: string }–The large pill button.
secondaryAction{ label: string; href: string }–A quieter text link under the button.
descriptionstring–Supporting line under the title.
...propsReact.ComponentProps<"section">–Any other section attribute (id, aria-*, data-*, ref) goes to the root element.
PropTypeDefaultDescription
title* (required)string–The heading, rendered as an h2.
primaryAction* (required){ label: string; href: string }–The large pill button.
secondaryAction{ label: string; href: string }–A quieter text link under the button.
descriptionstring–Supporting line under the title.
...propsReact.ComponentProps<"section">–Any other section attribute (id, aria-*, data-*, ref) goes to the root element.

Accessibility

  • The button is a real link at least 56px tall; the text link under it is 44px tall.
  • The magnetic pull is for mouse and pen only. With touch, keyboard or reduced motion it is a normal button in a fixed place.
  • The motion version follows the visitor's reduced-motion setting and never hides content before it animates.