$ show microsoft/fluentui-apple
This repository is a comprehensive native UI component library that implements Microsoft's Fluent Design System for Apple platforms (iOS, macOS, and visionOS). It provides over 30 reusable controlsβsuch as buttons, avatars, tables, navigation bars, date pickers, tooltips, and notificationsβeach backed by a sophisticated token-based theming system. The architecture is modular: a common core (`FluentUI_common`) defines design tokens, themes, and utilities, while platform-specific modules (`FluentUI_iOS`, `FluentUI_macOS`) contain UIKit and AppKit implementations. Both SwiftUI and UIKit are supported, with bridging components like `ControlHostingView` and `MSF*` wrapper classes. The library is distributed via CocoaPods and Swift Package Manager, and includes extensive demo apps and UI tests. The codebase is actively maintained, with CI pipelines, localization automation, and regular commits. The standout feature is the token system (`ControlTokenSet`, `TokenSet`, `DynamicColor`), which provides a clean, extensible abstraction for theming that could be extracted and reused in other projects.
The LLM identified 6 files worth highlighting for reuse:
Defines `ControlTokenSet`, a generic container for design tokens (colors, fonts, shadows) that maps token keys to theme values. Supports per-control overrides and theme-wide overrides. This is the core of the theming system and could be extracted as a standalone library for any UIKit/SwiftUI project needing a flexible token-based theming solution.
A small, self-contained utility that synchronizes `CABasicAnimation` instances across multiple views by sharing a common `beginTime`. Useful for shimmer effects or any coordinated animation. Demonstrates a clean, reusable pattern for animation synchronization without external dependencies.
Defines the `Obscurable` protocol and provides `BlurringView` and `DimmingView` implementations. This pattern allows any view to be used as a modal background with blur or dim effects. The protocol is minimal and the implementations are self-contained, making it easy to reuse in other projects for custom modal presentations.
A custom `UIPresentationController` that implements a drawer-style presentation (top, bottom, left, right) with shadow, dimming, and keyboard-aware resizing. Handles interactive dismissal and expansion. This is a complex, well-crafted component that could be extracted and used in any UIKit app needing a flexible drawer.
A reusable bottom sheet controller with collapsed/expanded states, resizing handle, dimming view, and spring animations. Uses `UIViewPropertyAnimator` and `UISpringTimingParameters` for smooth transitions. The rubber-banding and expansion logic are well-implemented and isolated, making this a strong candidate for extraction into a standalone bottom sheet library.
A reusable calendar grid view with a custom `UICollectionViewLayout` and data source protocol. Supports single/multiple selection, date ranges, and various cell types (day, month, year). The layout and data source are decoupled, allowing reuse in any calendar or grid-based component. Demonstrates advanced collection view customization.