Skip to content

facebook/litho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

generatedunixname89002005232357facebook-github-bot
generatedunixname89002005232357
and
Mar 21, 2025
685dfb4 · Mar 21, 2025
Jan 23, 2025
Feb 11, 2025
Oct 26, 2017
Mar 20, 2025
Jun 27, 2024
Mar 20, 2025
Mar 14, 2025
Jan 16, 2025
Mar 20, 2025
Mar 14, 2025
Mar 14, 2025
Jan 8, 2025
Nov 27, 2024
Oct 17, 2024
Jun 27, 2024
Mar 17, 2025
Nov 27, 2024
Jan 30, 2025
Oct 3, 2024
Mar 20, 2025
Mar 9, 2025
Mar 14, 2025
Mar 14, 2025
Mar 14, 2025
Aug 14, 2024
Aug 23, 2024
Sep 16, 2024
Aug 23, 2024
Sep 9, 2024
Feb 17, 2025
Mar 6, 2025
Oct 30, 2024
Oct 8, 2024
Oct 8, 2024
Jan 21, 2025
Mar 19, 2025
Feb 15, 2025
Feb 17, 2025
Oct 18, 2024
Sep 9, 2024
Mar 21, 2025
Oct 23, 2024
Mar 14, 2025
Mar 14, 2025
Mar 14, 2025
Mar 14, 2025
Mar 14, 2025
Mar 14, 2025
Jun 13, 2024
Mar 17, 2025
Mar 21, 2025
Mar 21, 2025
Mar 14, 2025
Oct 8, 2024
Dec 16, 2024
Mar 18, 2025
Jun 27, 2024
Nov 19, 2024
Mar 7, 2025
Dec 19, 2024
Jul 30, 2020
Jun 3, 2021
Oct 8, 2024
Mar 14, 2025
Oct 7, 2024
Aug 30, 2019
Aug 10, 2018
Oct 10, 2018
Sep 9, 2024
Apr 18, 2017
Mar 11, 2025
Oct 8, 2024
Oct 16, 2019
Oct 16, 2019
Feb 15, 2025

Litho GithubCI Bintray Join the chat at https://gitter.im/facebook/litho License

Litho is a declarative framework for building efficient UIs on Android.

  • Declarative: Litho uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of immutable inputs and the framework takes care of the rest.
  • Asynchronous layout: Litho can measure and layout your UI ahead of time without blocking the UI thread.
  • View flattening: Litho uses Yoga for layout and automatically reduces the number of ViewGroups that your UI contains.
  • Fine-grained recycling: Any component such as a text or image can be recycled and reused anywhere in the UI.

To get started, check out these links:

Installation

Litho can be integrated either in Gradle or Buck projects. Read our Getting Started guide for installation instructions.

Quick start

1. Initialize SoLoader in your Application class.

public class SampleApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, false);
  }
}

2. Create and display a component in your Activity

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final ComponentContext c = new ComponentContext(this);

    final Component component = Text.create(c)
        .text("Hello World")
        .textSizeDip(50)
        .build();

    setContentView(LithoView.create(c, component));
}

Run sample

You can find more examples in our sample app.

To build and run (on an attached device/emulator) the sample app, execute

$ buck fetch sample
$ buck install -r sample

or, if you prefer Gradle,

$ ./gradlew :sample:installDebug

Contributing

Before contributing to Litho, please first read the Code of Conduct that we expect project participants to adhere to.

For pull requests, please see our CONTRIBUTING guide.

See our issues page for ideas on how to contribute or to let us know of any problems.

Please also read our Coding Style and Code of Conduct before you contribute.

Getting Help

  • Post on StackOverflow using the #litho tag.
  • Chat with us on Gitter.
  • Join our Facebook Group to stay up-to-date with announcements.
  • Please open GitHub issues only if you suspect a bug in the framework or have a feature request and not for general questions.

License

Litho is licensed under the Apache 2.0 License.