jade_ui 0.3.0
jade_ui: ^0.3.0 copied to clipboard
A token-driven Flutter component library with first-class light and dark themes, independent of Material and Cupertino.
Jade UI #
Jade UI is a Flutter component library for building token-driven, responsive interfaces without coupling components to Material or Cupertino themes. It provides one public import, first-class light and dark themes, reusable interaction patterns, a demo app in example/, and the official website and component catalog in website/.
Jade UI is at 0.x, so minor versions may include breaking changes. Each one is listed in CHANGELOG.md.
Install #
flutter pub add jade_ui
Then import the public library:
import 'package:jade_ui/jade_ui.dart';
Do not import files from lib/src; those files are implementation details.
First app #
import 'package:jade_ui/jade_ui.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return JadeApp(
title: 'My app',
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
themeMode: ThemeMode.system,
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const AppBar(title: Text('Jade UI')),
body: Center(
child: Button.primary(
onPressed: () {},
child: const Text('Continue'),
),
),
);
}
}
JadeApp supplies Jade themes, localization, navigation, default text styling, scroll behavior, and system-aware theme selection. When embedding Jade widgets inside an existing app shell, use AppScope instead.
Core conventions #
- Import from
package:jade_ui/jade_ui.dart. It also re-exportspackage:flutter/widgets.dart. - Read visual values from Jade tokens such as
context.colors,context.text,context.radii, andcontext.shadows. - Prefer semantic
ColorRoleToken,SizeToken,RadiusToken, and component variants over literal styling. - Pass widgets into
leading,trailing,prefix,suffix, and similar slots. - Keep durable form, selection, and open state in the caller when a component exposes a value/callback pair.
- Use Jade overlay entry points such as
showDialog,showBottomSheet, andshowDrawer. - Qualify or hide Material/Cupertino symbols when their names collide with Jade exports.
- Design and test both light and dark themes.
Example #
example/ is a single profile screen built only from Jade UI components:
cd example
flutter run
For complete apps, start from one of the templates: an analytics dashboard, an email client, an AI assistant, a CRM, a finance app, an online store and a stays booking app. Each one has a live demo.
The official website in website/ is the canonical component catalog:
cd website
flutter run -d chrome
Its registry is in website/lib/data/component_registry.dart, and each playground under website/lib/ui/playgrounds contains working usage and API tables.
Documentation #
- Documentation home
- Getting started
- Core concepts
- Theming and dark mode
- Complete component index
- Architecture
- Guide for coding agents
- Guide for agents building apps with Jade UI
- Compact agent context
- Full agent context
Development #
flutter pub get
dart format lib test example/lib example/test website/lib website/test tool
flutter analyze
flutter test
dart run tool/generate_component_docs.dart
dart run tool/generate_llms.dart
dart run tool/check_doc_snippets.dart
dart run tool/check_skill_examples.dart
Enable the repository's pre-commit hook once per clone. It regenerates the component docs and llms-full.md and stages them whenever a commit changes their inputs, and it blocks the commit when a generator check fails:
git config core.hooksPath .githooks
Regenerate component pages after changing the website registry, playground API tables, or component paths; the generator fails when an API table names a property the component source does not define. Regenerate llms-full.md after any documentation change. The snippet check analyzes every dart block in the docs and in lib/ dartdoc against the public API. The skill check applies the templates and recipes in .agents/skills/ and skills/ to a scratch copy of the repository and runs the analyzer, their tests, the generator and the snippet check on them. CI runs all of these and fails on any diff in generated files.
Release status #
Jade UI is published on pub.dev. See CHANGELOG.md for release notes and the website for live examples.