astryx_ui

The Flutter design system for the app you have to ship this quarter. 111
components, 42 whole screens, one token layer, and no Material anywhere in the
tree. Add one dependency and the buttons, tables, dialogs, menus, toasts, date
pickers, command palette and chat surfaces are already designed — in seven
themes, light and dark, on a mouse and on a thumb.
See every component, live, in seven themes → astryxui.web.app
Status: pre-alpha. Published as a development preview; the API is unstable
and may change without a major version bump until 0.1.0. See the
changelog for what each release contains.
Install
flutter pub add astryx_ui:^0.0.8-dev
Pre-release versions are not selected by a bare flutter pub add, so name the
version — or write it out:
dependencies:
astryx_ui: ^0.0.8-dev
To track the repository instead of a release:
dependencies:
astryx_ui:
git: https://github.com/JayashBhandary/astryx_ui.git
What you get
- 111 components. Buttons, fields, selects, tables, tabs, menus, dialogs,
toasts, banners, calendars, date and time inputs, avatars, carousels, a
command palette, a typeahead, an app shell and a full chat surface. Not a
starting point — the set an internal tool actually needs.
- 42 whole screens. Sign-in, settings, dashboards, tables with filters and
pagination, kanban boards, editors, an IDE, galleries, storefronts, an
incident console, AI chat. Each one is extracted from a widget that compiles,
so the code you copy is the screen you looked at.
- 19 controllers and mixins, where upstream ships a React hook.
- Seven themes, and an engine for yours.
defineTheme runs the same HCT
colour model and contrast maths as the TypeScript original, so a theme defined
in Dart produces the same values the React version does. Give it one hex
accent and it derives the palette, including the foregrounds that guarantee
contrast.
- Never a raw colour or a magic number. Every value resolves through the
token layer, so changing your brand is changing one theme rather than running
a search-and-replace across your codebase.
- Pointer and touch, both first class. Touch density raises every tap target
to 48 logical pixels and suppresses hover styling, because hover does not
exist there. Nothing is ever behind it.
- Accessibility that is not optional. Every control requires an accessible
name, keeps a visible focus ring for keyboard users, and states its keyboard
map in its own documentation. An icon-only button takes its label as a
required argument — the compiler asks for it, not the code review.
- A skill your coding agent can read. The whole widget set, every enum and
the rules that are not guessable from the API, generated from the same source
as the docs.
Why not Material
Material is a brand, and ThemeData is its API. Every internal tool built on it
starts by fighting the parts of that brand it did not choose — the ripples, the
elevation, the shape defaults, the ColorScheme mapping that never quite covers
what a design has.
astryx_ui is built on flutter/widgets, which is Flutter without the opinion.
Colours, spacing, radii, type and motion come from one token layer that is
value-compatible with Astryx, Meta's React
- StyleX design system. A team running Astryx on the web and this in the app
ships one design language rather than two that drift.
It also composes rather than converts: adopt it a subtree at a time inside the
MaterialApp you already have. Nothing here asks you to start again.
Setup
Wrap your app once. AstryxApp is a WidgetsApp with everything installed:
import 'package:astryx_ui/astryx_ui.dart';
void main() => runApp(
AstryxApp(
title: 'My internal tool',
home: const HomePage(),
),
);
Adopting incrementally inside an existing MaterialApp or CupertinoApp?
Use the provider instead — it installs the theme, the icon registry, the
localisations, the focus-visible scope and the toast host, and works anywhere
in the tree:
MaterialApp(
home: AstryxThemeProvider(
child: const HomePage(),
),
)
That is the whole setup. Toasts, tooltips, dialogs and focus rings all work
from here with nothing else to wire.
Theming
Seven prebuilt themes ship with the package — neutralTheme, matchaTheme,
stoneTheme, gothicTheme, chocolateTheme, y2kTheme and butterTheme:
AstryxThemeProvider(
theme: matchaTheme,
mode: AstryxColorMode.system,
child: const HomePage(),
)