A fast, minimal, cross-platform UI toolkit written in C++ with modern design principles.
A cross-platform graphics library designed for building beautiful user interfaces with simplicity and performance in mind. Fern provides a comprehensive widget system, flexible layout management, and seamless cross-platform rendering capabilities.
Fern Graphics offers developers a powerful yet intuitive framework for creating desktop applications with rich graphical interfaces. Built with modern C++ and featuring C bindings, Fern emphasizes clean APIs, efficient rendering, and cross-platform compatibility.
Key Features:
- Comprehensive widget system with buttons, text inputs, shapes, and custom components
- Flexible layout management with containers, spacing, and responsive design
- Cross-platform rendering (Linux native, Web via WebAssembly)
- Font rendering with TTF support
- Signal-slot event system for reactive programming
- Canvas-based drawing with primitive graphics support
- Memory-efficient design with minimal dependencies
Get started with Fern in minutes by following our comprehensive Getting Started Guide, which walks you through:
- Setting up your development environment
- Creating your first Fern application
- Understanding the core concepts
- Building and running examples
Fern is built around several core subsystems that work together to provide a cohesive development experience:
- Widget System: Hierarchical component architecture with built-in and custom widgets
- Layout Engine: Flexible positioning and sizing with containers and constraints
- Rendering Pipeline: Platform-abstracted graphics with efficient drawing operations
- Event System: Signal-slot based event handling for user interactions
- Font Management: TTF font loading and text rendering capabilities
Fern provides a rich set of built-in widgets and the tools to create custom components:
- Text: Styled text rendering with font customization
- Button: Interactive buttons with click handling
- Text Input: Single and multi-line text entry fields
- Shapes: Circles, lines, and custom geometric shapes
- Row/Column: Linear layout arrangement
- Padding: Spacing and margins around widgets
- Center: Widget centering and alignment
- Expanded: Flexible space distribution
- Sized Box: Constrain a widget to a fixed width and height.
- Center: Align a single child widget at the center of its parent.
- Slider: Value selection with customizable ranges
- Progress Bar: Visual progress indication
- Radio Buttons: Single-selection option groups
- Dropdown: Expandable selection menus
- Circular indicator: Spinning or static indicator for loading or progress feedback.
Learn more in the Widget System Documentation.
Fern targets multiple platforms with consistent APIs and behavior:
- Linux: Native rendering with X11/Wayland support
- Web: WebAssembly compilation for browser deployment
- Windows: Planned support with native Windows APIs
- macOS: Planned support with Cocoa integration
Comprehensive documentation is available in the docs/ directory:
- Getting Started Guide - Your first steps with Fern
- Widget Documentation - Individual widget guides and examples
- Core Systems - Deep dives into Fern's architecture
- Graphics and Styling - Colors, fonts, and visual customization
- Layout System - Positioning and arrangement strategies
- Cross-Platform Guide - Platform-specific considerations
We welcome contributions to Fern Graphics. Please read our Contributing Guidelines for details on:
- Code style and conventions
- Submitting pull requests
- Reporting issues and bugs
- Development setup and testing
- C++17 or later
- CMake 3.10+
- Platform-specific graphics libraries (varies by target)
Fern Graphics is released under the License. See the license file for complete terms and conditions.
Note: For developers seeking more direct control over graphics operations, we also provide comprehensive C-only documentation that covers the lower-level C API and manual memory management approaches.
