adaptive
Skill2 starsChanged 17 days agoMITView on GitHub
Instructions to make or update an app's UI so that it adapts to different
4 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- ncoevoet/facettheir own version, first seen Oct 8, 2026
- kid1412621/SummaryExpressiveedited, first seen Oct 8, 2026
- rosuH/EasyWatermarkedited, first seen Oct 8, 2026
- SimonHalvdansson/Harmonic-HNedited, first seen Oct 8, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- rosuH/EasyWatermark★ 1.9k99% same
- SimonHalvdansson/Harmonic-HN★ 1k58% same
- kid1412621/SummaryExpressive★ 21798% same
Wrote their own version · 1
- ncoevoet/facet★ 367same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a11y-auditSkill
- add-a11y-ruleSkill
- add-exporterSkill
- android-intent-securitySkill
- android-permissions-securitySkill
- crawl-appSkill
- design-systemSkill
- edge-to-edgeSkill
- extend-crawlerSkill
- ios-a11y-rulesSkill
- ios-simulatorSkill
- maintain-crawlerSkill
- play-policy-insightsSkill
- security-auditSkill
- security-rulesSkill
- stack-iosSkill
- stack-rulesSkill
- store-requirementsSkill
- tune-crawlerSkill
- wcag-mobile-rulesSkill
- web-uiSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 6 are common, 4 are distinctive, and 13 are very specific to this project.
6
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 28
Use Compose for all screens.
- Common: line 29
Use Jetpack Navigation 3. If it doesn't, suggest the Navigation 3 skill to migrate the app.
- Distinctive: line 44
Ensure that screenshot tests exist to verify the current UI on different form factors.
- Common: line 78
If you need to provide more screen space for the content, hide the navigation area.
- Common: line 84
When the detail screen is displayed full-screen on mobile, full-screen mode must be deactivated on larger screens.
- Very specific: line 97
If the navigation bar's visibility changes - it is hidden under certain scenarios or on certain screens - this behavior must be maintained …
- Very specific: line 105
Create an instance of NavigationSuiteScaffoldState using rememberNavigationSuiteScaffoldState() and pass it to NavigationSuiteScaffold.
- Very specific: line 106
When the navigation area visibility changes, use a LaunchedEffect to call show or hide on the NavigationSuiteScaffoldState.
- Very specific: line 160
Add the androidx.compose.material3.adaptive:adaptive-navigation3 library
- Very specific: line 161
Create an androidx.compose.material3.adaptive.navigation3.ListDetailSceneStrategy using rememberListDetailSceneStrategy
- Very specific: line 166
Add metadata using entry(metadata = ...) or NavEntry(metadata = ...) to the list entry using …
- Very specific: line 168
Use the detailPlaceholder parameter to add a placeholder on the detail screen when no list items are selected.
- Very specific: line 169
Add metadata to the detail entry using ListDetailSceneStrategy.detailPane().
- Common: line 173
When a detail screen displays its content full-screen on mobile (content fills the entire screen, bars or rails are hidden), full-screen …
- Very specific: line 187
If you haven't already, add the androidx.compose.material3.adaptive:adaptive-navigation3 library
- Very specific: line 193
Add metadata using entry(metadata = ...) or NavEntry(metadata = ...) to the main entry using SupportingPaneSceneStrategy.mainPane()
- Very specific: line 194
Add metadata to the supporting entry using SupportingPaneSceneStrategy.supportingPane()
- Common: line 198
If you have made changes, record new reference files.
- Very specific: line 205
Look for the following vertical list composables: LazyColumn, LazyVerticalGrid, LazyVerticalStaggeredGrid.
- Very specific: line 221
Look for any Column that contains multiple items of the same type and replace it with Grid.
- Distinctive: line 280
Check the FlexBox documentation:
- Distinctive: line 289
Check the MediaQuery documentation when you need to query the device's screen size, pointer precision, keyboard type, whether it has …
- Distinctive: line 295
Check the Grid documentation when you need to display a fixed number of items in a grid layout:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prerequisites
The app must:
- Use Compose for all screens. If it's still using Fragments or Views, suggest using the XML to Compose skill to migrate those screens.
- Use Jetpack Navigation 3. If it doesn't, suggest the Navigation 3 skill to migrate the app.
Workflow to make an app adaptive
To make an app adaptive, follow these steps or a subset of them adapting to the task.
- Step 1: Verify current UI
- Step 2: Make the navigation bar adaptive
- Step 3: Add multi-pane layouts
- Step 4: Make vertical lists adaptive by changing the number of columns
- Step 5: Hide app bars when scrolling
Step 1. Verify current UI
Ensure that screenshot tests exist to verify the current UI on different form factors. If they don't exist, add the Compose Preview Screenshot Testing tool. Use the following annotation to create previews for all the major form factors. For example:
@Preview(name = "Phone", device = Devices.PHONE, showBackground = true)
@Preview(name = "Foldable", device = Devices.FOLDABLE, showBackground = true)
@Preview(name = "Tablet", device = Devices.TABLET, showBackground = true)
@Preview(name = "Desktop", device = Devices.DESKTOP, showBackground = true)
annotation class FormFactorPreviews
@PreviewTest
@FormFactorPreviews
@Composable
fun FeedScreenPreview() {
SnippetsTheme {
Box {
Text("My Screen")
}
}
}<br />Step 2. Make the navigation bar adaptive
Bottom navigation bars are optimized for touch input when the user is holding a phone in portrait mode. On larger screen hand-held devices, like tablets and unfolded foldables, the navigation area must be accessible from the edge of the screen (navigation rail).
If you need to provide more screen space for the content, hide the navigation area. Examples of this include:
- Hiding the navigation bar when the user scrolls down and showing it again when the user scrolls up. The assumption is that when the user is scrolling down, they are consuming content but when scrolling up they are trying to navigate away from that content.
- Hiding the navigation area when its content is distracting. For example, in camera previews or when displaying a full-screen photo.
When the detail screen is displayed full-screen on mobile, full-screen mode must be deactivated on larger screens.
Steps to migrate:
- Locate the existing navigation bar.
- Convert each item to a
NavigationSuiteItem. - Identify whether the navigation bar's visibility changes. For example, if it is wrapped with an
AnimatedContentorAnimatedVisibilitycomposable. If so, follow the guidance in the "Control navigation area visibility". - Replace the container that held the navigation bar (often a
Scaffold) withNavigationSuiteScaffoldfrom the Material 3 adaptive layouts library. - Supply the navigation items using the
navigationItemsparameter ofNavigationSuiteScaffold.
Step 2.1. Control navigation area visibility
If the navigation bar's visibility changes - it is hidden under certain
scenarios or on certain screens - this behavior must be maintained with the
adaptive navigation area. This is done using NavigationSuiteScaffold's state
parameter.
Steps to migrate:
- Identify the scenarios under which the navigation bar is hidden. This is usually done with a boolean variable for the visibility. Use
isNavBarVisibleorshouldShowNavBaras the variable name. - Create an instance of
NavigationSuiteScaffoldStateusingrememberNavigationSuiteScaffoldState()and pass it toNavigationSuiteScaffold. - When the navigation area visibility changes, use a
LaunchedEffectto callshoworhideon theNavigationSuiteScaffoldState.
For example:
// Pass this variable to any composable that needs to control the navigation area visibility
var isNavBarVisible by remember { mutableStateOf(true) }
val scaffoldVisibilityState = rememberNavigationSuiteScaffoldState()
NavigationSuiteScaffold(
navigationSuiteItems = navItems,
state = scaffoldVisibilityState
) {
// Main content
}
LaunchedEffect(isNavBarVisible){
if (isNavBarVisible) {
scaffoldVisibilityState.show()
} else {
scaffoldVisibilityState.hide()
}
}<br />Step 3. Add multi-pane layouts using Navigation 3 Scenes
Analyze the codebase looking for related screens - tapping on something in one screen opens another screen that shows information related to the first. There are two canonical screen relationships: list-detail and supporting pane.
IMPORTANT: You must use the Navigation 3 SceneStrategy approach to implement
multi-pane layouts. Do not use ListDetailPaneScaffold or
SupportingPaneScaffold.
Step 3.1. List-detail
Identify the list and detail screens
List-detail layouts display a list of items (this is the list screen) and clicking on an item opens a new screen that shows more details about that item (the detail screen).
Typical usage includes productivity apps like email, notes, and messaging.
Unless requested explicitly, avoid this pattern when the detail content requires substantial screen space (e.g., images or media that benefits from a full-screen presentation).
Add a Material list-detail SceneStrategy
- Add the
androidx.compose.material3.adaptive:adaptive-navigation3library - Create an
androidx.compose.material3.adaptive.navigation3.ListDetailSceneStrategyusingrememberListDetailSceneStrategy - Pass the
ListDetailSceneStrategytoNavDisplayusing itssceneStrategiesparameter
Use metadata to identify the list and detail screens
- Add metadata using
entry(metadata = ...)orNavEntry(metadata = ...)to the list entry usingListDetailSceneStrategy.listPane(detailPlaceholder = { <placeholder composable> }). - Use the
detailPlaceholderparameter to add a placeholder on the detail screen when no list items are selected. - Add metadata to the detail entry using
ListDetailSceneStrategy.detailPane().
Important considerations
- When a detail screen displays its content full-screen on mobile (content fills the entire screen, bars or rails are hidden), full-screen mode must be deactivated if it's part of a list-detail layout.
- Detail screens must not show a back arrow when on a list-detail layout.
For a reference implementation, check the Nav3 Material List Detail recipe.
Step 3.2. Supporting pane
Identify supporting pane screens where a main screen displays a single item, and selecting it opens a "supporting screen" with more details. The supporting screen complements the main screen and is shown in a supporting pane.
Add a Material supporting pane SceneStrategy
- If you haven't already, add the
androidx.compose.material3.adaptive:adaptive-navigation3library - Create an
androidx.compose.material3.adaptive.navigation3.SupportingPaneSceneStrategyusingrememberSupportingPaneSceneStrategy - Pass the
SupportingPaneSceneStrategytoNavDisplayusing itssceneStrategiesparameter
Use metadata to identify the main and supporting screens
- Add metadata using
entry(metadata = ...)orNavEntry(metadata = ...)to the main entry usingSupportingPaneSceneStrategy.mainPane() - Add metadata to the supporting entry using
SupportingPaneSceneStrategy.supportingPane()
Step 3.3. Run screenshot tests
If you have made changes, record new reference files. Ask the user to visually verify that the new layouts are correct.
Step 4. Make vertical lists adaptive by changing the number of columns
Step 4.1. Make lazy lists adaptive
Look for the following vertical list composables: LazyColumn,
LazyVerticalGrid, LazyVerticalStaggeredGrid.
Steps to migrate:
- Choose a suitable minimum width in dp for the column. The item must be clearly visible to the user at this width.
- For
LazyColumn: change to aLazyVerticalGridand follow the instruction later - For
LazyVerticalGrid: change thecolumnsparameter to useGridCells.Adaptive(<width>.dp) - For
LazyVerticalStaggeredGrid: change thecolumnsparameter to useStaggeredGridCells.Adaptive(<width>.dp)
Step 4.2. Migrate non-lazy lists to Grid
WARNING: Grid is an experimental API available from Compose 1.11.0-beta01. Confirm with the user that they are happy to use an experimental API in their codebase.
Look for any Column that contains multiple items of the same type and replace
it with Grid. Do not replace it with LazyVerticalGrid or any other lazy
layout. Do not place Grid inside the existing Column. Completely replace it.
Grid is configured by supplying a lambda (an extension function on
GridConfigurationScope) to its config parameter. Inside the lambda,
constraints provides the minimum and maximum dimensions of the grid container
and can be used to change the number of rows and columns based on the available
size. For example, the following code configures Grid such that when the
available width is:
- less than 800dp, a 2x4 grid is used
- 800dp or more, a 4x2 grid is used
Grid(
config = {
val maxWidthDp = constraints.maxWidth.toDp()
val (cols, rows) = if (maxWidthDp < 800.dp){
2 to 4
} else{
4 to 2
}
val gapSizeDp = 8.dp
val cellSize = ((maxWidthDp - (gapSizeDp * (cols - 1))) / cols).coerceAtLeast(0.dp)
repeat(cols) { column(cellSize) }
repeat(rows) { row(cellSize) }
gap(gapSizeDp)
}
) { /** items **/ }<br />Grid is an experimental API so add the @OptIn(ExperimentalGridApi::class)
annotation to any function that uses it.
Step 5: Hide App Bars when scrolling
In an app with multiple top-level destinations, each screen must manage its own app bar state independently. There are two main scroll behaviors:
exitUntilCollapsedScrollBehavior: Hides on scroll down, stays hidden while you scroll up until you reach the very top (0 offset).enterAlwaysScrollBehavior: Hides on scroll down, shows immediately on scroll up.
Final step: Build and test
Build the app and run the local tests. If the project has screenshot tests, run them but DO NOT update the reference images. Prompt the user to do this after they have viewed the screenshot diffs.
Additional documentation for experimental adaptive APIs
The following APIs are available from Compose 1.11.0-beta01.
FlexBox
Check the FlexBox documentation:
- Overview
- Get started - setup
- Set container behavior
- Set item behavior
MediaQuery
Check the MediaQuery documentation when you need to query the device's screen size, pointer precision, keyboard type, whether it has cameras or microphones, and other device capabilities.
Grid
Check the Grid documentation when you need to display a fixed number of items in a grid layout:
- Overview
- Get started - setup
- Set container properties
- Set item properties
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

