GitHub

Command Palette

Search for a command to run...

Components/Buttons/CTA Button

CTA Button

Buttonsinline sandbox

An animated call-to-action button with a traveling arrow and expanding background effect. Perfect for hero sections and prominent action triggers.

cta button
call to action
animated button
hover animation
framer motion button

Preview

Uses cn() utility from shadcn/ui. Make sure you have it installed.

Customize arrowTravelDistance to match your button width. Default works well for label + highlightLabel text.

Installation

Use the shadcn CLI to install this component:

npx shadcn@latest add https://messyui.dev/r/cta-button.json

Props

PropTypeDefaultDescription
labelstring"Browse"Main label text shown on the button
highlightLabelstring"Components"Highlighted/italic portion of the label with serif font
bgColorHexstring"#ff2056"Background color hex value for the hover state
arrowBgColorBeforestring"#efb100"Arrow container background color before hover
arrowTravelDistancestring"calc(100% + 7.8rem)"How far the arrow travels on hover (CSS calc value)
textShiftnumber-30How much the text shifts left on hover (in pixels)
durationnumber0.3Animation duration in seconds
textColorAfterstring"#fff"Text color after hover (hex value)
iconColorBeforestring"#000000"Icon color before hover (hex value)
iconColorAfterstring"#fff"Icon color after hover (hex value)
classNamestring""Additional className for the button

Related Components