Material Skin
Concept
Minimal (Minimal Skin) and Fluent were the first two skins; Material is the third, built in M12 once every component exists. It's also the reference dialect used by the "Material mapping preview" in the component notes. The mapping table below already covers all 52 components, M9 to M11 included.
1. Why
MaterialSkin renders Camouflage in the Material Design 3 dialect and serves as the reference mapping for Skin Contract. It draws every component in Material Design 3 style, on the Paper surface treatment with Ripple feedback. It lives in its own module (camouflage-skin-material) and uses only core's public API. That proves an outside or AI-generated skin can be written the same way. It also ships a starter theme (Material baseline), so a new app can run before its Figma theme exists.
2. Shape
Build vs wrap. Material renderers are built on the platform's foundation layer (Compose foundation, Flutter widgets), not by wrapping the toolkit's Material components (material3.Button, Flutter FilledButton). Those components read MaterialTheme / ThemeData, not CamoTheme, so wrapping them would mean mirroring every token into a second theme system and inheriting its behavior. The platform notes weigh this trade-off in detail.
3. API
3.1 Public surface of the module
| Name | What it's for |
|---|---|
MaterialSkin | the skin value to pass to CamouflageProvider |
MaterialSkin(options) | the options form, for looks only this dialect draws, e.g. expressiveProgress = true (the wavy M3 Expressive indicator). Anything a brand could want on any skin is a component-theme field instead (ADR-28). |
Paper | the surface treatment, reusable by other skins |
Ripple | the feedback, reusable |
materialBaselineLight, materialBaselineDark | starter CamoThemes with M3 baseline values |
materialTheme(seed: Color? = null, dark: Boolean = false, fontFamily: FontFamily? = null) | the M3 theme from a seed (null → the baseline colors), with the M3 type scale in fontFamily (null → the platform font) |
materialColors(seed, dark) | M3 "tonal spot" colors from a seed: fromSeed(primary = seed, neutral = seed) with M3's neutral tones (surface 98, containers 100…90). Core's defaults are Camouflage's grays (ADR-24), so the Material skin brings its own. It also ships M3 shapes (4/8/12/16/28), motion (150/300/500) and the M3 type scale. |
3.2 Paper surface treatment
- The background is the given color, clipped to the shape.
- Separation from the background comes from the surface level (
surfaceContainer*roles), which is how Material 3 now expresses depth. - Elevation adds a shadow:
| Level | Shadow (dp) |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 3 |
| 3 | 6 |
| 4 | 8 |
| 5 | 12 |
3.3 Ripple feedback
| Interaction | State-layer opacity (of the content color) |
|---|---|
| hovered | 8% |
| focused | 10%, plus a 3dp focus ring in primary when focused by keyboard |
| pressed | 10%, plus a bounded ripple from the touch point |
Disabled: the container is onSurface at 12% and the content onSurface at 38%, for every tone. There's no feedback.
3.4 Component mapping
These values are the renderers' defaults(theme): the complete component themes a brand theme overrides field by field. The full field lists, with these defaults, are in each component note under Component theme.
| Component | Material 3 equivalent | Mapping |
|---|---|---|
| CamoText | Text | style as passed. Links in primary + underline. |
| CamoIcon | Icon | ambient size and color (24, onSurface at the root) |
| CamoSurface | Surface | SurfaceLevel → surface / surfaceContainerLowest … Highest |
| CamoCard | Filled / Elevated / Outlined card | Soft → surfaceContainerHighest, Raised → surfaceContainerLow + level 1, Outline → surface + outlineVariant, Solid → primary (Camouflage addition). shapes.medium. Status tones → the tone's container colors. |
| CamoButton | Filled / Filled tonal / Elevated / Outlined / Text button | Solid / Soft / Raised / Outline / Ghost; Link = underlined Text style. Height 40, shapes.full, padding 24 (16 on a side with an icon), icons 18. |
| CamoIconButton | Filled / Filled tonal / Outlined / Standard icon button | Solid / Soft / Outline / Ghost. 40 container, icon 24. |
| CamoTextField | Outlined text field | height 56, shapes.extraSmall, floating label, icons 24 in onSurfaceVariant |
| CamoCheckbox | Checkbox | 18 box, 2dp outline, label in bodyLarge |
| CamoSwitch | Switch | 52 × 32 track (off: surfaceContainerHighest), thumb 16 → 24 (28 pressed) |
| CamoTopBar | Small top app bar | height 64, title at start, surface → surfaceContainer when scrolled |
| CamoDialog | Basic dialog | surfaceContainerHigh, width 280–560, shapes.extraLarge, actions end-aligned |
| CamoBottomSheet | Modal bottom sheet | surfaceContainerLow, top corners shapes.extraLarge, 32 × 4 handle, max width 640 |
| CamoDivider | Divider | 1 dp outlineVariant, insets 16 |
| CamoRadio | Radio button | 20 circle, primary selected, onSurfaceVariant unselected |
| CamoSegmentedControl | Segmented buttons | 40 tall, outline border, selected secondaryContainer + check |
| CamoSlider | Slider (2024) | 16 track, 4 × 44 handle bar, value label |
| CamoDatePicker | Date pickers (docked / modal) | style Calendar, 40 day cells, primary selected circle, primaryContainer range band |
| CamoTimePicker | Time pickers | style Dial, primaryContainer for the active part |
| CamoStepper | – | layout Inline with outlined icon buttons |
| CamoSearchField | Search bar | 56, surfaceContainerHigh, shapes.full |
| CamoAccordion | – (lists) | a list-item header with a rotating chevron |
| CamoListItem / Section | Lists | 56 / 72 / 88 rows, bodyLarge headline |
| CamoMenu | Menus | surfaceContainer, level 2, 48 items, width 112–280 |
| CamoSelect | Exposed dropdown menu | outlined text field + chevron → menu or sheet |
| CamoTooltip | Plain tooltip | inverseSurface, bodySmall, 24 tall |
| CamoChip | Chips (assist, filter, input, suggestion) | 32 tall, shapes.small, outline or tonal |
| CamoBadge | Badges | dot 6 / pill 16, error |
| CamoAvatar | (no component; used in lists and chips) | circle, initials titleMedium, 24 / 40 / 56 |
| CamoProgress | Progress indicators (2024) | 4 dp bar with gap and stop dot, 48 circle |
| CamoSnackbar | Snackbar | inverseSurface, action inversePrimary |
| CamoBanner | (M2 banner; not in M3) | soft card per tone with a status icon |
| CamoTabs | Primary / secondary tabs | 48 / 64, 3 dp indicator |
| CamoNavigationBar | Navigation bar | 80, pill indicator 64 × 32 |
| CamoNavigationRail | Navigation rail | 80 wide, pill indicator 56 × 32 |
| CamoNavigationDrawer | Navigation drawer | 360 wide, 56 items, modal with shapes.large corners |
| CamoPagedList | (lists + pull to refresh) | M3 pull-to-refresh indicator (a spinner in a raised disc), retry row, centered empty state |
| CamoSkeleton | (none) | shimmer, surfaceContainerHighest / surfaceContainerLow |
| CamoFab | FAB, extended FAB | 40 / 56 / 96, primaryContainer, level 3 |
| CamoPopover | Rich tooltip | surfaceContainer, shapes.medium, level2, no arrow, max width 320 |
| CamoSideSheet | Side sheets (standard, modal) | 360, standard surface + outlineVariant edge; modal surfaceContainerLow with shapes.large start corners |
| CamoToolbar | Docked and floating toolbars, bottom app bar | 64, surfaceContainer; floating shapes.full, level3 |
| CamoButtonGroup | Button groups (standard, connected) | 40, shapes.full ends, the selected button turns primary and rounder |
| CamoSplitButton | Split button | two segments in a pill, 2 dp gap, 40 + 40 chevron part |
| CamoDataTable | a list-like table | a list-like table: surfaceContainerHigh header, rows 52, outlineVariant dividers, the selected row secondaryContainer |
| CamoTree | Tree | M3 list rows 48 with a chevron, indent 24, the selected row secondaryContainer |
| CamoCarousel | the M3 carousel | multi-browse and hero layouts, shapes.extraLarge items |
| CamoImage | Image | shapes by role, surfaceContainerHigh placeholder |
| CamoRating | Rating | 24 dp stars, primary filled, outline empty |
| CamoFileUploader | File uploader | a dashed outline zone, shapes.medium, surfaceContainerLow, linear progress per file |
| CamoPagination | Pagination | 40 dp buttons, the current page secondaryContainer, chevron arrows; dots for the page control |
| CamoBreadcrumb | Breadcrumb | bodyMedium links in primary, chevron separators, an overflow button |
| CamoProgressSteps | Progress indicator | 24 dp circles, primary complete and current, outlineVariant upcoming, 2 dp connectors |
3.4a Material under ADR-42 (materials rule)
Material draws no blur, glass or window material, so it reads none of the CamoCapabilities and needs no fallback chain: Paper and Ripple draw the same on every target, including with reduceTransparency on. The only context it reads is the input kind (CamoEnvironment.input): hover layers and the 3 dp keyboard focus ring show for a pointer or keyboard, touch shows the ripple alone.
Dialect alignment (required, Design Language §3.4): Appearance × Tone for buttons (f = the tone's family; Material 3 has no status buttons, so tones are Camouflage's consistent extension):
| Appearance | Material 3 style | Default | Status tone x |
|---|---|---|---|
Solid | Filled | primary / onPrimary | x / onX |
Soft | Filled tonal | secondaryContainer / onSecondaryContainer | xContainer / onXContainer |
Raised | Elevated | surfaceContainerLow + primary content, level 1 | surfaceContainerLow + x content |
Outline | Outlined | outline border, primary content | x border and content |
Ghost | Text | primary content | x content |
Link | (none) Text style + underline, no container padding | primary content | x content |
Tone: Default → primary family, Error → error, Success/Warning/Info → the generated status families. Level: SurfaceLevel → M3 surface containers (one to one).
3.5 Starter theme: materialBaselineLight / materialBaselineDark
The brand, surface, line, inverse and error roles are the M3 baseline scheme (seed #6750A4). Check them against m3.material.io when implementing, and keep them in one file.
| Role | Light | Dark |
|---|---|---|
| primary / onPrimary | #6750A4 / #FFFFFF | #D0BCFF / #381E72 |
| primaryContainer / onPrimaryContainer | #EADDFF / #21005D | #4F378B / #EADDFF |
| secondary / onSecondary | #625B71 / #FFFFFF | #CCC2DC / #332D41 |
| secondaryContainer / onSecondaryContainer | #E8DEF8 / #1D192B | #4A4458 / #E8DEF8 |
| tertiary / onTertiary | #7D5260 / #FFFFFF | #EFB8C8 / #492532 |
| tertiaryContainer / onTertiaryContainer | #FFD8E4 / #31111D | #633B48 / #FFD8E4 |
| surface | #FEF7FF | #141218 |
| surfaceContainerLowest / Low | #FFFFFF / #F7F2FA | #0F0D13 / #1D1B20 |
| surfaceContainer | #F3EDF7 | #211F26 |
| surfaceContainerHigh / Highest | #ECE6F0 / #E6E0E9 | #2B2930 / #36343B |
| onSurface / onSurfaceVariant | #1D1B20 / #49454F | #E6E0E9 / #CAC4D0 |
| outline / outlineVariant | #79747E / #CAC4D0 | #938F99 / #49454F |
| error / onError | #B3261E / #FFFFFF | #F2B8B5 / #601410 |
| errorContainer / onErrorContainer | #F9DEDC / #410E0B | #8C1D18 / #F9DEDC |
| inverseSurface / inverseOnSurface / inversePrimary | #322F35 / #F5EFF7 / #D0BCFF | #E6E0E9 / #322F35 / #6750A4 |
| scrim | #000000 | #000000 |
Success, warning and info aren't part of M3. The baseline generates them with CamoColors.fromSeed from the default status seeds (green #2E7D32, amber #F9A825, blue #0288D1), using the tone rule in Theme §3.4. Their generated hex values are written into the baseline file once, and pinned by a snapshot test, so they never shift silently when the color library updates.
Typography: the M3 baseline type scale. The skin doesn't bundle Roboto (skins never bundle fonts): the starter theme takes fontFamily and defaults to the platform font. Roboto on Android; elsewhere the app adds Roboto for the authentic look (materialTheme(fontFamily = Roboto)).
| Role | Size / line height | Weight | Tracking |
|---|---|---|---|
| displayLarge / Medium / Small | 57/64, 45/52, 36/44 | 400 | −0.25, 0, 0 |
| headlineLarge / Medium / Small | 32/40, 28/36, 24/32 | 400 | 0 |
| titleLarge / Medium / Small | 22/28, 16/24, 14/20 | 400, 500, 500 | 0, 0.15, 0.1 |
| bodyLarge / Medium / Small | 16/24, 14/20, 12/16 | 400 | 0.5, 0.25, 0.4 |
| labelLarge / Medium / Small | 14/20, 12/16, 11/16 | 500 | 0.1, 0.5, 0.5 |
3.6 Chart preset
Charts are not in the skin contract (ADR-40): Material reaches them through the preset registered for skin.name == "material" (see Chart Frame). The preset ships inside the charts package, next to Minimal and Fluent, so the skin module does not depend on it.
ChartStyle field | Material | Why |
|---|---|---|
lineWidth | 3 | M3 indicators are 4 dp strokes; 3 keeps two lines apart |
markerSize | 8 | the M3 "handle" feel, round dots |
areaOpacity | 0.16 | the tonal container steps are about 16% of the accent |
barRadius | 8 | shapes.small on the free end, as the progress bar's end caps |
barGap | 2 | the gap of connected button groups |
gridDashed | false | outlineVariant hairlines, solid |
sliceGap | 4 | the 4 dp gap M3 puts between segments |
donutThickness | 0.3 | a thick ring, like the circular indicator |
The palette stays the theme's (the color families), and the tooltip uses the inverseSurface roles like the Material tooltip. Tokens can change any of it per brand (ChartTokens).
4. Build steps
M12 builds the skin in four reviewed batches that follow the five task cards (the platform notes list them): the module and theme, then the renderers by group, then the M9 to M11 renderers and the chart preset. The steps below are the order inside them.
- Implement
PaperandRipplefirst. Test them on a bareCamoSurfacewithDebugSkin.copy(surfaceTreatment = Paper, feedback = Ripple). - Implement the renderers in checklist order: text → icon → surface → button → iconButton → card → checkbox → switch → textField → topBar → dialog → bottomSheet. M3 ("Hello skin") needs only text, icon, surface and button. The rest land in M5/M6.
- Assemble
MaterialSkinand its options. Write a test per renderer that sets every field of its component theme to a distinctive value and checks the rendering uses it (no literal left in a renderer). - Add
materialBaselineLight/Dark. Generate the status families, write them in, and add the snapshot test.validate()must return no issues for both. - Run the screenshot matrix: each component × light/dark × 100/200% font × LTR/RTL, plus buttons × every tone.
- Build the M4 demo: the same screen with
materialBaselineLightand a custom brand theme, switched live.
Done when
- All 52 renderers are implemented, using only core's public API, and the M9 to M11 components render in Material.
- Baseline themes validate cleanly, and the status colors are pinned by a snapshot.
- The screenshot matrix is reviewed and recorded as goldens.
- A custom brand theme visibly rebrands every component without code changes.
5. Edge cases
| Case | Decided behavior |
|---|---|
| Where Camouflage deviates from M3 | M3 has no Link button (Camouflage draws it as an underlined text button) and no Solid card (Camouflage draws it with primary). Status tones on buttons and cards are a Camouflage extension; M3 has only error. surfaceBright/surfaceDim and the "fixed" accent roles aren't included. |
| Android 12+ dynamic color | Works through the theme (dynamicCamoColors(), in the Kotlin note). The skin doesn't change. |
| Brand theme with poor contrast | The skin draws what the theme says. validate() flags it. |
A renderer overridden by the app (MaterialSkin.copy(button = X)) | Other renderers are unaffected. Dialog buttons are the caller's CamoButtons, so they use the override too. |
| Material Expressive (the 2025 M3 update: new shapes and motion) | Out of v1. It could arrive as a skin option or a separate skin. |
- Expressive progress waves the linear indicator only; the circular one stays.
- Time picker field is 64, not the 72 first planned (a 45 sp digit fits, and the popup is narrow on a phone).
- Defaults: the card's default form is Filled (
Soft,surfaceContainerHighest); text fields float their label; the switch shows thumb icons; the segmented control is outlined with a check on the selected segment. - Both platforms ship the chart preset in §3.6 as
"material".
Implementation
Read the base note first: Material Skin. Minimal and Fluent came first, so the module follows the layout of camouflage-skin-fluent (MaterialSkin.kt, MaterialTheme.kt, Paper.kt, Ripple.kt, and renderer/Material*.kt grouped like Fluent's). This note is the platform plan.
1. Why
:camouflage-skin-material implements every renderer in Material 3 style using only Compose foundation + material-ripple, plus camouflage-core's public API. This note records the build-vs-wrap decision, the ripple wiring, and how the baseline themes are packaged.
2. Shape
Build on foundation vs wrap material3
Build on foundation (chosen) | Wrap material3 components | |
|---|---|---|
Reads CamoTheme directly | yes | no: every token must be mirrored into a MaterialTheme inside each renderer |
Component themes (ButtonStyle.height …) | every field honored | many fields have no material3 parameter (a button's exact height, the thumb sizes) |
| Behavior split (core owns click and semantics) | clean: the renderer only draws | fights material3, which owns its own click, semantics and minimumInteractiveComponentSize |
| Dependency weight | foundation + material-ripple (small) | the whole material3 artifact |
| Faithfulness to M3 specs | our job (specs in the base note) | free |
| Effort | higher | lower at first, then higher when fighting the gaps |
Wrapping would make Camouflage a thin Material theme adapter, which is exactly what the project exists to avoid.
3. API
public val MaterialSkin: CamoSkin = materialSkin()
public fun materialSkin(expressiveProgress: Boolean = false): CamoSkin = CamoSkin(
name = "material",
surfaceTreatment = Paper,
feedback = Ripple,
text = MaterialTextRenderer, icon = MaterialIconRenderer, surface = MaterialSurfaceRenderer,
card = MaterialCardRenderer, button = MaterialButtonRenderer, iconButton = MaterialIconButtonRenderer,
textField = MaterialTextFieldRenderer, checkbox = MaterialCheckboxRenderer,
switch = MaterialSwitchRenderer, // thumb icons come from SwitchStyle.showThumbIcons (default true here) topBar = MaterialTopBarRenderer, dialog = MaterialDialogRenderer,
bottomSheet = MaterialBottomSheetRenderer,
)
public object Paper : SurfaceTreatment {
override fun modifier(color: Color, shape: Shape, elevation: Dp, theme: CamoTheme): Modifier =
Modifier.shadow(elevation, shape, clip = false).background(color, shape).clip(shape)
}
public object Ripple : InteractionFeedback {
override fun indication(contentColor: Color, theme: CamoTheme): Indication = MaterialIndication(contentColor)
}
public val materialBaselineLight: CamoTheme
public val materialBaselineDark: CamoTheme
MaterialIndication (internal) is an IndicationNodeFactory whose node delegates to:
createRippleModifierNode(interactionSource, bounded = true, radius = Dp.Unspecified, color = { contentColor }, rippleAlpha = { MaterialRippleAlpha }), the public low-level API inmaterial-ripple, which draws the touch ripple;- a state-layer node that draws
contentColorat 8% (hover) or 10% (focus/press) over the bounds; - a focus-ring node that draws a 3 dp
primaryoutline when focus came from the keyboard.
MaterialRippleAlpha = RippleAlpha(draggedAlpha = 0.16f, focusedAlpha = 0.10f, hoveredAlpha = 0.08f, pressedAlpha = 0.10f).
Baseline theme packaging:
MaterialBaselineColors.ktholds the M3 hex values from the base note, written out.- The status families are generated once with
CamoColors.fromSeedand pasted as literals, with a comment naming the seed and the MaterialKolor version. commonTesthas a snapshot test asserting the literals still equalfromSeedoutput. It fails loudly if a library bump changes them, and you decide whether to update.
Typography: the M3 type-scale values from the base note as TextStyles with FontFamily.Default. Roboto isn't bundled (ADR-33): materialTheme(fontFamily = …) takes an app-provided family. On Android, the default is Roboto anyway.
4. Build steps
M12 is built in one pass (the user's ruling, 2026-11-05: CamoSkin has no defaults, so a Material skin can't compile as a skin until every renderer exists), then reviewed as a whole. The five task cards close together.
Steps:
Paper,MaterialIndication(ripple + state layer + focus ring),Ripple.- The renderers of the batch, in checklist order.
materialSkin()/MaterialSkin.- The baseline themes + the snapshot test.
- Run
assertRendererAppliesBehavior(from Skin Contract §5) on every clickable renderer. - The "no literals" test per renderer: set every
XThemefield to an odd value (e.g. height 57 dp), and assert the rendered node measures it. - Screenshot goldens (Testing).
- The M4 demo: a brand theme vs baseline, live-switched.
Done when
-
:camouflage-skin-materialhas nomaterial3dependency (./gradlew :camouflage-skin-material:dependencies). - Every renderer passes the behavior and no-literals tests.
- Goldens are recorded for Android and desktop, and iOS where Roborazzi supports it. Local macOS renders are replaced by CI's Linux ones.
- The module is at layer 1 (
checkModuleLayers), in the BOM, and the sample switches Minimal / Fluent / Material live. -
CamoChartshas the"material"preset and the four charts render in the skin.
5. Edge cases
| Case | Decided behavior |
|---|---|
createRippleModifierNode API changes | It's public but low-level. It's pinned through the Compose Multiplatform version, and the Ripple wrapper is the only file touching it. |
| Ripple on web / iOS | material-ripple works on every Compose Multiplatform target. On iOS it looks Material (expected for this skin; a Cupertino skin uses Opacity). |
| M3 spec updates (Expressive) | Out of v1 (base note). |
| App overrides a renderer | MaterialSkin.copy(button = X): the other renderers keep reading Camouflage.skin.feedback, so feedback stays consistent. |
- One pass, not four batches.
CamoSkinrequires every renderer, so the skin was built whole. The module started as a copy ofcamouflage-skin-minimal(Minimal's renderers are overlay-based like Material's), with every default, shape and structure reworked to the M3 table in the base note. - Files:
Paper.kt,Ripple.kt,MaterialTheme.kt(materialTheme(seed, dark, fontFamily),materialColors, the baselines,MaterialBaselineSeed),MaterialSkin.kt(materialSkin(expressiveProgress),MaterialSkin,MaterialPreview),renderer/Material*.ktgrouped like Fluent's, andrenderer/MaterialWavy.kt. - Ripple is a
DelegatingNode: the touch ripple is material-ripple'screateRippleModifierNode(RippleAlpha: pressed 10%, dragged 16%); the 8% hover and 10% focus state layer and the 3 dp keyboard focus ring are drawn by the skin.material-rippleis the only Material artifact (composeLibs.ripple). - Paper is
Modifier.shadow(...).background(...).clip(...); shadows are the theme's elevation levels (1, 3, 6, 8, 12 dp). - Baseline: the M3 roles are literals; the status families are literals too, and
MaterialBaselineTestfails iffromSeedwould generate different ones.materialTheme(seed)usesfromSeed(primary = seed, neutral = seed). - Defaults that differ from the first plan: the text field is floating-label by default (56 dp,
extraSmall); the switch shows thumb icons by default; the slider is the 2024 handle-bar slider with stop marks; segmented buttons share one outline; the card defaults to the Filled (Soft) form; the FAB defaults toprimaryContainer; the time picker's field is 64 dp; the dialog issurfaceContainerHighat level 3. expressiveProgresswaves the linear indicator only (MaterialWavyProgressBarRenderer: a 3 dp amplitude, 40 dp wavelength, drifting; static under reduced motion). The circular indicator stays.- Charts: the
"material"preset is inCamoCharts(line 3, markers 8, area 16%, bar radius 8, bar gap 2, slice gap 4, donut 0.3); the charts goldens gainedmaterial_lightandmaterial_dark. - Sample:
SampleSkin.Material(with the brand seed throughmaterialTheme(seed));BrandThemeTestcovers it. Layer 1 inbuild.gradle.kts; the BOM picks it up by name. - The goldens are macOS renders; CI's Linux ones replace them after the first run.