DocsComponentsTemplatesThemesGitHub

Flutter, Expo & React Native

Take the Fruit Design tokens into your mobile app and build the widgets natively. There are no ready-made mobile components.

Download

Colours in light and dark, spacing and radius. For type use DM Sans; shadows are in tokens.json.

Flutter

import 'package:flutter/material.dart';
import 'fruit_tokens.dart';

class FruitButton extends StatelessWidget {
  const FruitButton({super.key, required this.label, required this.onPressed});
  final String label;
  final VoidCallback onPressed;

  @override
  Widget build(BuildContext context) {
    final c = Theme.of(context).brightness == Brightness.dark
        ? FruitColors.dark
        : FruitColors.light;
    return FilledButton(
      onPressed: onPressed,
      style: FilledButton.styleFrom(
        backgroundColor: c.accent,
        foregroundColor: c.onAccent,
        minimumSize: const Size(64, 50),
        shape: const StadiumBorder(),
      ),
      child: Text(label),
    );
  }
}

Expo and React Native

import { Pressable, Text, useColorScheme } from 'react-native';
import { dark, light } from './fruit-tokens';

export function FruitButton({ title, onPress }) {
  const c = useColorScheme() === 'dark' ? dark : light;
  return (
    <Pressable
      onPress={onPress}
      accessibilityRole="button"
      style={({ pressed }) => ({
        height: 50, paddingHorizontal: 22, borderRadius: 999,
        alignItems: 'center', justifyContent: 'center',
        backgroundColor: c.accent, opacity: pressed ? 0.8 : 1,
      })}
    >
      <Text style={{ color: c.onAccent, fontSize: 17, fontWeight: '600' }}>{title}</Text>
    </Pressable>
  );
}

Expo's DOM components ('use dom') can also show the web components in a web view.

Ask your coding agent

Give it a component page (guidelines and props) plus the token file, and ask for a native version.