Alter

A lightweight, mobile-first design system built for Flutter applications, featuring curated Geist typography, semantic tokens, and modular UI components.


🚀 Getting Started

1. Add Dependency

Add alter to your pubspec.yaml:

dependencies:
  alter: ^3.0.0

2. Import Alter

Import the single barrel file into your Dart code:

import 'package:alter/alter.dart';

3. App-Level Theme Setup

Set fontFamily: AlterTypography.geistFont in your main MaterialApp theme:

MaterialApp(
  theme: ThemeData(
    fontFamily: AlterTypography.geistFont,
    scaffoldBackgroundColor: AlterSemanticTokens.baseWhite,
  ),
  home: const HomeScreen(),
);

🎨 Styles & Tokens Architecture

Alter organizes design tokens into foundational layers:

  • AlterColors: 234 raw color palette swatches extracted from Figma design variables.
  • AlterSemanticTokens: Semantic color mappings (baseWhite, baseGray, interactivePrimary, textPrimary, stroke100, statusSuccess, etc.).
  • AlterTypography: Text style scale tokens (display, displayXl, h1Serif, h1Bold, h2, h3, bodyLgBold, body, caption, etc.).
  • AlterDeviceScope: Inherited device mode (AlterDevice.pc / AlterDevice.mobile) propagation scope ensuring child components synchronize layout with parent grid/marker state without individual viewport queries.

🧩 Components Catalog

Web & Navigation (lib/web/, lib/mobile/, lib/components/tabs/)

  • ApplicationHeader: Responsive web & desktop application header supporting brand unit, navigation tabs, composite actions, and profile avatar slots.
  • ApplicationHeaderMobile: Top mobile navigation header with title, subtitle, return button, composite action buttons, and animated child slot.
  • Tabs: Horizontal segment/navigation control composed of TabItem sub-components with icon and label support.
  • TabItem: Atomic tab button supporting label, leading icon, and active states.
  • AlterBottomNavigationBar: Floating pill bottom navigation bar with responsive tab items.
  • BottomNavigationBarAction: Bottom navigation bar composed with primary/secondary action triggers.
  • BottomNavigationButton: Primary call-to-action button embedded in bottom navigation.

Sites & Responsive Blocks (lib/sites/)

  • BiographyBlock: Responsive entity and biography card with logo, title, badges, and bio description (Tall & Wide).
  • BrandBlock: Responsive social proof and partner brand showcase block.
  • FooterBlock: Responsive footer block with contact email, copy-to-clipboard action, and social profile links.
  • GraphicsBlock: Responsive project and portfolio card molecule supporting single & multi-item carousels for images, animated GIFs, and viewport-aware autoplay videos.
  • GraphicsCarouselBlock: Responsive full-width horizontal carousel block for visual showcases.
  • GraphicsGridBlock: Responsive project grid layout (PC 2-column, Mobile 1-column) consuming GraphicsBlock cards with device scope synchronization.
  • HeaderBlock: Responsive section header block with expandable divider line and bold title.
  • HeroBlock: Responsive hero banner section block with avatar, display typography headline, subtitle, and action buttons for landing pages.
  • HeroProjectsBlock: Responsive project case study hero block with logo, title, metadata grid, notice banner, tech stack, and action links.
  • MobileMockupBlock: Responsive mobile screen showcase and entity card (428:926 iPhone container) supporting images, GIFs, and viewport-aware autoplay looping videos with BiographyBlock.
  • MobileMockupsGridBlock: Responsive mobile screen showcase grid & carousel with unified BiographyBlock entity metadata supporting image and video lists with viewport autoplay.

Inputs (lib/components/inputs/)

  • InputControl: Configurable surface primitive with multiline bounds safety, leading/trailing slots, hover/focus rings, and error message container.
  • TextInput: Full FormField<String> wrapper with TextInputMode filters, deferred isRequired validation on blur, and direct keyboardType fallback override.
  • TextAreaInput: Multiline text area supporting both fixed reserved lines (lines: 4) and dynamic adaptive height (minLines: 1) that expands as users type.
  • NumericInput: Live comma grouping (International and Indian systems), decimal precision limits, bounds validation (minValue/maxValue), and trailing action slot.
  • CurrencyInput: Financial currency entry preset with Euro default icon, 2-decimal precision, and prefix formatting.
  • PasswordInput: Secure input with interactive eye visibility toggle, built-in space denial, character limits, and strength validation rules.
  • SearchInput: Search entry field with leading search icon, auto-clearing close button, and search keyboard action.
  • OTPInput: Multi-box pin verification control with digit filtering, auto-focus forwarding, and backspace navigation.

