Using a UI Framework

The previous page showed how to hand-roll simple SPA-style navigation with plain divs and a small router function. That works, but as an app grows — more screens, tab bars, sliding side menus, list views with swipe actions — writing and maintaining all of that yourself in plain HTML/CSS gets expensive fast. This is where a dedicated UI framework earns its keep.

Why Plain HTML/CSS Often Isn't Enough

A mobile app UI has expectations a typical website doesn't: touch targets sized for fingers rather than mouse pointers, components that feel and animate the way the platform's own native apps do, and standard navigation patterns (tab bars, slide-in menus, list-to-detail transitions) that users already intuitively understand. Building all of this from scratch with hand-written CSS is possible, but it means re-solving problems that are already solved — and getting the small details (tap feedback, momentum scrolling, platform-correct spacing) right takes real, ongoing effort.

Option 1: Bootstrap

Since Bootstrap is already covered in depth on this site's own Bootstrap track, it's a very approachable option if you already know it — its grid system, buttons, forms, modals, and navbars all work perfectly well inside a Cordova WebView with zero special setup, since it's just CSS and JavaScript like anything else in your www/ folder.

Note: Bootstrap's components are designed to look consistent and professional on a website, viewed on any device — they are not styled to mimic native iOS or Android UI conventions. A Bootstrap navbar looks like a Bootstrap navbar on both platforms, not like a native iOS tab bar on iPhone and a native Android bottom navigation bar on Android. For many utility or content-driven apps this is perfectly fine; for an app meant to feel indistinguishable from a truly native one, it falls short.

Option 2: A Mobile-Native Hybrid UI Framework

For apps that need to feel truly native, two frameworks have historically been the most common choices built specifically for hybrid apps like Cordova's: Framework7 and Onsen UI. Both provide ready-made components styled to automatically match iOS's or Android's native look and feel depending on which platform the app is running on — tab bars, navigation bars with the platform-correct back button style, native-feeling list views, action sheets, and side panels — none of which plain Bootstrap replicates out of the box.

FrameworkKnown For
Framework7iOS- and Android-styled components, a built-in SPA router with page transitions and history handling, common in Cordova and Capacitor apps
Onsen UISimilarly native-styled components (tabs, navigator, lists), works with plain JavaScript or alongside frameworks like Angular/React/Vue

Full Worked Example: Framework7-Style Page Structure

Framework7 (and similarly-shaped frameworks) organize a screen as a .page containing a .navbar and a .page-content. This is illustrative markup showing the general shape of that structure — you don't need Framework7 actually installed to follow the idea:

<div class="page">
    <!-- The navbar shows the screen's title and back button, styled per-platform -->
    <div class="navbar">
        <div class="navbar-bg"></div>
        <div class="navbar-inner">
            <div class="title">Product Details</div>
        </div>
    </div>

    <!-- The scrollable body of the screen -->
    <div class="page-content">
        <div class="list">
            <ul>
                <li>Price: $49.99</li>
                <li>In stock: Yes</li>
            </ul>
        </div>
    </div>
</div>
Note: This markup shows the general shape a Framework7-style page takes, not a copy-paste-ready snippet — actually using Framework7 requires installing it (its CSS/JS bundle) and initializing its app object in JavaScript, which is beyond what this illustrative example covers. The point here is the structural idea: a distinct navbar and a distinct scrollable content area per screen, which the framework's router swaps in and out SPA-style, complete with back-button handling and platform-correct transition animations already built in.

The Tradeoff: Bigger App, More Polish

Adding a full hybrid UI framework is not free. It's worth weighing both sides honestly before committing:

What You Get / Give Up
CostA larger final app size (more CSS/JS to bundle and ship), and one more third-party dependency you need to keep updated as the framework itself evolves
PayoffA dramatically more polished, native-feeling result — platform-correct components, built-in SPA routing with history and back-button handling, and animations — for far less custom CSS than building the same thing by hand

For a small internal tool or a simple content app, plain Bootstrap (or even plain hand-rolled CSS, as shown on the previous page) is often good enough and keeps things simple. For a consumer-facing app where "feels native" genuinely matters to your users, a framework like Framework7 or Onsen UI is very likely worth its cost.

Next steps: Head to Debugging Cordova Apps to learn how to inspect and troubleshoot your app once it's running on a device or emulator.