Migrating a custom project

Your app has its own components, years of CSS or an old UI kit. You do not need to know how to move it: a coding agent replaces the whole interface with Koala, deletes everything old, and keeps what your product does.

What you end up with#

  • Every screen drawn with Koala, in your brand.
  • No old stylesheets, overrides, duplicate components or unused packages left in the repo.
  • A clearer structure: one shell, navigation grouped by what people do, and screens that follow the same layouts.
  • The same features, data and business rules as before.
  • A written report of what changed and proof that each part still works.

With a coding agent#

The Koala skill carries this page, so an agent can run the whole migration. Install the skill in your project, then start a new session.

npx koalaui-cli@latest skill

Then ask for the audit first:

Migrate this whole project to Koala UI and leave nothing of the old UI behind.Follow references/migrate.md in the koala-ui skill.Explain everything in plain language: I am not an expert.Start with the audit and write the plan to koala-migration.md.Change nothing until I approve it.

The agent makes the technical decisions and proposes a better structure for your product. It only stops for yours: approving the plan and that structure, choosing on Pro items, and accepting the result. The plan lives in your repo, so a later session picks up where the last one stopped. Cursor, Codex and other agents need one line pointing at the skill, see AI and agents.

If you are the agent#

  • Lead. Assume the owner cannot judge technical options. Decide them, and put only product and money decisions to the owner, in plain words, one at a time.
  • Finish. The job is done when Step 7 passes, not when the new screens look right.
  • Improve the structure. A structure that grew by accident is part of the problem. Propose a better one with reasons, then build what the owner approves.
  • Delete only code. Old interface code goes. Never delete data, uploads, database migrations, environment files, or backend and business logic.
  • Stay on the branch. Work and commit on koala-migration. Merging and deploying belong to the owner.
  • Report the truth. If a check fails or something cannot be moved, say so in the plan and to the owner. Never skip or weaken a test to continue.

Before you start#

