Flutter

The Flutter package. Icons ship as precompiled vector_graphics bytecode, so there's no SVG parsing at runtime, and each icon has a typed accessor on OpenbaseIcons.

What you can do:

  • Render any icon with OpenbaseIcons.<name>()
  • Switch weight and appearance with IconWeight and IconAppearance
  • Morph any icon into any other with MorphIcon from package:openbase_icons/morph.dart
  • Tint from the ambient IconTheme, like Material icons

Installation

Add the package as a git dependency (pub.dev release coming), then run flutter pub get.

pubspec.yaml
dependencies:
  openbase_icons:
    git:
      url: https://github.com/Try-Openbase/icons.git
      ref: main            # pin a tag in real projects
      path: packages/icons_flutter

Basic usage

main.dart
import 'package:openbase_icons/openbase_icons.dart';

Row(
  children: [
    OpenbaseIcons.home(),                                   // outline, 24px
    OpenbaseIcons.bell(weight: IconWeight.filled),
    OpenbaseIcons.heart(
      appearance: IconAppearance.raised,
      size: 32,
      color: const Color(0xFFE11D48),
    ),
  ],
)
Note: Without an explicit color, icons use IconTheme.of(context).color, then Theme.of(context).colorScheme.onSurface, so they tint correctly inside app bars, list tiles and buttons.

Props

Every OpenbaseIcons.<name>() accessor takes the same named arguments.

PropTypeDefaultDescription
weightIconWeightIconWeight.outlineoutline or filled
appearanceIconAppearanceIconAppearance.flatflat, raised or drawn
sizedouble24.0Width and height in logical pixels
colorColor?IconTheme colourTint; falls back to IconTheme, then onSurface
semanticLabelString?nullAnnounced by screen readers when set
keyKey?nullWidget key

OpenbaseIconBase (what the accessors return) also takes raisedStyle: RaisedStyle? to change the raised appearance's edge colours.

Icon weights

Every icon comes in two weights, drawn on the same 24 grid with the same shapes, so switching weight never moves anything.

Outline

weight="outline"

Filled

weight="filled"

Using weights
OpenbaseIcons.home()                              // outline (default)
OpenbaseIcons.home(weight: IconWeight.filled)

Appearances

Each weight renders three ways:

  • Flat: the icon as drawn.
  • Raised: glossy, engraved ink: a gradient over the icon's own colour with soft inner edges. Painted at runtime, so it follows color.
  • Drawn: the icon redrawn with a seeded hand-drawn pen. Generated from the flat icon, so it always matches.

Flat

appearance="flat"

Raised

appearance="raised"

Drawn

appearance="drawn"

Using appearances
OpenbaseIcons.heart()                                         // flat (default)
OpenbaseIcons.heart(appearance: IconAppearance.raised)
OpenbaseIcons.heart(appearance: IconAppearance.drawn, weight: IconWeight.filled)
Tip: Raised shows its shading best from 32px up; at 16–24px it reads as a soft gradient.

Morphing

MorphIcon animates from one icon to any other with spring physics. Morph data lives on OpenbaseMorphIcons: home, homeFilled, homeDrawn and homeFilledDrawn.

Outline

Heart ↔ Star

Filled, raised

raised

Plus ↔ X

rotation from geometry

Morphing
import 'package:openbase_icons/morph.dart';

// 1. Change the icon: it animates
MorphIcon(icon: open ? OpenbaseMorphIcons.x : OpenbaseMorphIcons.plus, raised: true)

// 2. Drive the progress yourself (drags, scroll)
MorphIcon.controlled(from: OpenbaseMorphIcons.home, icon: OpenbaseMorphIcons.homeFilled, progress: t)

// 3. Imperative
final key = GlobalKey<MorphIconState>();
MorphIcon(key: key, icon: OpenbaseMorphIcons.sun);
key.currentState?.morphTo(OpenbaseMorphIcons.moonFilled);

// Pairs, and lookup by file name
OpenbaseMorphIcons.plus.morphTo(OpenbaseMorphIcons.x).icon(progress: t);
MorphIcon(icon: OpenbaseMorphIcons.byName['arrow-left']!.filled)

Options: spring (SpringPreset.snappy default, .smooth, .bouncy), size, color, raised, semanticLabel, reducedMotion (MorphReducedMotion.never default, .user, .always).

Styling & colour

Pass color, or let icons pick it up from the theme:

Theming
IconTheme(
  data: const IconThemeData(color: Colors.indigo),
  child: OpenbaseIcons.home(),           // indigo
)

// The raised appearance's edge colours
OpenbaseIconBase(
  name: 'heart',
  appearance: IconAppearance.raised,
  raisedStyle: const RaisedStyle(highlight: Color(0xE6FFFFFF), edge: Color(0x66000000)),
)

Raised picks RaisedStyle.light or RaisedStyle.dark from the theme brightness by default.

Accessibility

Icons are excluded from semantics unless you give them a semanticLabel. Give one to icons that carry meaning on their own, such as an icon-only button's icon.

Semantics
OpenbaseIcons.home(semanticLabel: 'Go home')

MorphIcon(
  icon: OpenbaseMorphIcons.heart,
  semanticLabel: 'Like',
  reducedMotion: MorphReducedMotion.user, // honour "remove animations"
)

Performance

  • Icons are precompiled .vg bytecode: no XML parsing at runtime, and small assets.
  • Raised paints a few extra layers per icon; it's cheap at icon sizes, but avoid animating hundreds at once.
  • OpenbaseMorphIcons.byName references every icon's morph data; prefer the named fields (OpenbaseMorphIcons.heart) so unused data can be dropped.

Adding icons

Contributing an icon means drawing two SVGs, outline and filled, with the same file name. Everything else is generated: the drawn appearance, React components, Flutter assets, Compose vectors, and morph data for all three packages. Raised needs no files.

In the repo
# 1. Draw and save both weights
data/icons/outline/rocket.svg
data/icons/filled/rocket.svg

# 2. Generate drawn, React, Flutter, Compose, morph data and the site's list
pnpm run generate:all

# 3. Build and check
pnpm run build:all

The full guide, including the drawing rules, is docs/ADDING_ICONS.md in the repository.

Troubleshooting

  • Icons don't take my colour. Pass color, or wrap them in an IconTheme.
  • Assets aren't found. Run flutter pub get after adding the dependency, and keep path: packages/icons_flutter.
  • Raised looks flat. It's subtle below 32px by design. Check it at 32px or larger.
  • An icon is missing. Search the icons page: names follow the file names (arrow-up-right → ArrowUpRightIcon, OpenbaseIcons.arrowUpRight).
NextJetpack Compose