explaingit

google/flexbox-layout

Analysis updated 2026-06-21

18,337KotlinAudience · developerComplexity · 2/5Setup · easy

TLDR

An Android library that brings the web's flexible box layout system to Android apps, letting items grow, shrink, and wrap onto new lines without hard-coding positions.

Mindmap

mindmap
  root((FlexboxLayout))
    What it does
      Flexible layouts
      Wrapping items
      Responsive Android UI
    Two Modes
      FlexboxLayout view
      FlexboxLayoutManager
    Flexbox Controls
      Flow direction
      Line wrapping
      Item alignment
    Tech Stack
      Kotlin and Java
      Android SDK
    Audience
      Android developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build an Android screen where items wrap onto new rows automatically, like a CSS flexbox grid.

USE CASE 2

Display a long scrollable list of tags or chips in a RecyclerView that wraps to new lines without running out of memory.

USE CASE 3

Replace a rigid Android LinearLayout with a flexible container that sizes items based on available space.

What is it built with?

KotlinJavaAndroid

How does it compare?

google/flexbox-layoutsquare/picassoandroid/sunflower
Stars18,33718,83317,786
LanguageKotlinKotlinKotlin
Setup difficultyeasyeasymoderate
Complexity2/51/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Add the library as a Gradle dependency, requires an existing Android project set up in Android Studio.

In plain English

FlexboxLayout is a Kotlin/Java library for Android that brings the flexible box layout model, a system originally from web CSS, to Android applications. Flexbox is a way to arrange items in a container so that they can grow, shrink, and wrap onto new lines in a controlled way, making it easier to build responsive layouts without hard-coding exact positions. The library provides two ways to use it. The first is FlexboxLayout, a view container that works like Android's built-in LinearLayout or RelativeLayout, where you define the layout in XML or code and items are arranged at once. The second is FlexboxLayoutManager, which is designed to work inside a RecyclerView, Android's component for displaying long scrollable lists. Using FlexboxLayoutManager has the advantage of recycling off-screen views for reuse as the user scrolls, which uses significantly less memory when displaying many items. Both approaches support the main flexbox attributes such as controlling the direction items flow, whether items wrap to new lines, how items are aligned along both axes, and how individual items can grow or shrink relative to their siblings. The library is installed as a dependency via a build configuration file.

Copy-paste prompts

Prompt 1
Using Google's FlexboxLayout for Android, show me how to create a wrapping tag cloud of TextViews in an XML layout file.
Prompt 2
How do I use FlexboxLayoutManager inside a RecyclerView in Android to display items that wrap onto new rows?
Prompt 3
Write Android Kotlin code that uses FlexboxLayout to arrange a row of buttons that wrap to a new line when the screen is narrow.

Frequently asked questions

What is flexbox-layout?

An Android library that brings the web's flexible box layout system to Android apps, letting items grow, shrink, and wrap onto new lines without hard-coding positions.

What language is flexbox-layout written in?

Mainly Kotlin. The stack also includes Kotlin, Java, Android.

How hard is flexbox-layout to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is flexbox-layout for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub google on gitmyhub

Verify against the repo before relying on details.