← Back to articles
April 20269 min read

Building Responsive Web3 Interfaces with Tailwind CSS

Mobile-first responsive design for Web3 apps. Tailwind layout patterns, wallet UI on mobile, responsive tables and charts, dark mode, and accessibility basics.

Tailwind CSSResponsiveWeb3Mobile

Why responsive design is non-negotiable for Web3

Over 60% of wallet connections happen on mobile devices. MetaMask Mobile, Rainbow, Coinbase Wallet, and WalletConnect are mobile-first experiences. A dashboard that only works on desktop loses the majority of its actual users. Responsive design in Web3 is not a nice-to-have — it is a conversion requirement.

Tailwind layout patterns for dashboards

Use Tailwind's responsive prefixes (sm:, md:, lg:, xl:) to build mobile-first layouts. Start with single-column stacks and add grid columns at breakpoints.

// Dashboard grid — stacks on mobile, 3 columns on desktop
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
  <PortfolioCard />
  <TVLChart />
  <RecentTransactions />
</div>

// Sidebar layout — hidden on mobile, visible on desktop
<div className="flex min-h-screen">
  <aside className="hidden w-64 shrink-0 border-r border-white/10 lg:block">
    <Sidebar />
  </aside>
  <main className="flex-1 p-4 md:p-6 lg:p-8">
    {children}
  </main>
</div>

Mobile-first design

Design for 375px first, then enhance for larger screens. This forces you to prioritize content hierarchy and avoid clutter.

// Responsive typography
<h1 className="text-2xl font-bold md:text-3xl lg:text-4xl">Portfolio</h1>
<p className="text-sm text-gray-400 md:text-base">Track your DeFi positions</p>

// Responsive spacing
<section className="space-y-4 p-4 md:space-y-6 md:p-6 lg:p-8">

Wallet UI on mobile

Connect buttons need full width on mobile with generous padding. Wallet modals should be bottom sheets, not centered dialogs.

// Mobile-friendly connect button
<button className="w-full rounded-xl bg-indigo-600 px-6 py-3.5 text-base font-semibold text-white md:w-auto md:py-2.5 md:text-sm">
  Connect Wallet
</button>

// Bottom sheet wallet picker on mobile
<div className="fixed inset-x-0 bottom-0 rounded-t-2xl bg-gray-900 p-6 md:relative md:inset-auto md:rounded-2xl">
  <div className="mx-auto mb-4 h-1 w-12 rounded-full bg-gray-600 md:hidden" />
  {connectors.map((c) => (
    <button key={c.id} className="flex w-full items-center gap-3 rounded-xl p-4 hover:bg-white/5">
      <img src={c.icon} className="h-8 w-8" alt="" />
      <span>{c.name}</span>
    </button>
  ))}
</div>

Responsive dashboard cards, tables, and charts

Cards: full width on mobile, grid on desktop. Tables: horizontal scroll wrapper with sticky first column. Charts: full width, fixed height, touch-friendly tooltips.

// Scrollable table wrapper
<div className="overflow-x-auto rounded-xl border border-white/10">
  <table className="w-full min-w-[600px] text-sm">
    <thead>
      <tr>
        <th className="sticky left-0 bg-gray-900 p-3">Token</th>
        <th className="p-3 text-right">Balance</th>
        <th className="p-3 text-right">Value</th>
        <th className="p-3 text-right">24h</th>
      </tr>
    </thead>
    <tbody>{/* rows */}</tbody>
  </table>
</div>

// Chart container — always full width
<div className="w-full">
  <ResponsiveContainer width="100%" height={280}>
    <AreaChart data={data}>{/* ... */}</AreaChart>
  </ResponsiveContainer>
</div>

Dark mode considerations

Most Web3 users prefer dark interfaces. Use Tailwind's dark: variant or CSS variables for theming.

// tailwind.config.ts
module.exports = {
  darkMode: 'class',
  theme: {
    extend: {
      colors: {
        surface: { DEFAULT: '#0f0f14', elevated: '#1a1a24' },
        border: { DEFAULT: 'rgba(255,255,255,0.1)' },
      },
    },
  },
};

// Component
<div className="bg-surface text-white border border-border rounded-xl p-4">

Respect system preference and offer a manual toggle. Store preference in localStorage.

Accessibility basics

Minimum 44px touch targets. Sufficient color contrast (4.5:1 for text). Do not rely on color alone for status (add icons or text). Use semantic HTML (table, thead, th scope). Add aria-labels to icon-only buttons.

<button aria-label="Copy address" className="p-2.5">
  <CopyIcon className="h-5 w-5" />
</button>

FAQ

**What breakpoint should I design for first?** 375px (iPhone SE/mini). If it works there, it works everywhere.

**How do I test mobile wallet flows?** Use Chrome DevTools device emulation for layout. Test actual WalletConnect flows on a physical phone — emulation cannot simulate deep links.

**Should I use a mobile navigation pattern?** Bottom tab bar for 3–5 main sections on mobile. Hamburger menu only if you have 6+ sections.

**Tailwind vs CSS Modules for Web3?** Tailwind is faster for responsive dashboards. Utility classes keep responsive logic colocated with markup.

Want to work together? I build Web3 dashboards and DeFi interfaces.