Components
AtomSurface
The shared surface atom — eight Figma surface colours at a 20px radius, from white and sunken grey to midnight, glass and brand red.
Figma description ·
.default-surfaceOpen in Figma ↗This component has no description in Figma yet.
Props
import SwiftUI import EandTokens // Shared surface atom: radius 20, clipped. surfaceColor: default (white), subtle, sunken, // midnight-base, midnight-raised, glass-midnight, glass-white (+ frost) or brand. struct AtomSurface<Content: View>: View { var fill: Color = EandColor.surfaceBaseInverse // e.g. EandColor.surfaceRaisedMidnight @ViewBuilder var content: Content var body: some View { content .background(fill) .clipShape(RoundedRectangle(cornerRadius: EandRadius.radius7)) } }
When to use
- Use as the background of a custom block that must sit on the system's surfaces, when no higher-level component fits.
- Don't use where a component already owns its surface: Card, Section, ListRow and the other cards bring their own.
Choosing a surface
surfaceColor | Token |
|---|---|
default | surface/base/inverse |
subtle | surface/base/default |
sunken | surface/sunken/default |
midnight-base | surface/base/midnight |
midnight-raised | surface/raised/midnight |
glass-midnight | surface/glass/midnight/md |
glass-white | surface/glass/white/lg, with a backdrop blur |
brand | surface/base/brand |
The values are Figma's variant labels, which do not match its own token names: default
binds surface/base/inverse. level is the deprecated V1.0 axis; use surfaceColor.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
level? | 'raised' | 'sunken' | 'base' | 'canvas' | — | Deprecated. V1.0 elevation axis with no Figma counterpart; use surfaceColor.
Retained so existing call sites keep their current fill. |
surfaceColor? | 'default' | 'brand' | 'midnight-base' | 'midnight-raised' | 'glass-midnight' | 'glass-white' | 'subtle' | 'sunken' | — | Figma surface-color axis — the seven shared-atom values plus brand. |
Design
Figma source: .default-surface — etisalat Consumer App DSL V1.2 · .inverse-surface
- Radius
border-radius/7(20); content is clipped. glass-whitecarries a backdrop blur fromeffects/glass/lg/frost, the glass effect bound in Figma.brandcomes from the Plans page copy of the atom; the shared atom has no brand value.- The page-local copies of this atom disagree with the shared one; the code follows the shared atom.