Make it look like your app
The ready-made screens are brand-neutral: a quiet green, the platform typeface, a plain card for every
document type. WalletBranding changes all of it. Set it once, where you create the SDK object, before the
first screen shows; every SDK screen (cards, consent, presenting, results) then uses the same name, colours and
card art, on every sharing path: in person, a website’s link or QR, and the phone’s ID sheet on Android. Your
app’s own Material theme does not change the SDK’s colours. (The iOS 26 ID sheet runs in your provider extension:
pass the same colour as WalletDocumentProviderView(…, accentColor:).)
package samples
import androidx.compose.ui.graphics.Colorimport androidx.compose.ui.text.TextStyleimport androidx.compose.ui.text.font.FontFamilyimport androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.unit.spimport com.wallet.model.DocTypesimport com.wallet.ui.CardFaceimport com.wallet.ui.CardInkimport com.wallet.ui.CardTextWeightimport com.wallet.ui.WalletBranding
/** Make the wallet screens look like your app. Set once, at app start, before the first SDK screen shows. */object Branding { fun apply() { WalletBranding.appName = "My City" // the title of the consent sheet, above the verifier's name WalletBranding.primaryColor = Color(0xFF4361DF) // buttons, icons, progress // The colour behind the wallet screens: your page colour, so your bars and the wallet meet without a seam. WalletBranding.backgroundColor = Color(0xFFF7F6FA) WalletBranding.fontFamily = FontFamily.SansSerif // your typeface: FontFamily(Font(R.font.my_regular), …) WalletBranding.credentialTypes = listOf(EmiratesIdType.type) // One face per document type: the built-in driving licence and your own type. WalletBranding.cardFaces = mapOf( DocTypes.MDL to MyLicenceCardFace, EmiratesIdType.type.docType to MyIdCardFace, ) WalletBranding.install() }
/** A card face, drawn from the signed data on a 1024 × 646 canvas (ID-1 ratio). */ val MyLicenceCardFace = CardFace { card -> background(Color(0xFFEFF3F9), Color(0xFFDCE6F3)) text("DRIVING LICENCE", 46f, 46f, TextStyle(color = CardInk, fontSize = 30.sp, fontWeight = FontWeight.Bold)) card.portrait?.let { image(it, 46f, 120f, 258f, 330f) } field(344f, 130f, "LICENCE NO.", card.fields["document_number"], valueSize = 34.sp) field(344f, 224f, "NAME", card.name) field(344f, 318f, "DATE OF BIRTH", card.date("birth_date")) field(680f, 318f, "EXPIRES", card.date("expiry_date")) }
/** A second face, for a document type of your own: an ID card. The same helpers with plain values (ARGB colours, sizes, weights). */ val MyIdCardFace = CardFace { card -> val ink = 0xFF1B1F3B radialBackground(center = 0xFFEBD9EE, edge = 0xFFC9DEF2) // a national ID card's security print text("RESIDENT IDENTITY CARD", 44f, 36f, size = 30f, weight = CardTextWeight.Bold, color = ink, letterSpacing = 0.5f) card.portrait?.let { image(it, 64f, 150f, 246f, 330f, cornerRadius = 14f) } textCenter("ID NUMBER", 640f, 150f, size = 18f, weight = CardTextWeight.Medium, color = ink) textCenter(card.fields["person_id"] ?: "—", 640f, 180f, size = 30f, weight = CardTextWeight.Bold, color = ink, letterSpacing = 1f) field(356f, 270f, "NAME", card.name, valueSize = 26f, valueColor = ink, labelColor = ink) field(356f, 370f, "DATE OF BIRTH", card.date("birth_date"), valueSize = 24f, valueColor = ink, labelColor = ink) field(700f, 370f, "EXPIRES", card.date("expiry_date"), valueSize = 24f, valueColor = ink, labelColor = ink) // A faded grey copy of the photo, as printed on many ID cards. card.portrait?.let { image(it, 860f, 450f, 110f, 148f, cornerRadius = 55f, alpha = 0.18f, grayscale = true) } }}import Wallet
/// Make the wallet screens look like your app. Set once, at app start, before the first SDK screen shows.enum Branding { static func apply() { let b = WalletBranding.shared b.appName = "My City" // the title of the consent sheet, above the verifier's name b.setPrimaryColor(argb: 0xFF4361DF) // buttons, icons, progress // The colour behind the wallet screens: your page colour, so your bars and the wallet meet without a seam. b.setBackgroundColor(argb: 0xFFF7F6FA) // Your typeface: one font file per weight, from your app bundle (empty = the platform typeface). b.fonts = [ BrandFont(name: "MyFont-Regular", bytes: fontBytes("MyFont-Regular"), weight: .regular), BrandFont(name: "MyFont-Bold", bytes: fontBytes("MyFont-Bold"), weight: .bold), ] b.credentialTypes = [EmiratesIdType.type] // One face per document type: the built-in driving licence and your own type. b.cardFaces = [ DocTypes.shared.MDL: MyLicenceCardFace(), EmiratesIdType.type.docType: MyIdCardFace(), ] b.install() }
private static func fontBytes(_ name: String) -> KotlinByteArray { guard let url = Bundle.main.url(forResource: name, withExtension: "ttf"), let data = try? Data(contentsOf: url) else { return KotlinByteArray(size: 0) } let bytes = KotlinByteArray(size: Int32(data.count)) for (i, byte) in data.enumerated() { bytes.set(index: Int32(i), value: Int8(bitPattern: byte)) } return bytes }}
/// A card face, drawn from the signed data on a 1024 × 646 canvas (ID-1 ratio). Colours are ARGB values.final class MyLicenceCardFace: NSObject, CardFace { func draw(_ c: CardCanvas, card: CardFaceData) { c.background(from: 0xFFEFF3F9, to: 0xFFDCE6F3) c.text(text: "DRIVING LICENCE", x: 46, y: 46, size: 30, weight: .bold, color: CardColors.shared.ink) if let portrait = card.portrait { c.image(bytes: portrait, x: 46, y: 120, w: 258, h: 330) } c.field(x: 344, y: 130, label: "LICENCE NO.", value: card.fields["document_number"], valueSize: 34) c.field(x: 344, y: 224, label: "NAME", value: card.name) c.field(x: 344, y: 318, label: "DATE OF BIRTH", value: card.date(id: "birth_date")) c.field(x: 680, y: 318, label: "EXPIRES", value: card.date(id: "expiry_date")) }}
/// A second face, for a document type of your own: an ID card. The same helpers, plain values.final class MyIdCardFace: NSObject, CardFace { private let ink: Int64 = 0xFF1B1F3B
func draw(_ c: CardCanvas, card: CardFaceData) { c.radialBackground(center: 0xFFEBD9EE, edge: 0xFFC9DEF2) // a national ID card's security print c.text(text: "RESIDENT IDENTITY CARD", x: 44, y: 36, size: 30, weight: .bold, color: ink, letterSpacing: 0.5) if let portrait = card.portrait { c.image(bytes: portrait, x: 64, y: 150, w: 246, h: 330, cornerRadius: 14, alpha: 1, grayscale: false) } c.textCenter(text: "ID NUMBER", centerX: 640, y: 150, size: 18, weight: .medium, color: ink) c.textCenter(text: card.fields["person_id"] ?? "—", centerX: 640, y: 180, size: 30, weight: .bold, color: ink, letterSpacing: 1) c.field(x: 356, y: 270, label: "NAME", value: card.name, valueSize: 26, valueColor: ink, labelColor: ink) c.field(x: 356, y: 370, label: "DATE OF BIRTH", value: card.date(id: "birth_date"), valueSize: 24, valueColor: ink, labelColor: ink) c.field(x: 700, y: 370, label: "EXPIRES", value: card.date(id: "expiry_date"), valueSize: 24, valueColor: ink, labelColor: ink) // A faded grey copy of the photo, as printed on many ID cards. if let portrait = card.portrait { c.image(bytes: portrait, x: 860, y: 450, w: 110, h: 148, cornerRadius: 55, alpha: 0.18, grayscale: true) } }}Colours are ARGB values (0xAARRGGBB): setPrimaryColor(argb:) and setBackgroundColor(argb:), and the same
numbers in a card face. The typeface is fonts: one BrandFont(name:bytes:weight:) per weight (.regular,
.medium, .semibold, .bold), with the bytes of a TTF/OTF file from your bundle.
The settings
Section titled “The settings”WalletBranding |
What it changes | Default |
|---|---|---|
appName |
the wallet’s name: the title of the consent sheet, above the verifier’s name | "Wallet" |
primaryColor (Swift: setPrimaryColor(argb:)) |
buttons, icons, progress | the SDK’s green |
backgroundColor (Swift: setBackgroundColor(argb:)) |
the background behind the wallet screens. Set it to your page colour when the wallet sits inside your own screens, so your bars and the wallet meet without a seam | a light grey |
fonts (Kotlin also: fontFamily) |
optional: the typeface of every screen and of card-face text: one BrandFont per weight, or a Compose font family |
the platform typeface |
cardFaces |
a card design per document type, drawn from the signed data (below) | the neutral card |
credentialTypes |
your own document types, so values render with the right labels and formats | the driving licence only |
theme is the SDK’s Material theme in these colours and typeface: wrap your own screens in it and they match.
typography is the type scale alone, for apps with their own MaterialTheme.
A typeface of your own is optional. The demo apps keep the phone’s standard font and set only their name,
colours and card faces. A card face can still set its own font on any text (a TextStyle with a fontFamily);
text without one uses your typeface, or the platform’s.
Card faces
Section titled “Card faces”A card face is a drawing function per document type on a 1024 × 646 canvas (the ID-1 card ratio). It gets
the credential’s values already rendered as text (fields), its dates (date("birth_date") as dd/MM/yyyy),
the holder’s name and the portrait, and draws with background, radialBackground, text, textCenter,
textRight, field, image and rect, or anything else through the raw drawing scope. Colours are ARGB
values, text sizes are card pixels and weights are CardTextWeight (Regular, Medium, SemiBold, Bold);
the default ink and label colours are CardColors.ink and CardColors.muted. Kotlin can also pass Compose
Colors and TextStyles, as MyLicenceCardFace does. The drawn card is what the wallet, the consent sheet
and the iOS Digital Credentials sheet show.
Any document type can have a face: the sample registers one for the built-in driving licence and one for its
own Emirates ID type (MyIdCardFace), keyed by the type’s docType. Document types without a face get the
neutral card. Images (image) take PNG or JPEG bytes, so a logo or emblem from your app’s resources draws
the same way as the portrait.

Next: Go live.