Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Split Attribution Window CTA Block for React

A reverse split call to action for a partner program: a slider tool in a hairline frame that shows whether a referral still counts on the day a visitor buys, beside the pitch, four benefits and a Shine Button.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A reverse split call to action for an affiliate, referral or partner program, here for Kiln, a fictional studio scheduling app. The visual sits at the start: a narrow tool on a card in a hairline frame with + marks on its corners. It answers the question every partner has: when does a referral count? A visitor clicks your link on day 0, and a slider sets the day they buy. The track is drawn in two parts, the days that count (solid) and the days after the window (muted), and the result under it says "Day 62: credited to you" or "Day 95: expired", with what the sale earns. At the end, behind a split divider, are a badge, the headline, four benefits and a Shine Button. The copy comes first in the page, so on a phone the button is on the first screen and the tool follows under a rule. For affiliate programs, referral schemes, reseller pages and any offer with a time limit worth showing.

FAQ

How do I change the commission, the window and the example?

Edit the constants at the top of the file: COMMISSION (the percentage), WINDOW_DAYS (the last day that counts), MAX_DAYS (the length of the track) and SALE (the example plan's monthly price). The benefits, the edge drawn on the track, the "Day 90" mark, the verdicts and the earned amount are all worked out from them, with whole-number maths, so the block keeps agreeing with itself when you change one.

How is the window drawn on the slider?

The slider's own track is painted with a hard-edged gradient, in the foreground colour up to the last day that counts and in the muted track colour after it, and the filled range is hidden so the colours stay put as the thumb moves. The edge sits under the thumb's centre on day 90, using half the thumb's width (--inset) because the thumb stays inside the track's ends. The block assumes the default style's 12px thumb; set --inset to half of yours. The marks under the track share the same inset, and the whole drawing runs in the reading direction.

How do I use it with a keyboard and a screen reader?

The slider is labelled Day a visitor buys, moves a day at a time with the arrow keys, and Home and End jump to day 0 and day 120. It reads its value as the verdict ("Day 62: credited to you") instead of a bare number. A polite status line, which stays in the page, repeats the verdict once you stop moving, never during a drag, and the marks and the click icon are hidden from assistive technology because the label and the verdict say the same.

Does the result move as the verdict changes?

No. The badge, the title and the sentence swap in place, and the title and the sentence keep room for their longest wording, so nothing below or beside the card moves when the thumb crosses day 90, down to a 320 px screen.

How does it fit a phone?

The columns stack below the lg breakpoint with the copy first, so the Shine Button lands on the first screen, and the framed tool follows. The marks use short labels so the click and the day 90 mark never touch at 320 px, and the sentence wraps inside the card.

What moves, and can I turn it off?

The copy fades up on load, the Shine Button sweeps a band of light across itself on hover or focus, and the thumb follows your pointer or keys. It's all CSS, with no animation library. With reduced motion on, the copy appears in place and the light fades in instead of sweeping.

  • Pro

    A reverse split CTA for an automation platform: a search field over a 3 by 3 grid of integrations in cells that share hairlines, flush to the rail, beside a Shine Button. A search that finds nothing offers to request that tool.

  • Pro

    A split call to action for a code reviewer: the pitch with a Shine Button and an outline button, beside a panel flush to the rail that sets the old way beside the new one in three ruled rows.

  • Pro

    A split CTA for a course: the pitch, a ruled row of totals and a Shine Button beside a numbered accordion whose modules are full-width rows ruled by solid hairlines, each opening to its lessons and durations.

  • Pro

    Partner Program Pricing

    Sales and partners

    A three-tier partner program where the commission is the hero: each tier is a ruled row led by its percentage (10%, 20%, 30%) at display size, with its discounted seat price and perks, beside the pitch.

  • Pro

    Referral Rewards Pricing

    Discounts and offers

    Referral pricing as a copyable invite link over a three-step reward track: friends invited and joined (2 of 3), the free months each step pays (1 month, 3 months, a year) and what's already earned.

  • Pro

    Language Chips CTA

    Pickers and toggles

    A split call to action for a product that speaks your users' language: the pitch and a Shine Button beside a framed greeting over a cloud of language chips that switch the greeting and the button's label, each in its own language and direction.