You needIf you do not have it
React 19Upgrade React first, as its own change.
Tailwind CSS v4Upgrade from v3 first. On a project without Tailwind, add it, then read Keeping both working below.
The @/* path aliasAdd it to tsconfig.json, and to vite.config.ts in Vite. init checks it.
Next.js or Viteinit detects both. Anywhere else it prints the steps to wire by hand.
GitPut the project in git first, even if it never was. Every deletion must be recoverable.
A koala-migration branchCommit or stash everything else first. The running product stays untouched until the owner merges.

Old software#

An app from years ago rarely meets those requirements. Bring the foundations up first, one commit each, and confirm the app still runs before any screen changes.

If it hasDo this first
React 15 to 18Upgrade one major version at a time, each as its own commit. React 19 removes ReactDOM.render, findDOMNode, string refs and legacy context. Class components still work.
Create React App, Gulp, Grunt, an old webpackMove the build to Vite, and keep the routes and environment variables.
Plain JavaScriptAdd TypeScript with allowJs. Old files keep working, and Koala's components arrive typed.
An old Node versionMove to the current LTS first. Old build tools often break here, so fix them in this step.
Tailwind v1 or v2Move to v3 first, then run npx @tailwindcss/upgrade to reach v4.
Tailwind v3Run npx @tailwindcss/upgrade to reach v4.
Bootstrap, jQuery UI, an old Material-UIReplaced surface by surface, then removed with their stylesheets and themes.
jQuery in the pagesList what each script does, rebuild it as React state or a Koala component, then delete the script.
Sass, Less, global CSSReplaced by tokens and Tailwind. Every stylesheet is deleted by the end.
AngularJS, Vue, Backbone, or pages rendered by PHP, Rails or similarKoala is React, so this is a rebuild of the interface. A new Vite or Next.js app replaces it screen by screen, on the same backend. Say so clearly before planning, with what it means for time and cost.

Protect what works#

Old projects often have no tests, so nothing would catch a break. Before the first change:

  1. Tag the start. Run git tag koala-migration-start, so the original can always be recovered.
  2. Capture every screen. Screenshot each route at desktop and phone width, signed in and signed out, into koala-migration/before/.
  3. List what people do. Write the main flows in koala-migration.md, such as signing in, creating a record or taking a payment, and have the owner confirm the list.
  4. Add smoke tests. Cover those flows with Playwright against the old interface, selecting by role and text so the same tests still pass on the new one.

Step 1: Audit#

Read the project before touching it, and record what you find:

  • The stack. Framework, React and Tailwind versions, the styling method (CSS Modules, Sass, styled-components, Emotion, a kit such as MUI, Chakra, Ant or Bootstrap), and the checks the project has: tests, type checking, lint, build.
  • The surfaces. Every reusable UI component, or every kit component in use, with how many files import it. Usage count sets the order.
  • The structure. The kind of product, each screen’s regions and their order, how navigation works, what scrolls, what happens on small screens, and whether it runs on touch.
  • The brand. The primary color, neutrals, radius, fonts and any dark mode, read from the existing tokens or the most repeated values.
  • What is yours. Domain components that mean something only in this product, such as a shipment timeline or a seat map. They stay as features, rebuilt from Koala parts and tokens, and their old CSS goes.
  • The leftovers. Every stylesheet, !important, inline style, CDN script, vendored file in public/, duplicate component and class name built from strings. This list is what Step 7 has to bring to zero.

Step 2: Plan#

Write koala-migration.md at the project root and get it approved before any code changes. Each surface gets its Koala counterpart from the maps below, its tier from npx koalaui-cli@latest list, and a place in the order. Anything with no counterpart is rebuilt from Koala parts and tokens.

koala-migration.mdText
# Koala migrationStack: Next.js 16, React 19, Tailwind 3, CSS ModulesBlockers: Tailwind 3 to 4## BrandPrimary #0f766e, radius 12px, Inter## StructurePoint of sale on a touch screen: density compact, controls size lgRegions: top nav, open tickets, product grid, ticket panelProblems: 8 top-level items, clock-in and messages mixed with sales, cart scrolls awayProposal: Sell, Tickets, Customers, Inventory, Till; the rest under the profile menuShell: LayoutTopbar + Navbar (Pro, ask), three LayoutPane columns, Charge always in viewDecision: approved by the owner, on the sell screen the columns keep their order## Surfaces, in order- [ ] Button (41 uses): src/components/Btn.tsx > Button- [ ] Text field (18 uses): src/components/Input.tsx > Input, Field- [ ] Modal (6 uses): src/components/Modal.tsx > Dialog- [ ] Data grid (3 uses): react-table > Data Table (Pro, ask)## Domain featuressrc/components/CashCount.tsx: rebuilt from Koala parts## Flows to protectSign in, open the till, sell, refund, close the till## Leftovers to clear12 stylesheets, 340 !important, jQuery from a CDN, Bootstrap 3

Mark every Pro item and let the project’s owner choose: buy a license, compose the free components, or keep what exists. Never rebuild a Pro component from its docs or preview.

Old software grows by accident: menus nobody ordered, screens that each work differently. Replacing the pieces alone would give you the same confusion in a better paint, so the plan also proposes a new structure, for the owner to approve. For each screen it records what is there today, what is wrong with it and what replaces it:

  • One shell. Pick one app structure from Step 6 and use it everywhere, instead of a different frame per screen.
  • Navigation by task. Group items by what people do, not by how the code or the company is organized. Keep the top level to about seven items, and move settings and account actions under a profile menu.
  • Repeated screens, one layout. Every list, detail, form and settings page follows the same layout, with one page header and one primary action.
  • The main action in view. What people do all day stays on screen and within reach, on every size the product supports.
  • The missing states. Plan empty, loading and error states, which old screens rarely have.

Show the proposal in plain language, with the worst screen as a before and after, and ask what people rely on. A tool used all day needs a lighter hand: habits are worth protecting, so move rarely used items out of the way and keep the positions people work from by memory. The owner can approve all of it, part of it, or keep the structure as it is.

Step 3: Set up the foundation#

init adds koala.css, lib/utils.ts, lib/tv.ts, the theme provider and koala.json, and leaves your components alone. Follow the steps it prints for the fonts and the provider, and resolve every warning it gives.

# Tokens, the lib helpers and the theme providernpx koalaui-cli@latest init# Only if the plan uses Pro componentsnpx koalaui-cli@latest login <your-key># The free components the plan needsnpx koalaui-cli@latest add button input field dialog

If you already have a lib/utils.ts, init keeps it. Merge Koala’s version in with npx koalaui-cli@latest diff utils: lib/tv.ts imports twMergeConfig from it. If you have a components/ui/button.tsx of your own, add skips that file and keeps yours, with only a warning. Move those files to components/legacy/ before the first add, update their imports, and commit that on its own.

Step 4: Bring your brand#

Set your brand once, on the tokens, before swapping any component. After that every Koala component arrives in your colors. Put this after the import of koala.css:

globals.cssCSS
:root {  --brand: #0f766e;  --radius: 0.75rem;}

A light brand color also needs a dark --brand-foreground. Load your fonts as --font-sans and --font-heading. An app with one look pins it with <ThemeProvider forcedTheme="light">. For a palette of your own, see Theming.

Step 5: Swap one surface at a time#

  1. Start at the bottom. Buttons and text fields first, then overlays, then the pieces inside navigation. Each layer leans on the one before it, and the shell comes last.
  2. One surface, one commit. Add the component, read its reference, replace every use, and run the project’s checks and the smoke tests before moving on.
  3. Delete as you go. In the same commit, remove the old component, its styles and every override aimed at it. Search for its name and its CSS classes first, including strings built at runtime. Do not leave a wrapper around Koala that keeps the old name.
  4. Translate props, keep behavior. Handlers, validation, disabled conditions and analytics stay exactly as they were. Screens only move as the approved structure says.
  5. Rebuild the domain features. Compose them from Koala parts, and replace hard-coded colors and radii with the map below, so they follow the themes too.
  6. Tick it off. Update koala-migration.md. When a step fails its checks, fix it or stop and say so: never skip a test to move on.

Step 6: Move the structure#

With the pieces in place, build the approved structure, one screen at a time. What the structure is follows from the parts you drop in. Layout and its Navbar and Sidebar are Pro. Without a license, build the free column with Tailwind between Koala components.

In your projectWith Layout (Pro)With the free components
Top navigation over the contentLayoutTopbar with Navbar, then LayoutContentA header with Link or Button, and Tabs for the sections.
Side navigationLayoutSidebar with Sidebar, then LayoutContentA flex row with a ScrollArea column of Buttons.
Top bar over a side railLayoutTopbar, LayoutBody, LayoutSidebarThe two above, nested.
Icon rail plus a second columnLayoutRail, LayoutSidebarTwo fixed columns, with Tooltip on the icons.
Columns side by side: inbox, list and detail, point of saleLayoutPane and LayoutPaneHeaderA CSS grid with one ScrollArea per column.
Columns the user can resizeResizableFixed widths.
Page title with actionsPageHeader, PageHeaderActionsA flex row with a heading and Buttons.
Sign-in or onboarding splitSplitLayout, SplitPane, SplitMediaA two-column grid.
Phone navigationLayoutMobileBar, LayoutMobileSidebarDrawer behind a menu Button.
  • Lose nothing. Every feature stays reachable, with its permission checks and badge counts. When a URL changes, the old one redirects to the new one, so bookmarks keep working.
  • Set the density once. compact for an app shell, comfortable for a marketing page, with a DensityProvider around the subtree. See Density.
  • Size for the hand. Density tunes spacing, not control height. On a touch screen, pass size="lg" to the controls people hit all day.
  • Keep the language. Components say a few words on their own, such as Close or Next. In an app that is not in English, set them once with Translations, then check every screen for English left behind.
  • Keep what scrolls. A column that scrolled alone still does, and the action that was always in view stays in view. Check it at the smallest screen the product supports.

Component map#

What most projects have, whatever it is called there. Every Koala name links to its page, and the skill holds the same page as a reference for each free component.

In your projectKoala UIWatch for
Buttons, icon buttonsButtonPick variant="primary" once per screen. The default size is md.
Text linksLinkdefault for chrome, prose inside sentences.
Text fields, labels, errorsInput, FieldKeep the form library. Field wires the ids and the error.
Checkboxes, radios, switchesCheckbox, Radio Group, SwitchonCheckedChange or onValueChange receive the value, not an event.
SelectsSelect, Native Select, ComboboxNative Select when the OS list is better, Combobox when the list needs filtering.
ModalsDialogDelete hand-rolled focus traps and scroll locks. Radix owns them now.
Side panelsDrawerBlocks the page. Use Sheet for one that stays open over a canvas.
MenusDropdown Menu, Context MenuKeep each item's handler as it is.
Tooltips, popoversTooltip, PopoverHints in Tooltip, anything interactive in Popover.
Toasts, snackbarsToastOne provider near the root, then one call per message.
Banners, inline errorsAlertFive semantic variants.
Tabs, accordionsTabs, AccordionKeep URL-synced tabs controlled.
Status tagsBadgeSoft tints from the status roles.
Spinners, skeletonsSpinner, SkeletonA loading button takes loading, not a spinner child.
Tables, data gridsData TablePro. Keep your query and sorting logic.
Date pickersDate PickerPro.
ChartsChartPro. Without a license, keep the chart library and color it with tokens.
Touch number pads, on-screen keyboardsKeypad, On-Screen KeyboardPro. For a screen with no physical keyboard.

Token map#

Hard-coded todayKoala tokenNotes
Brand colorbg-brand, text-brand, --brandOne value recolors every brand surface.
Page backgroundbg-backgroundbg-canvas for the back layer of an app shell.
Card or panel fillbg-card, bg-popoverOnly on surfaces that are raised. In-flow containers paint no fill.
Main texttext-foregroundHeadings and labels.
Long reading copytext-bodyParagraphs.
Secondary texttext-muted-foregroundMeta and captions.
Bordersborder-border, border-inputborder-input around controls.
Error, success, warning, infodestructive, success, warning, infoA soft tint is bg-success/10 text-success-strong.
Border radiusrounded-sm to rounded-2xlAll driven by --radius.
Shadowsshadow-xs to shadow-xlTuned per theme.
Transitionsduration-fast, duration-base, ease-outName the property: transition-colors, never transition-all.

Keeping both working#

  • Unlayered CSS wins. Tailwind’s utilities live in a cascade layer, so a global button { }, a { } or * { } rule in your old stylesheet beats every Koala class. Scope those rules to the old components, or move them into @layer base.
  • Tailwind resets the page. On a project that had no Tailwind, its base styles strip the default look from headings, lists and links. Check the old pages right after adding it.
  • Token names can collide. init warns about your own --background, --foreground and --radius. Rename yours or remove them, or they override Koala’s themes.
  • A kit’s theme provider stays until its last component is gone. It can wrap the same tree as Koala’s ThemeProvider.

All of this is temporary: side by side is how the migration runs, never how it ends.

Step 7: Leave nothing behind#

The migration ends when every line below is true. Work through them in order.

  1. Delete the old interface. components/legacy/, old stylesheets, themes, icon fonts, images no screen uses, and vendored files in public/.
  2. Delete what overrode it. !important rules, global element selectors, and className overrides that only existed to fight the old look.
  3. Remove the packages. The old kit, jQuery and its plugins, Sass, old build tools and icon libraries, from package.json and the lockfile. Remove their CDN tags too.
  4. Remove the scaffolding. Compatibility wrappers, feature flags for the old interface, unused exports and dead routes.
  5. Prove it. Run the commands below, the project’s checks, the smoke tests and a production build. Then capture every screen again into koala-migration/after/ and compare it with before/.
  6. Report. Add to koala-migration.md what was removed, what is left and why, and how to go back. Keep koala.json in git: diff and update use it to bring in fixes. Then ask the owner to review the branch.
# Unused files, exports and packagesnpx knip# Styles that fight the system: fix every hit, or note why it staysgrep -rnE '!important|style=\{\{' src app components --exclude-dir=ui# Scripts and stylesheets still loaded from outsidegrep -rnE '<(script|link)[^>]+https?://' index.html public app src# Koala's own files, untouchednpx koalaui-cli@latest diff

FAQ#

Yes. Paste the prompt at the top of this page into your coding agent. It does the technical work, explains what it finds in plain language and only asks you about your product.