# facebook/litho

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/facebook-litho).**

7,771 stars · 763 forks · Kotlin · Apache-2.0

## Links

- GitHub: https://github.com/facebook/litho
- Homepage: https://fblitho.com
- awesome-repositories: https://awesome-repositories.com/repository/facebook-litho.md

## Description

Litho is an Android declarative UI framework and component library used to build user interfaces through a declarative API and immutable state. It functions as an asynchronous layout engine that maps components to a structured view hierarchy to automate view updates.

The framework optimizes rendering performance by computing element positions on background threads to prevent blocking the main UI thread. It further improves efficiency by flattening nested view hierarchies and caching layout results.

The system includes capabilities for state reconciliation, component recycling, and the rendering of 2D graphics and network images. It also provides tools for managing user gestures, tracking rendering timing markers, and visualizing component bounds for debugging.

A specialized plugin is available to integrate the framework with IntelliJ IDEA.

## Tags

### Mobile Development

- [Android Development](https://awesome-repositories.com/f/mobile-development/android-ecosystem/android-development.md) — Provides a comprehensive framework for building Android user interfaces using a declarative API and immutable state.
- [Layout Optimizations](https://awesome-repositories.com/f/mobile-development/android-layout-components/layout-optimizations.md) — Reduces memory overhead and rendering time by implementing component recycling and layout result caching.
- [Asynchronous Layout Calculation](https://awesome-repositories.com/f/mobile-development/asynchronous-layout-calculation.md) — Computes element positions on background threads to prevent blocking the main UI thread and eliminate stutter.
- [UI Performance Debugging](https://awesome-repositories.com/f/mobile-development/android-application-debugging/ui-performance-debugging.md) — Includes tools for visualizing component bounds and tracking rendering timing markers to optimize layout performance.

### Software Engineering & Architecture

- [UI Thread Responsiveness](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/frontend-rendering-loading/ui-thread-responsiveness.md) — Maintains UI thread responsiveness by offloading intensive layout computations to background threads.

### Graphics & Multimedia

- [Asynchronous Rendering Engines](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/text-rendering/asynchronous-rendering-engines.md) — Offloads layout calculations to background threads to prevent blocking the main user interface thread. ([source](https://github.com/facebook/litho#readme))

### User Interface & Experience

- [Declarative UI Frameworks](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/rendering-models/declarative-frameworks/declarative-ui-frameworks.md) — Provides a component-based model to describe the visual state of user interfaces in a declarative manner. ([source](https://github.com/facebook/litho#readme))
- [Declarative Component Architectures](https://awesome-repositories.com/f/user-interface-experience/declarative-component-architectures.md) — Implements a framework for building user interfaces through the hierarchical nesting of reusable, immutable visual elements.
- [Declarative Component Libraries](https://awesome-repositories.com/f/user-interface-experience/declarative-component-libraries.md) — Offers an architecture for defining reusable interface elements using declarative syntax and unidirectional data flow.
- [Declarative UI Components](https://awesome-repositories.com/f/user-interface-experience/declarative-ui-components.md) — Uses a declarative API to define UI components that map to a structured view hierarchy. ([source](https://github.com/facebook/litho/blob/master/build.gradle))
- [Diffing-Based State Updates](https://awesome-repositories.com/f/user-interface-experience/diffing-based-state-updates.md) — Calculates differences between interface versions to perform granular updates, increasing overall rendering speed. ([source](https://github.com/facebook/litho/blob/master/CHANGELOG.md))
- [Layout Engines](https://awesome-repositories.com/f/user-interface-experience/element-positioning/layout-engines.md) — Ships an engine that calculates the size and position of all UI elements asynchronously to maintain high responsiveness.
- [State Reconciliation Strategies](https://awesome-repositories.com/f/user-interface-experience/state-reconciliation-strategies.md) — Uses a reconciliation logic to compare state changes and apply the minimum necessary updates to the visual interface.
- [Hierarchy Flattening](https://awesome-repositories.com/f/user-interface-experience/composition-hierarchies/view-hierarchy-composition/adaptive-view-hierarchies/hierarchy-flattening.md) — Automatically reduces the number of nested containers to simplify the native view tree and improve efficiency. ([source](https://github.com/facebook/litho#readme))
- [Hierarchy Flattening](https://awesome-repositories.com/f/user-interface-experience/composition-hierarchies/view-hierarchy-composition/hierarchy-flattening.md) — Automatically reduces the number of nested containers to simplify the native view tree and improve rendering efficiency.
- [Layout Dimension Caching](https://awesome-repositories.com/f/user-interface-experience/scroll-interaction-handlers/scroll-state-controllers/scroll-to-index-mappers/layout-dimension-caching.md) — Caches computed element dimensions to avoid expensive redundant layout passes during view updates.
- [View Recycling Systems](https://awesome-repositories.com/f/user-interface-experience/view-recycling-systems.md) — Implements a view recycling system to reuse UI components, minimizing memory overhead when displaying large datasets. ([source](https://github.com/facebook/litho#readme))

### Web Development

- [Declarative UI Composition](https://awesome-repositories.com/f/web-development/declarative-ui-composition.md) — Implements a declarative paradigm for building complex user interfaces based on immutable inputs and functional composition.
- [View Recycling](https://awesome-repositories.com/f/web-development/dom-element-manipulators/view-recycling.md) — Reuses native platform view objects to minimize memory allocation and improve rendering performance.

### Part of an Awesome List

- [User Interface Components](https://awesome-repositories.com/f/awesome-lists/devtools/user-interface-components.md) — Declarative framework for building efficient UIs on Android.
