Ballmac UI home

Android Frame

A modern Android phone drawn in CSS: satin frame in porcelain, obsidian or sage, centered punch-hole camera, Material-style status bar and gesture or three-button navigation. Children render at phone resolution, scaled to fit.

Right-to-left: Hardware buttons and bezels sit on fixed physical edges of the device, so the frame keeps its shape; the screen content you place inside follows the page direction.

9:41

9:41

Thu, Oct 1 · 18°C

Search apps and the web

Design review

10:30 · Room 4B

Phone
Messages
Browser
Camera
Gmail
Maps
Music
Settings

Installation

$ pnpm dlx shadcn@latest add @ballmac/android-frame

Usage

import { AndroidFrame } from "@/components/ballmac/android-frame"

The full example is in the Code tab above.

Examples

Three-button navigation

9:41

Settings

Search settings
  • Network & internetWi-Fi, mobile, data usage
  • Connected devicesBluetooth, pairing
  • Battery82% · about 1 day left
  • DisplayDark theme, font size

API reference

PropTypeDefault
children

Screen content, laid out below the status bar. Ignored when `src` or `videoSrc` is set.

React.ReactNode—
variant

Finish of the frame. "auto" is porcelain in light mode and obsidian in dark mode.

"auto" | "porcelain" | "obsidian" | "sage""auto"
src

Image shown on the screen, cropped to fill it.

string—
alt

Alternative text for `src`.

string""
videoSrc

Video shown on the screen: muted, looping, and paused under reduced motion.

string—
poster

Poster image for `videoSrc`.

string—
screenWidth

Width in CSS pixels that the screen content is laid out at (412 matches a 6.3" phone); it is then scaled to fit. Omit to lay content out at the frame's actual size.

number—
statusBar

Show the status bar (time, signal, Wi-Fi, battery).

booleantrue
time

Time shown in the status bar.

string"9:41"
navigation

System navigation: the gesture pill, three buttons, or nothing.

"gesture" | "buttons" | "none""gesture"
screenClassName

Class names for the screen element (inside the bezel). Use "dark" to give the screen its own theme.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
StaticPurely visual: no focusable elements from the frame
Reduced motionVideo on the screen is not autoplayed

Quality scorecard

5/5

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 2 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    No endless animation to begin with.

  • Not applicable: Right to left

    Not mirrored by design: Hardware buttons and bezels sit on fixed physical edges of the device, so the frame keeps its shape; the screen content you place inside follows the page direction.

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Not applicable: Keyboard

    Static content: nothing to focus.

  • Not applicable: Loading, empty and error

    Does not show data or take submissions.

  • Passed: Automated tests

    Covered by android-frame.test.tsx.

  • For information: Footprint

    3.0 KB of source (gzip) in 1 file. Installs motion.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Use with AI

Wrap a mobile screen in <AndroidFrame screenWidth={412}>: children render below a status bar at 412 CSS px wide and are scaled to the frame's width. Set the width with className (e.g. w-64). With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Android Frame (@ballmac/android-frame) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing an Android or responsive mobile app
  • Side by side with phone-frame for cross-platform stories

Not for

  • iPhone mockups (phone-frame)
  • Real device screenshots with a bezel

Registry JSON: https://ui.ballmac.com/r/android-frame.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

311 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.