Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Channel Switchboard Affiliate Contact Block for React

An affiliate application laid out as ruled bands: a switch per channel wakes its link and audience fields in place, and an estimate band adds up example earnings beside the submit 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

An affiliate application section for React with Base UI, laid out as a switchboard on ruled bands that meet the rails with + marks. A start-aligned header sits over a wide form: one band for a name and an email, four more for channels (a newsletter, a video channel, a blog and a social feed), each with a switch. Every band shows its two fields, a link to the channel and the size of its audience in a number input; they stay dimmed until the channel's switch is on. A last band adds up the audiences at fixed example rates, shown in a left-to-right run and labelled "Example only", beside the submit button. Submitting checks every field, shows each problem under its field, marks the control invalid and moves focus to the first one; a valid application turns into a confirmation in the same space that lists the channels and their audiences. It's built from Switch, Number Input, Input, Field, Guides, Shine Button and Button, with CSS transitions for the entrances and the reveal, and your theme's tokens for every colour. For programmes that ask affiliates where they publish before they apply.

FAQ

Where does the form send its data?

Nowhere yet. The submit handler waits 800 milliseconds, as a stand-in for a request, then shows the confirmation. Replace that timer in submit with a call to your affiliate platform or inbox: details holds the name and email, and entries holds, for each channel, whether it is on, its link and its audience.

Where do the earnings in the estimate come from?

Nowhere real. Each channel in CHANNELS has a fixed example rate in dollars a month for every 1,000 people in its audience ($18 for a newsletter, $9 for a video channel, $12 for a blog, $5 for a social feed). earnings multiplies the audience you typed by the rate, rounds to whole dollars, and totalOf adds the channels that are on. The band says "Example only, not a promise of earnings", and so does the confirmation. Replace the rates with your programme's published terms, or drop the band if you don't publish any.

Why do the fields stay in view instead of opening when the switch is on?

So that turning a switch never moves the page. Each band keeps its link and audience fields in place; they are disabled, and dimmed by the catalog's own disabled style, until the channel's switch is on, then they take focus like any field. A line under them states the example rate, and says what the channel could earn once the switch is on and an audience is typed; both lines keep their height. Turning a switch off keeps what you typed, so turning it back on brings it back.

What does the form check?

A name, an email shaped like one, at least one channel on, and for each channel that is on a web address (https:// is added when you leave it off, and the host needs a dot) and an audience that is a whole number of at least 1. Typing in a field clears its error. Focus goes to the first problem in reading order, which is the first switch when no channel is on.

Why does the audience field show thousands separators?

The number input formats the number as you leave the field ("8,000"). The block strips the commas before it checks or adds anything, so what the form keeps is always plain digits. Arrow keys change the number by 100.

How does it fit on a phone?

Every band stacks: its label and switch first, then its two fields one per row, so nothing scrolls sideways at 320 pixels. The estimate and the submit button sit at the end, and the button goes full width. On a wide screen each band puts its label in a column at the start and its fields beside it.

  • Pro

    A creator enquiry in a compact frame: a switch between three kinds of channel, an audience slider with five named stops, and a readout of the tier and a typical rate per post, labelled as an example.

  • Pro

    Link and QR Referral Contact

    Partners and creators

    A refer-a-friend split: a personal link with a Copy Button and a QR code of it, a reward bar toward a free box, and a form that invites one friend.

  • Pro

    A sponsorship builder: four priced add-ons with the reach each adds, a live total that rolls, the campaign goal and a form that confirms in place.

  • Pro

    A talk-to-sales split for a scheduling platform: what happens next as three numbered steps and a band of contact details beside a form that checks itself, shows each problem under its field and confirms in place.

  • Pro

    A receipt that prices itself, for a webhook-delivery service: number steppers for seats, events and days of history drive a live bill that stamps the cheapest plan and itemises what goes past its allowance.

  • Pro

    A freelance-marketplace brief with skill tags, a fixed or hourly budget slider, a timeline, and a published line that typical briefs get 6 replies in a day.