skad: a copy-first design system for Flutter
Why we built skad, a shadcn-style Flutter design system you can copy into your project: ThemeExtension tokens, motion tokens, and keyboard-ready widgets.
- Published
- Reading time
- 5 min
- Project
- skad
- Topics
-
- Flutter
- Dart
- ThemeExtension
- pub.dev
Every Flutter app we build for a client needs the same few widgets done properly: a button with real variants, an input with a label and an error state, a dialog that behaves. Material gives you a starting point, and then you spend a week fighting its defaults to match a brand. A third-party UI kit saves that week and costs you later, when the kit’s opinion and the client’s design disagree and the widget you need to change lives in someone else’s package. We built skad to remove that trade-off. It is a small Flutter design system inspired by shadcn/ui: use it as a package, or copy the widgets into your project with a CLI and own the code from then on. It is published on pub.dev as skad, and the source is at github.com/kiridharan/skads-widget.
You own the code
The idea we borrowed from shadcn/ui is that a component library does not have to be a dependency. skad init creates lib/core and lib/widgets in your project and writes the token and theme files into them. skad add button writes the button’s source into lib/widgets/button. From then on it is your file. You can read it, change its padding, add a variant the client asked for, and nobody’s next release will undo your change.
Two details make this safe to use on a real project. The CLI checks for a pubspec.yaml before it writes anything, so it will not scatter files outside a Flutter project. And it never overwrites a file that already exists. Run skad add button twice and the second run skips your edited copy rather than resetting it. A copy-first tool that clobbers local changes defeats its own purpose.
For prototypes, or teams that prefer updates over ownership, the same widgets work as a normal package dependency. The choice is per project, not per library.
Tokens through ThemeExtension
Flutter’s ThemeExtension is the right home for brand tokens, and it is underused. skad’s SkadTokens is one: colours for background, foreground, primary, secondary, muted, destructive, border, focus ring and card, each with a matching foreground, plus four radii. Light and dark presets ship in SkadTheme.light() and SkadTheme.dark().
theme: SkadTheme.light(
tokens: SkadTokens.light().copyWith(
primary: Colors.indigo,
radiusMd: 12,
),
),
Because it is a ThemeExtension, it implements lerp, so switching between light and dark animates colours instead of snapping. Every widget reads its colours from the tokens and nothing else, which means a client’s brand becomes a single copyWith rather than a search through dozens of files. When a widget finds no tokens in the theme, it falls back to the light preset instead of crashing.
Motion as tokens too
Animation timing drifts fastest in a growing codebase. One developer uses 150 ms, another 250 ms, and the app starts to feel slightly inconsistent in a way nobody can name. SkadMotion fixes the vocabulary: fast at 100 ms for hover and press, normal at 200 ms for default transitions, slow at 300 ms for overlays, extraSlow at 500 ms for reveals, and a small set of named curves with ease-out as the default. The button animates its background in fast. The dialog enters in normal. A new widget picks from the list instead of inventing a number.
The next step is the one every motion system owes its users: reading the platform’s reduce-motion setting and shortening these durations to near zero when it is on. With durations already centralised, that is a change in one file.
Accessible by default, not by audit
Flutter apps increasingly run on the web and desktop, where people use keyboards. Accessibility is cheapest in the widget, so it lives there. SkadButton is wrapped in Semantics as a button with an enabled state, and uses FocusableActionDetector so Enter and Space activate it, hover shows on desktop and web, and keyboard focus draws a visible two-pixel ring in the token’s ring colour. A disabled button shows a “not allowed” cursor and ignores both taps and keys. The input has its own focus ring, label, helper and error text. The dialog uses the platform’s localised barrier label and can be dismissed from the keyboard.
None of this is unusual. It is just easy to skip when each developer builds their own button under deadline, which is why it belongs in shared code.
Why we use it on client builds
skad began as the set of widgets we kept rebuilding for client Flutter apps. It is deliberately small today: a button with five variants and four sizes plus loading and icon states, an input, a dialog, tokens, theme and motion. Version 0.1.0 is honest about that. For our work the value is not the widget count. It is that every new project starts with the same tested foundation, and the client still receives code they fully own, with no dependency on our release schedule.
What we’d tell a team building something similar
Put brand decisions in one place. Tokens in a ThemeExtension, motion in named constants, and widgets that read only from them.
If you offer copy-first components, never overwrite a file the user may have edited. Ownership has to survive the second run.
Build focus, keyboard and semantics into the first version of each widget. Retrofitting them across a codebase costs far more than writing them once.
If you’re planning a Flutter build and want it to stay maintainable, get in touch.