Switch Page React template for Tailwind CSS v4
v1.0.0Added in 1.9.0
A migration page for teams leaving other tools: an import visual, source tiles, a working 4-step import wizard, a support matrix and offers.
The hero rises in once and its drawn import plays: the old tool's cards dim, Acme rows land one by one and the counter rolls up to 1,284 tasks imported (still under reduced motion and on the server). Start importing scrolls to the import section. Pick the tool you are coming from on the source tiles (a radio group: arrows, Home and End move and select); the wizard below follows it and starts over. The wizard has four steps on a stepper (completed steps are clickable; below 640px it becomes a compact header). Connect: sign in with a pretend OAuth button (it spins, then shows the connected account and counts), use the sample data, or drop or choose a real .csv file, which is read in the browser (header row, row count, a type, size and empty check with an inline error). Map fields: every column comes auto-matched to an Acme field with a Matched, Check or Skipped badge; change any select (a bottom sheet on phones) and the three preview task cards update live, a field taken by another column moves off it, Reset matches puts the suggestions back, and Continue waits until a column maps to Title. Choose what to bring: switches for comments, attachments, archived items and people invites (disabled when the export has none) roll the summary counts and the time estimate. Import (the move step): the progress bar and percentage run on a motion value through five stages, then a success card says what moved, with Open workspace and Import something else. onImport receives the whole config; a rejected promise shows Try again. Below, the What moves over table marks full, partial and unsupported features per source, highlighting the picked one; on phones it becomes one card per source with a chip switcher. The translator maps the old tool's words to Acme's (chips switch the source), followed by the 3 months free offer, the white-glove band for large teams, testimonials, the FAQ and the closing band.
Built with
The sections this page is made of. In the full-screen preview, hold Alt to outline each one on the page.
Add to a project
npx wingo-ui@latest add switch-pagePro item: the CLI needs a Pro account. See plans
Usage
Import SwitchPage from @/components/templates/switch-page.
// app/(marketing)/switch/page.tsx
"use client"
import Link from "next/link"
import { SwitchPage } from "@/components/templates/switch-page"
export default function SwitchRoute() {
return (
<SwitchPage
linkComponent={Link}
ctaTone="brand"
onImport={async (config) => {
const response = await fetch("/api/imports", {
method: "POST",
body: JSON.stringify(config),
})
if (!response.ok) throw new Error("The import could not start")
}}
/>
)
}Props
designdefault"classic""classic" | "bold" | "minimal"The whole page's look. classic: a glow behind a split hero with the import visual beside the copy, raised panels and muted bands; bold: a pill header, a giant start-aligned title on a grid with the visual below, gradient bands, flat tiles, featured testimonials, FAQ cards, a band CTA and a wordmark footer; minimal: a transparent header, a centered hero on a soft wash, outlined flat panels, no bands and a simple footer. testimonialsProps, faqProps and ctaProps still win.
sourcestringThe picked source tool id, controlled. Use with onSourceChange.
defaultSourcedefault"tasklane"stringThe source tool on load: tasklane, boardly, notebase, sheetwise, csv or acme (the first source when unknown).
onSourceChange(source: string) => voidA source tile was picked; the wizard goes back to Connect.
step"connect" | "map" | "choose" | "move"The wizard step, controlled. Use with onStepChange.
defaultStepdefault"connect""connect" | "map" | "choose" | "move"The wizard step on load. Past Connect without data the wizard works on the source's sample export.
onStepChange(step: SwitchStep) => voidFires when Continue, Back, the stepper or a source change moves the wizard.
onConnect(source: SwitchSource) => (void | Promise<unknown>)The Connect button of an OAuth source. A promise keeps it loading and a rejection shows its message. Without it the button waits 900 ms and connects.
onImport(config: SwitchImportConfig) => (void | Promise<unknown>)Runs the import with { source, origin, fileName?, mapping, options, totals }. A promise keeps the progress running until it settles and a rejection shows Try again. Without it a pretend import runs for about 3 seconds.
maxFileSizedefault10numberThe biggest CSV file the dropzone reads, in MB.
whiteGloveThresholddefault200numberThe team size the white-glove band speaks to (More than 200 people?).
sourcesdefault"SWITCH_SOURCES"SwitchSource[]The source tools: { id, name, kind, description, icon?, method, imports, time, account?, counts, columns, rows, terms? }.
fieldsdefault"SWITCH_FIELDS"SwitchField[]The Acme fields columns map to: { id, label, description?, synonyms, required? }. Title is required.
matrixdefault"SWITCH_MATRIX"SwitchMatrixRow[]The What moves over rows: { id, feature, description?, support (by source id), notes? }.
stagesdefault"SWITCH_IMPORT_STAGES"string[]The import's stages, shown one after another while it runs.
testimonialsdefault"SWITCH_TESTIMONIALS"Testimonial[]Quotes from teams that switched, with a metric each.
faqdefault"SWITCH_FAQ"FaqItem[]{ question, answer } pairs about switching.
labelsdefault"DEFAULT_SWITCH_PAGE_LABELS"Partial<SwitchPageLabels>Every visible string; the ones with names or numbers in them are functions.
hrefsdefault"DEFAULT_SWITCH_PAGE_HREFS"Partial<SwitchPageHrefs>{ signUp, contact, workspace, offer }.
showSourcesdefaulttruebooleanThe source tiles above the wizard.
showMatrixdefaulttruebooleanThe What moves over table.
showTranslatordefaulttruebooleanThe same concepts, new names translator.
showOfferdefaulttruebooleanThe 3 months free offer card.
showWhiteGlovedefaulttruebooleanThe white-glove migration band for large teams.
showTestimonialsdefaulttruebooleanThe testimonials.
showFaqdefaulttruebooleanThe FAQ.
showCtadefaulttruebooleanThe closing call to action.
testimonialsLayoutdefault"grid""grid" | "quote" | "featured"The testimonials layout. Applies to the classic design.
ctaVariantdefault"inverted""inverted" | "soft" | "split"The closing band: a solid band, a gray band, or copy beside the buttons on a raised panel. Applies to the classic design.
glowdefaulttruebooleanThe glow over the first screen; false is the plain page. Applies to the classic design; background wins over it.
alternatedefaulttruebooleanBands in the bandBackground look on every other section. Applies to the classic and bold designs.
backgrounddefault"glow""plain" | "soft" | "glow" | "aurora" | "grid" | "dots"The main background: plain is the bare page color; the others tint the page and add a glow, an aurora, a grid or dots over the first screen. A design picks its own unless you set one (classic glow, bold grid, minimal soft).
backgroundColordefault"oklch(0.62 0.14 275)"stringThe tint and glow color of the main background; without one it follows tone when tone is not neutral.
bandBackgrounddefault"muted""muted" | "tinted" | "gradient" | "dots"The secondary background of the alternating bands. Cards, fields and tiles inside a band are lifted one step above it, so they never share its color. bold picks gradient unless you set one.
bandColordefault"oklch(0.62 0.14 275)"stringThe tint of tinted and gradient bands; defaults to backgroundColor.
tonedefault"neutral""neutral" | "brand" | "success" | "warning" | "danger" | "info"Accents: the hero badge, the page glow when backgroundColor is not set, the import visual, the picked source ring, the stepper, switches, progress and chips.
ctaTonedefault"neutral""neutral" | "brand" | "success" | "warning" | "danger" | "info"Start importing, Import now, Open workspace, Claim the offer, the header's Get started and the closing band; brand is the marketing orange.
radiusdefault"md""none" | "sm" | "md" | "lg" | "full"The corners of the wizard's selects and buttons.
headerdefaulttruebooleanThe marketing header; off inside a site layout.
footerdefaulttruebooleanThe marketing footer.
headerPropsPartial<MarketingHeaderProps>Passed to MarketingHeader.
footerPropsPartial<MarketingFooterProps>Passed to MarketingFooter.
testimonialsPropsPartial<TestimonialsSectionProps>Overrides for the TestimonialsSection.
faqPropsPartial<FaqSectionProps>Overrides for the FaqSection.
ctaPropsPartial<CtaSectionProps>Overrides for the CtaSection.
animateIndefaulttruebooleanThe hero rises in, the import visual plays and summary numbers roll on a client mount; false keeps the page still (thumbnails). Reduced motion always does.
localedefault"en-US"stringIntl locale for counts and dates.
linkComponentdefault"<a>"(props: LinkComponentProps) => ReactNodeThe router link for every link on the page (next/link in an app).
classNamestringClasses for the root.
classNamesPartial<Record<SwitchPageSlot, string>>Classes for header, hero, title, visual, sources, source, wizard, stepper, mapping, preview, options, progress, success, matrix, translator, offer, whiteGlove, testimonials, faq, cta and footer.
Parts
parseSwitchCsv
function(text, maxRows = 5000) => { columns, rows, rowCount }: a small CSV parser for exports (quoted fields, doubled quotes, comma or semicolon, CRLF, a byte order mark, duplicate headers renamed).
matchSwitchColumns
function(columns, fields = SWITCH_FIELDS) => SwitchMapping: suggests a field per column. An exact name is a high match, a name containing a known word a medium one; each field is used once and the rest are skipped.
SWITCH_SOURCES
constantTasklane (task tracker), Boardly (kanban), Notebase (wiki), Sheetwise (spreadsheet), CSV or Excel and Another Acme workspace, each with counts, a sample export and translated terms.
SWITCH_FIELDS
constantTitle, Status, Assignee, Due date, Priority, Space, Tags, Description and Estimate, with the column names each one matches.
SWITCH_SKIP_FIELD
constant"skip": the field id of a column left behind.
SWITCH_MATRIX
constantNine features (tasks, workflows, comments, attachments, custom fields, docs, automations, people, history) by source.
SWITCH_IMPORT_STAGES
constantThe five stages the import runs through.
SWITCH_TESTIMONIALS
constantNorthwind, Globex and Stark Logistics on their move.
SWITCH_FAQ
constantSix questions about switching: the old tool, links, undo, invites, limits and security.
SWITCH_SAMPLE
constantAll the sample content in one object: sources, fields, matrix, testimonials, faq and stages.
DEFAULT_SWITCH_PAGE_LABELS
constantThe English strings.
DEFAULT_SWITCH_PAGE_HREFS
constantThe default link targets.
SWITCH_PAGE_DESIGNS
constantThe design names, classic first: ["classic", "bold", "minimal"].
SwitchPageProps
typeProps of SwitchPage.
SwitchPageDesign
type"classic" | "bold" | "minimal".
SwitchStep
type"connect" | "map" | "choose" | "import".
SwitchSource
typeOne source tool.
SwitchField
typeOne Acme field a column can map to.
SwitchMatrixRow
typeOne row of the What moves over table.
SwitchImportConfig
typeWhat onImport receives.
SwitchImportOptions
type{ comments, attachments, archived, invites }.
SwitchMapping
typeColumn name to { field, confidence }.
SwitchPageLabels
typeThe strings labels can override.
SwitchPageHrefs
typeThe link targets hrefs can override.
Examples
Bold design
design="bold": a giant start-aligned title on a grid, the visual below it, flat tiles, featured testimonials and FAQ cards.
Minimal design
design="minimal": a transparent header, a centered hero on a soft wash, outlined flat panels, no bands and a simple footer.
CSV import in brand orange
defaultSource csv with tone and ctaTone brand: drop a .csv file, or use the sample data, then map its columns.
Mapping a wiki, embedded
defaultSource notebase on the Map fields step, without the header and footer, as it would sit inside an existing site.
Importer down
An onImport that rejects: go to the last step, start the import and see Try again.
Dependencies
Files
- components/templates/switch-page.tsx
- components/templates/switch-page-data.ts