Buttons (lib/components/buttons/)

  • ButtonText: Text buttons with ButtonType (gray, white, primary, red) and ButtonSize (normal, large).
  • ButtonIcon: Square icon buttons (48x48, 64x64) with selection state and accent colors.
  • ButtonIconGhost: Borderless ghost icon buttons with gesture hooks (onTap, onLongPress).
  • ButtonGraphicText: Dual-label badge button (customizable title & subtitle).
  • ButtonGraphicImage: Compact icon button container.

Selects & Toggles (lib/components/selects/)

  • Checkbox: Tri-state selection control supporting unchecked, intermediate, and checked states.
  • Radio: Single-selection control with token-driven active/inactive states.
  • Switch: Smooth animated toggle switch with Alter semantic color fills.
  • ToggleIcon: Outlined/filled Material-style icon toggle with color fallback.
  • ToggleText: Text-based segmented/tabbed toggle button with animated sliding indicator.

Pills & Badges (lib/components/pills/)

  • Pill: Status badge & filter pill with animated cross-fades across default and compact sizes.
  • AdvancedPill: Multi-segment status tag with customizable leading/trailing slots and interactive press states.
  • Badge: Count badge and status dot indicator with multiple color variants and auto-overflow formatting (99+).

Status & Feedback (lib/components/status/)

  • Toast: Floating banner notification component with success, warning, danger, and info semantic variants.
  • FeedbackText: Inline form helper and error message caption with semantic iconography.

Utilities & Media (lib/components/utilities/)

  • AlterMediaView: Universal media presentation widget supporting static images, animated GIFs, and muted looping autoplay videos with viewport visibility detection.
  • Avatar: Compact user and entity avatar supporting image and placeholder icon variants.
  • CarouselControl: Carousel navigation overlay control bar providing chevron previous/next triggers.
  • Divider: 1px content divider line supporting horizontal and vertical orientations.
  • ListItem: Universal list tile with title, subtitle, leading action slot, and dual trailing slots.

📖 Live Interactive Documentation (Widgetbook)

Check out the interactive catalog and workbench in the example/ directory:

cd example
flutter run -d chrome

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Libraries

alter
A lightweight, mobile-first Flutter design system featuring curated Geist typography, semantic tokens, and modular UI components.
components/buttons/button_graphic_image
components/buttons/button_graphic_text
components/buttons/button_icon
components/buttons/button_icon_ghost
components/buttons/button_text
components/inputs/currency_input
components/inputs/input_control
components/inputs/numeric_input
components/inputs/otp_input
components/inputs/password_input
components/inputs/search_input
components/inputs/text_area_input
components/inputs/text_input
components/node/node_item
components/pills/advanced_pill
components/pills/badge
components/pills/pill
components/selects/checkbox
components/selects/radio
components/selects/switch
components/selects/toggle_icon
components/selects/toggle_text
components/status/feedback_text
components/status/toast
components/tabs/tab_item
components/tabs/tabs
components/utilities/alter_media_view
components/utilities/avatar
components/utilities/divider
components/utilities/list_item
foundations/device_scope
mobile/application_header_mobile/application_header_mobile
mobile/bottom_navigation/bottom_navigation_bar
mobile/bottom_navigation/bottom_navigation_bar_action
mobile/bottom_navigation/bottom_navigation_button
mobile/bottom_navigation/bottom_navigation_item
sites/biography_block
sites/brand_block
sites/graphics_block
sites/graphics_grid_block
sites/header_block
sites/hero_block
sites/hero_projects_block
sites/mobile_mockup_block
sites/mobile_mockups_grid_block
styles/swatches
styles/tokens
styles/typography
web/application_header/application_header
web/application_header/application_header_button_icon
web/application_header/application_header_button_text