Designing the UI Kit
I'm currently focused on the framework's core structure, aiming for a mobile-first responsive design. The goal is crafting a set of utility classes and components that are both intuitive and flexible. I'm exploring BeerCSS's existing implementation to ensure optimal integration with Material Design 3 principles. The focus now is on creating a solid foundation for easy customization and broader application.
Investigating BeerCSS Features
I've been diving into BeerCSS to understand its specific implementation of Material Design 3. Key features like semantic HTML and dynamic theming are particularly intriguing. The mobile-first design philosophy is clear, and I'm noting how bottom navigation and large touch targets are handled. Next, I'll map this understanding to my own UI kit's structure. I'm starting the documentation by explaining simple setup steps.
Developing Color Schemes and Layout
I'm now focusing on the crucial aspects of theming and layout. The goal is crafting variable colors for the Material You paradigm, including the primary color and dark mode toggle. I plan to use a body.dark structure to define the dark theme. The layout will include a Top App Bar and Bottom App Bar for mobile, mirroring classic mobile patterns.
Crafting Navigation & Layout
I'm now thinking about the application's core visual structure. Top navigation will feature a burger menu, title, and profile, while the bottom will house home, search, and settings. A side drawer will be necessary for responsiveness. The grid system will also become more important, defining the transformation from a single column to 2/3 columns. I'm focusing on ensuring all interactive elements are easily tappable.
Structuring the Showcase
I'm now organizing the UI kit's output as a single "Showcase" HTML file. This will highlight key patterns and provide customization CSS tips. I'm breaking down specific BeerCSS classes, categorizing them logically for easier understanding. This includes Typography, Elements, and Containers. Also, responsive design considerations are a key focus for this showcase.
This is a complete, responsive UI Kit designed using BeerCSS. It focuses heavily on Mobile-First principles (Thumb-friendly navigation, card-based layouts, and adaptive grids) while scaling up gracefully to desktop.
BeerCSS is unique because it relies heavily on semantic HTML tags (<article>, <nav>, <header>) rather than complex class chains.
1. The Foundation (Setup)
First, here is the boilerplate code required to run the kit. It includes the BeerCSS CDN links and the Google Material Symbols font.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BeerCSS Mobile UI Kit</title>
<!-- Material Symbols -->
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" />
<!-- BeerCSS -->
<link href="https://cdn.jsdelivr.net/npm/beercss@3.5.1/dist/cdn/beer.min.css" rel="stylesheet">
<script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.5.1/dist/cdn/beer.min.js"></script>
</head>
<!-- "dark" class can be toggled for themes -->
<body class="light">
<!-- UI Kit Content Goes Here -->
</body>
</html>
2. The UI Kit Components
Here is a comprehensive breakdown of the UI elements designed for mobile usability.
A. Navigation Architecture (Mobile-First)
This layout uses a Top Bar for branding and actions, and a Bottom Navigation Rail which is the standard for modern mobile UX (easier reach for thumbs).
<!-- TOP APP BAR -->
<nav class="top">
<button class="circle transparent" data-ui="#drawer-menu">
<i>menu</i>
</button>
<h5 class="max center-align">My App</h5>
<button class="circle transparent">
<img src="https://i.pravatar.cc/100" alt="Profile" class="responsive">
</button>
</nav>
<!-- SIDE DRAWER (Hidden on mobile, toggleable) -->
<dialog id="drawer-menu" class="left">
<nav class="drawer">
<header>
<h6>Menu</h6>
</header>
<a class="active"><i>home</i><span>Home</span></a>
<a><i>explore</i><span>Explore</span></a>
<a><i>settings</i><span>Settings</span></a>
</nav>
</dialog>
<!-- BOTTOM NAVIGATION (Sticks to bottom on mobile) -->
<nav class="bottom">
<a class="active">
<i>home</i>
<span>Home</span>
</a>
<a>
<i>search</i>
<span>Search</span>
</a>
<a>
<i>shopping_cart</i>
<div class="badge">3</div>
<span>Cart</span>
</a>
</nav>
B. The Grid (Responsive Content)
BeerCSS uses a 12-column grid.
s12: Full width on Small screens (Mobile).
m6: Half width on Medium screens (Tablets).
l4: One-third width on Large screens (Desktop).
<main class="responsive">
<div class="grid">
<!-- SUMMARY CARD inside grid -->
<div class="s12 m6 l4">
<article class="no-padding">
<img src="https://picsum.photos/400/300" class="responsive">
<div class="padding">
<h5>Mobile Card</h5>
<p>This card takes full width on mobile but shrinks on desktop.</p>
<nav>
<button>Read More</button>
<button class="border">Share</button>
</nav>
</div>
</article>
</div>
<!-- STATS WIDGETS -->
<div class="s12 m6 l4">
<article class="row">
<i class="large primary-text">analytics</i>
<div class="max">
<h5>1,204</h5>
<p>Active Users</p>
</div>
</article>
<article class="row">
<i class="large error-text">warning</i>
<div class="max">
<h5>3 Issues</h5>
<p>Requires attention</p>
</div>
</article>
</div>
</div>
</main>
C. Form Elements (Large Touch Targets)
Inputs in BeerCSS are styled as Material Design 3 fields (floating labels) with large hit areas for fingers.
<div class="grid">
<div class="s12">
<h5>Settings</h5>
<!-- Text Field -->
<div class="field label prefix border">
<i>person</i>
<input type="text">
<label>Username</label>
</div>
<!-- Text Area -->
<div class="field label textarea border">
<textarea></textarea>
<label>Bio</label>
</div>
<!-- Switch -->
<div class="row">
<div class="max">
<h6>Dark Mode</h6>
<p>Toggle app theme</p>
</div>
<label class="switch">
<input type="checkbox" onclick="ui('mode', this.checked ? 'dark' : 'light')">
<span></span>
</label>
</div>
<!-- Slider -->
<div class="field label">
<input type="range" min="0" max="100" value="50">
<label>Volume</label>
</div>
</div>
</div>
D. Action Components & Feedback
Chips, Toasts, and Dialogs optimized for mobile contexts.
<!-- FAB (Floating Action Button) -->
<!-- Usually placed outside the grid, fixed position -->
<button class="extend square fixed bottom right m" style="margin-bottom: 80px;">
<i>add</i>
<span>New Item</span>
</button>
<!-- CHIPS -->
<div class="row scroll">
<button class="chip fill primary">All</button>
<button class="chip border">Unread</button>
<button class="chip border">Favorites</button>
<button class="chip border">Archived</button>
</div>
<!-- DIALOG TRIGGER -->
<button class="fill" data-ui="#modal-example">Open Modal</button>
<dialog id="modal-example" class="modal bottom">
<!-- "bottom" class makes it a bottom-sheet on mobile -->
<h5>Mobile Action Sheet</h5>
<p>This dialog slides up from the bottom on mobile, acting as an action sheet.</p>
<nav class="right-align">
<button class="transparent" data-ui="#modal-example">Cancel</button>
<button class="confirm" data-ui="#modal-example">Confirm</button>
</nav>
</dialog>
3. Complete "Showcase" Page
Here is the code tied together into a functional prototype. Copy and paste this into an index.html file to see the UI kit in action.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BeerCSS Mobile UI Kit</title>
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/beercss@3.5.1/dist/cdn/beer.min.css" rel="stylesheet">
<script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.5.1/dist/cdn/beer.min.js"></script>
<style>
/* Custom overrides for the demo */
:root {
--primary: #6200ee;
--on-primary: #ffffff;
--radius: 16px; /* Softer corners for mobile */
}
/* Spacer for bottom nav visibility on mobile */
main {
padding-bottom: 80px;
}
</style>
</head>
<body class="light">
<!-- TOP BAR -->
<nav class="top primary">
<button class="circle transparent" data-ui="#drawer">
<i>menu</i>
</button>
<h5 class="max center-align">Dashboard</h5>
<button class="circle transparent">
<i>notifications</i>
</button>
<button class="circle transparent">
<img src="https://www.w3schools.com/howto/img_avatar.png" class="responsive">
</button>
</nav>
<!-- SIDE DRAWER -->
<dialog id="drawer" class="left">
<nav class="drawer">
<header>
<img src="https://www.w3schools.com/howto/img_avatar.png" class="circle">
<h6>John Doe</h6>
<p>User Profile</p>
</header>
<a class="active"><i>dashboard</i><span>Overview</span></a>
<a><i>favorite</i><span>Favorites</span></a>
<div class="divider"></div>
<a><i>settings</i><span>Settings</span></a>
</nav>
</dialog>
<!-- MAIN CONTENT -->
<main class="responsive">
<!-- Horizontal Scrollable Chips (Mobile Pattern) -->
<div class="row scroll no-scrollbar">
<div class="chip fill primary">Overview</div>
<div class="chip border">Analytics</div>
<div class="chip border">Reports</div>
<div class="chip border">Exports</div>
<div class="chip border">Archive</div>
</div>
<div class="grid">
<!-- WIDGETS -->
<div class="s6 m3">
<article class="center-align middle-align">
<i class="extra primary-text">visibility</i>
<h6>24k</h6>
<p class="small-text">Views</p>
</article>
</div>
<div class="s6 m3">
<article class="center-align middle-align">
<i class="extra tertiary-text">download</i>
<h6>128</h6>
<p class="small-text">Downloads</p>
</article>
</div>
<!-- MAIN CARD -->
<div class="s12 m6">
<article>
<div class="row">
<img src="https://picsum.photos/id/20/100" class="circle large">
<div class="max">
<h5>Project Alpha</h5>
<p>Development Phase</p>
</div>
</div>
<div class="space"></div>
<p>The project is moving along nicely. The mobile responsiveness is key to our Q4 strategy.</p>
<nav>
<button>Details</button>
<button class="border">Edit</button>
</nav>
</article>
</div>
<!-- FORM ELEMENTS -->
<div class="s12 m6">
<article>
<h5>Quick Update</h5>
<div class="field label border">
<input type="text">
<label>Title</label>
</div>
<div class="field label border textarea">
<textarea></textarea>
<label>Message</label>
</div>
<nav class="right-align">
<button class="transparent">Clear</button>
<button class="primary">Send</button>
</nav>
</article>
</div>
<!-- LIST VIEW -->
<div class="s12">
<article class="no-padding">
<h6 class="padding">Recent Activity</h6>
<a class="row wave">
<i class="circle fill secondary">inbox</i>
<div class="max">
<h6>New Email</h6>
<p>You received a message from Support</p>
</div>
<span>10m</span>
</a>
<div class="divider"></div>
<a class="row wave">
<i class="circle fill tertiary">paid</i>
<div class="max">
<h6>Payment Received</h6>
<p>Invoice #1024 has been paid</p>
</div>
<span>1h</span>
</a>
</article>
</div>
</div>
</main>
<!-- FAB -->
<button class="fixed bottom right extend" style="margin-bottom: 90px;">
<i>add</i>
<span>New</span>
</button>
<!-- BOTTOM NAVIGATION -->
<nav class="bottom">
<a class="active">
<i>dashboard</i>
<span>Dash</span>
</a>
<a>
<i>search</i>
<span>Search</span>
</a>
<a>
<i>person</i>
<span>Profile</span>
</a>
</nav>
</body>
</html>
Design Explanation
- Layout: I used
nav.top for global context and nav.bottom for primary navigation. This is the standard "App" feel.
- Class
.row.scroll: This is crucial for mobile. It creates a horizontal scrolling container (swipeable), perfect for filters/chips when you don't have screen width.
- Dialogs as Bottom Sheets: By adding the class
bottom to the <dialog> element, BeerCSS automatically treats it as a bottom sheet on mobile devices (sliding up from the bottom) and a standard modal on desktop.
- Grid System (
s12 m6): The widgets stack vertically (100% width) on mobile for clarity but form a dashboard grid on tablets/desktops.
- Touch Targets: The lists use the
wave class which adds a ripple effect and ensures the row is large enough to be tapped easily.