A retro 8-bit UI component library for SwiftUI, inspired by 8bitcn-ui.
- 🎮 13 Retro Themes: Default, Gameboy, Sega, Nintendo, Atari, Arcade, Neo Geo, Soft Pop, VHS, Pacman, Cassette, Rusty Byte, Zelda
- 🧩 6 Core Components: Button, Card, TextField, Badge, ProgressBar, Alert
- 🔤 Bundled Pixel Font: Press Start 2P font included
- 🌓 Dark Mode Support: All themes have light and dark variants
- 📱 iOS 18+: Built for the latest SwiftUI features
| Home Screen | Components |
|---|---|
![]() |
![]() |
Add the package to your Xcode project:
- File → Add Packages...
- Enter the repository URL
- Select "EightBit-SwiftUI"
Or add to your Package.swift:
dependencies: [
.package(url: "https://github.com/your-username/EightBit-SwiftUI", from: "1.0.0")
]import SwiftUI
import EightBitSwiftUI
@main
struct MyApp: App {
init() {
// Register fonts at startup
EightBitFonts.registerFonts()
}
var body: some Scene {
WindowGroup {
ContentView()
.eightBitTheme(.gameboy)
}
}
}ContentView()
.eightBitTheme(.gameboy).default // Clean monochrome
.gameboy // Classic green LCD
.sega // Blue/purple Sega style
.nintendo // Red/purple Nintendo style
.atari // Warm orange/brown
.arcade // Neon pink/blue
.neoGeo // Warm orange/red
.softPop // Pastel colors
.vhs // Retro pink/purple CRT
.pacman // Classic yellow/blue
.cassette // Warm analog tape
.rustyByte // Industrial rust
.zelda // Green and goldEightBitButton("Start Game", variant: .primary, size: .medium) {
// Action
}
// Variants: .primary, .secondary, .destructive, .outline, .ghost
// Sizes: .small, .medium, .largeEightBitCard {
EightBitCardHeader {
EightBitCardTitle("Quest Log")
EightBitCardDescription("Your active quests")
}
EightBitCardContent {
Text("Content here")
}
EightBitCardFooter {
EightBitButton("Action") {}
}
}@State private var name = ""
EightBitTextField("Enter name...", text: $name)
EightBitLabeledTextField("Player Name", placeholder: "Hero", text: $name)EightBitBadge("NEW")
EightBitBadge("RARE", variant: .secondary)
EightBitBadge("DANGER", variant: .destructive)
EightBitBadge("QUEST", variant: .outline)// Health/Mana/XP style bars
EightBitProgressBar(value: 0.75, style: .health, showLabel: true)
EightBitProgressBar(value: 0.6, style: .mana)
EightBitProgressBar(value: 0.45, style: .xp)
// Labeled version
EightBitLabeledProgressBar("HP", value: 75, maxValue: 100, style: .health)EightBitAlert(variant: .success) {
EightBitAlertTitle("Level Complete!")
EightBitAlertDescription("You earned 100 XP")
}
// Variants: .default, .info, .success, .warning, .destructiveText("GAME OVER")
.font(.eightBit(size: 16))
// Or use preset sizes
Text("Press Start")
.font(.eightBitLarge)// 8-bit styled navigation title (forces inline display mode on iOS)
NavigationStack {
ContentView()
.eightBitNavigationTitle("My Game")
}
// Authentic pixelated border (corner blocks + edge strips)
// This is the primary border style used by components
myView.pixelatedBorder()
// Customizable pixelated border
myView.pixelatedBorder(color: .green, blockSize: 6)
// Simple pixel-style border (Legacy/Simple)
myView.pixelBorder(width: 4)
// Pixel-style shadow (offset shadow)
myView.pixelShadow(offset: 4)
// Internal 3D highlight/shadow strips
myView.internalShadow()
// Retro font
myView.retroFont(size: 12)All EightBitButton instances automatically include heavy impact haptic feedback when pressed for an authentic retro feel.
The Example/EightBitDemo folder contains a demo app showcasing all components and themes.
MIT License - see LICENSE file for details.
- Inspired by 8bitcn-ui
- Font: Press Start 2P (OFL License)

