Beyond Components and Design Tokens

Design tokens are often used to define colors, typography and other visual attributes. In this article I explore the idea of extending this principle to define functional languages. Design tokens are not limited to UIs, they expand beyond visuals into motion, accessibility, error handling, notifications, and functional semantics.

Design tokens provide a predictable system that enables consistent communication between designers, developers, and platforms. They can also ensure AI generates personalized interfaces while staying within clear constraints.

ButtonsizepaddingBlockpaddingInlinefgColorbgColortextSizeborderColorborderWidthborderStyle

Beyond Components

I recently worked on few projects where the push for consistency led organizations to centralize UI logic using headless solutions and building libraries as source of truth.

“If everyone uses the same components UIs will always be consistent”

To reduce efforts even the idea of using Web Components to support all platforms emerged. This may work if applied correctly for web only products but when systems expand to multiple platforms(iOS, Android, Windows, Linux) or new requirements such as server-side rendering, accessibility, performance optimization, platform-native features are needed then this approach falls short:

1. Technical

2. Architectural

3. UX

The source of truth cannot be Components(React, Angular, Vue) or Web Components. It must be Design Tokens, not only to define colors and visual preferences but as a categorization system to define the design language, intent and experiences. When defined at that level creating implementation becomes straightforward.

Beyond Design Tokens

Design tokens are often used as variables for colors and typography. But as described above, When used as a design language they become more than just variables. They become the source of truth and primitives for every platform and system.

DataTableDataTableDataTableButtonButtonButton density:space: compactsm8px regularmd16px comfortablelg32px

This means design tokens extend beyond visual attributes to define functional semantics. These can encode motion, accessibility, error handling, notifications, and even product policies.

1. Language Definition

Creating tokens as design language can be challenging at first after all is about abstracting functionality outside of visuals. Classifying them into categories helps describe product experiences and separating concerns.

Here is a basic example that includes visual, motion, accessibility, functional, and policy semantics using JSON(friendly platform agnostic format):

VisualDesign TokensAccessibilityMotionPolicyFunctionalCore UI styles(brand, layout, type, colors)Timing & easing for interactions(feedback, transition, speed)User/system preferences(reduced animation, scale, contrast)Interaction-related semantics(density, format, haptics)Product rules impacting UX(timeouts, session, gdpr)Examples"ui.fgColor": { "body": "color.neutral900" },"ui.bgColor": "{ "canvas": "color.neutral100" },"ui.textSize": { "base": "1rem" },"ui.intent": { "positive": "color.green500" },"motion.speed": { "fast": "120ms" },"motion.intent": { "feedback": "speed.fast" }"motion.ease": { "in": "cubic-bezier(0.4, 0, 1, 1)" }"motion.opacity": { "low": "0.75" }"access.reducedMotion": { "enabled": true },"access.contrast":{ "high": "7:1" },"access.color": { "deuteranopia":"filter.deuteranopia" },"access.pointerSize": { "large": "2x" },"system.density": { "comfortable": "space.lg" },"system.notify": { "info": "banner" },"system.formatDate": { "short": "intl.date.short" }"system.formatNumber": { "accounting": "intl.number.accounting" }"policy.gdpr": { "enabled": true },"policy.auth.maxAttempts": { "warn": 3, "lock": 5 },"policy.data.retention": { "static": 365, "live": 1 },"policy.passwordLength": { "min": 12 }{}

2. System Integration

Design tokens will continue to evolve as new platforms, technologies, and methodologies emerge. The key is to maintain them in a platform-agnostic format(JSON, YAML, XML) with their own packaging and versioning then use transforms to generate platform-specific bindings(CSS, Swift, Kotlin).

Plugins/TransformersUX/Product DecisionsCSS.button-primary { background-color: var(--color-brand)}JSconst buttonStyles = { primary: { bgColor: tokens.color.brand }}ReactNativeconst buttonStyles = StyleSheet.create({ primary: { backgroundColor: tokens.color.brand }});SwiftUI(iOS)extension View { func buttonPrimary() -> some View { self.background(Color("color.brand")) }}Kotlin(Android)fun Modifier.buttonPrimary(): Modifier { return this.background(tokens.color.brand)} Figma CanvaAfter EffectsFramer{Design Tokens}PrimaryPlatform(iOS, Swift, tvOS, macOS)

3. Functional Implementation

When embracing the same concept as we encode more functionality, the more adaptable and resilient our design system becomes. Functional implementation ensures that tokens are not just static values but dynamic properties that respond to context, user needs, and platform capabilities.

{Loading...}bgFillColor: ui.progressColorbgColor: ui.progressBgColor{Welcome Message}animate({ speed: motion.intent.feedback})DataTableButtonbackgroundColor: system.notify.neutraltextColor: ui.fgColor.base access.reducedMotionYesNo// Skip animationanimate({ speed: motion .intent .transition})DataTableButtonif (error) { openModal({ intent: 'critical', speed: motion .intent .critical })}gap: system.densitysize: ui.controlSize{Title}{Message}ButtonRequest/app.css -> Cache(policy.data.retention)/dashboard -> Cache(policy.data.live)backgroundColor: system.notify.criticaltextColor: ui.fgColor.contrast

Conclusion

Design tokens should be seen not as static values, but as a semantic framework for systems. By classifying visual, behavioral, and functional semantics in one shared language, tokens become the architecture of product language, bridging design intent, user experience, and functional implementation across every platform.

Implementing design languages help communicate across teams from different areas and create a shared understanding of product behavior and appearance. I think the idea of removing hardcoded values from servers, platforms, frameworks, and libraries to a single repository(JSON design language) is the future of design systems and automation.

MediumDEV.to