Composing an API the *right* way
summary
Summary of Jetpack Compose API guidelines: prefers UpperCamelCase for constant-like values and distinguishes composables that emit UI as noun constructors from those that return values in lowerCamel; components must emit one root node and return Unit; state should be passed as plain values or callbacks (avoid MutableState), or wrapped in a remembered stateholder via a factory; provide a Modifier parameter named modifier as the first optional param and apply it to the root; use slots and movableContentOf to move reusable UI efficiently; AndroidX docs ~13,000 words and lint rules enforce many checks.
AI-written summary · about
chapters (14)
- 0:00API design in Compose
- 2:26Naming Compose constants
- 3:51Naming composables by behavior
- 6:15Components emit one root node
- 8:23Avoid state ownership in components
- 10:31Composition locals for globals
- 11:55Default arguments benefits
- 14:43Modifiers for customization
- 20:08Slots for UI parameters
- 25:06Parameter ordering in composables
- 27:56State in Compose components
- 30:43State holders for complex state
- 33:51API design across layers
- 34:32Additional resources & Q&A
related talks
39mComposing an API the *right* way
41mComposing an API the *right* way
37m5 Easy steps to build a Compose API
28mUnlocking Seamless Collaboration: Design-First APIs for Components
27mModern Java API Design
49mLet's make a contract: the art of designing a Java API
25mEverything is an API
41mWho Is That API For? Practical User‑Focused Techniques for Android Library Design
