Abdulkader Safi

The UI pass: shadcn presets, bigger text and a 390px phone audit

How Private CRM moved onto shadcn components and a new preset, grew its text, made dropdowns searchable, and fixed the pages that scrolled sideways on phones.

6 min read

Share
CRM pipeline board built with shadcn components on desktop and a phone at 390px width

By the afternoon of day one Private CRM worked, and it looked like a starter kit. The UI pass that followed touched almost every page over two days. None of it was one big redesign: it was a run of small commits, each fixing something specific.

Phones first: a 390px audit

The first UI commit came from a design audit at 390px, iPhone width. What it fixed:

  • Header buttons turn into 44px icons on phones. Their text stays as the accessible name.
  • The breadcrumb shows only the current page.
  • The sidebar toggle grew to 44px.
  • Order status tabs hide their counts on phones.
  • The Users and API pages stopped scrolling sideways.
  • Close dates on pipeline cards stay on one line.

An earlier fix set the pattern for overflow bugs. The dashboard's "Needs attention" card pushed its buttons past the edge because its grid column sized itself to the widest deal title. One class fixed it: grid-cols-1 caps the column at the card's width, and the titles truncate.

Onto shadcn components

Next, hand-rolled pieces moved onto shadcn: native selects, checkboxes, sort headers, tag remove buttons and the deal stage steps. Dashboard tooltips, share bars and the order status bar moved onto the shadcn chart and progress components. Hard-coded colours on the error page and logo tiles became CSS variables, with new tokens for them.

The goal was boring: one place to change a colour, and components that already handle focus and keyboard input.

A new preset

Then the whole theme changed. The app switched to shadcn's Mira preset: mist base, cyan theme, Roboto for text and Oxanium for headings. Every icon moved to Tabler, and lucide-react was uninstalled. As part 8 mentioned, the regenerated components lost their right-to-left support, and shadcn's RTL migration brought it back.

A follow-up commit pointed the app's own tokens (brand, money, up, down) at the preset's cyan chart scale and destructive colour instead of old hex values. Charts and stage bars now follow the theme, and so do badges and deltas. Big numbers and record titles use Oxanium.

Bigger, then taller

Two commits that look small and changed how the app feels:

  1. Bigger text everywhere. Each theme size went up one step: 12px to 14px, 14px to 15px, 16px to 17px. The fixed-size numbers grew with them.
  2. Taller controls. Inputs and selects became 36px, as did default buttons, so a search box and the button beside it line up. Tab bars followed, at 36px with 15px labels, and the selected tab took the theme's primary colour.

A CRM is read for hours. Small text looks tidy in a screenshot and tires people out by lunch.

Searchable dropdowns without touching pages

Long selects (owners, companies, currencies) were painful. Instead of swapping components on every page, NativeSelect itself became a popover with a search box. It keeps the same shape as a native select, so every page kept its markup. The search box appears past 7 options and matches anywhere in the label. The pickers for contacts, products and order status moved onto it, and the old Radix select was removed.

Changing one component instead of every call site is the cheapest refactor there is.

The pipeline gets room

The pipeline went through several rounds:

  • A Board and List switch, kept in the URL as view=list. The list sorts by every column and splits into all, open, won, lost.
  • Four headline cards above both views: open pipeline, closing in 30 days, past close date, and won with the win rate.
  • From tablets up the page fits the screen and only the list or each board column scrolls.
  • Columns went to 21rem, about twice as wide, when the board grew to nine stages (part 6).
  • Won and Lost start collapsed as narrow strips with their count and total. They still accept a dropped card, and the browser remembers which are open.
  • A failed move used to do nothing. The card only moves once the server accepts, and now a server error or lost connection shows "Couldn't move ." as a toast.

The code review (part 12) added two accessibility fixes to the Won and Lost toggles: keyboard focus moves to the swapped button, and both carry aria-expanded and a label.

The dashboard got the same fit-to-window treatment: on screens at least 1024px wide and 760px tall it's one grid the height of the window, each card scrolling inside. Shorter screens scroll the page.

The page that was wider than the window

One bug survived all of that. The main area could grow past the window when a page held something wide, like the board, so the whole page scrolled sideways, header included. The fix keeps the main area at the window's width so only the board scrolls. Every page was checked at 1040px and 390px after.

Two related fixes shipped in the same commit. Signing in now replaces the login page in browser history, so going back or swiping from the edge doesn't land on it. And the installed app asks for portrait.

Portrait only, the hard way

"Asks" is the right word. iPhones ignore the manifest's orientation, and no browser tab can lock rotation. So a later commit added an overlay that only appears on short touch screens held sideways:

className="fixed inset-0 z-[100] hidden flex-col items-center justify-center gap-3 bg-background p-6 text-center text-muted-foreground [@media(orientation:landscape)_and_(max-height:500px)_and_(pointer:coarse)]:flex"

pointer:coarse and max-height:500px together mean "a phone on its side". Tablets and laptops never see it. It was checked at 844x390, upright, and on desktop.

Clearing out the starter

The bare address / now redirects to /dashboard, and the starter kit's Welcome page is gone. A cleanup commit removed what it left behind: a terrain shader, images, a WGSL Vite plugin and two GPU packages nothing used.

What I'd copy

Audit at 390px before you polish anything on desktop. Fix overflow by capping the parent, not by hiding the child. And when a component is used everywhere, upgrade the component instead of the pages. I wrote about the tradeoffs in Bootstrap vs Tailwind vs Material UI vs shadcn/ui if you're still picking.

Part 11 puts all of this on a server with one Docker command.

Last updated 4 Dec 2026 · filed under Tailwindcss, shadcn, react, crm, accessibility

Every entry on this project

12 build notes, in order

Including the ones where nothing worked. You are on part 10.

Read the series →

FAQ

Frequently asked questions

Why does my page scroll sideways on mobile?

Usually something inside is wider than the screen and its parent grows to fit it. In Private CRM a dashboard card's grid column sized itself to its widest row, and later the main area grew to the pipeline board's width. Capping the column with grid-cols-1 and keeping the main area at the window's width fixed both, with only the board scrolling.

Can a PWA lock portrait orientation on iPhone?

No. iPhones ignore the manifest's orientation setting, and no browser tab can lock rotation. Private CRM shows a full-screen "Turn your phone upright" message on short touch screens in landscape, using a CSS media query that checks orientation, screen height and pointer type, so tablets and laptops are untouched.

How do you make every select searchable without rewriting pages?

Private CRM rebuilt its NativeSelect component as a popover with a search box, keeping the same props and shape as a native select. Every page kept its markup, the search box appears past 7 options, and matching is contains-based. The old Radix select was removed.

How big should touch targets be?

Private CRM uses 44px for header buttons and the sidebar toggle on phones, matching common touch target guidance. The button text stays as the accessible name when it collapses to an icon, so screen readers still announce it.

Written by

Abdulkader Safi

Software Engineer

Lead engineer at DSRPT, from Lebanon and based in Kuwait. I write about the tools and bugs from real client work, with the numbers I measured.

About me → GitHub LinkedIn

Need this kind of work done on your project?

Start a project →

Keep reading

More from Private CRM: an AI CRM where Claude does the data entry and you make the calls

All 12 entries →