Creating a local Expo module for Jetpack Compose
Create a local Expo module using the command: npx create-expo-module@latest --local my-ui. This sets up the scaffolding for a module that can contain custom Jetpack Compose components.
Expo & React Native · all subjects
14 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.
Create a local Expo module using the command: npx create-expo-module@latest --local my-ui. This sets up the scaffolding for a module that can contain custom Jetpack Compose components.
To enable Jetpack Compose in a module's android/build.gradle: add the Kotlin Compose compiler plugin classpath in buildscript dependencies (org.jetbrains.kotlin.plugin.compose.gradle.plugin at ${kotlinVersion}), apply the 'org.jetbrains.kotlin.plugin.compose' plugin, and set buildFeatures.compose to true in the android block.
A module extending Expo UI requires these dependencies: if findProject(':expo-ui') exists, implement project(':expo-ui'); otherwise implement 'expo.modules.ui:expo.modules.ui:+'. Also add androidx.compose.foundation:foundation-android:1.10.6, androidx.compose.ui:ui-android:1.10.6, and androidx.compose.material3:material3:1.5.0-alpha17.
A props data class for a custom Compose view must: be annotated with @OptimizedComposeProps, implement ComposeProps, and include a modifiers: ModifierList field (with default emptyList()) for the modifiers prop.
A @Composable content function must be an extension on FunctionalComposableScope and take the props data class as a parameter. Inside, call ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher) to apply modifiers, and call Children(UIComposableScope()) to render React children.
Register a custom Compose view in the module definition using ExpoUIView<PropsType>("ViewName") { Content { props -> ComposableFunction(props) } }. This wires the @Composable content function into the Expo modules view system and makes it available to JavaScript.
Use createViewModifierEventListener from @expo/ui/jetpack-compose/modifiers to enable event-based modifiers like clickable and onVisibilityChanged on custom views. Spread the result in the native view props when modifiers are present: {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}.
A custom modifier's parameters must be defined as an @OptimizedRecord data class implementing Record, with fields decorated using @Field and default values specified.
Import expo.modules.ui.compose and use the compose extension property on android.graphics.Color? to convert Android Color parsed from JavaScript into androidx.compose.ui.graphics.Color that Compose APIs expect. This is the same helper Expo UI's built-in modifiers use.
Register custom modifiers in OnCreate and unregister them in OnDestroy in the module definition. This prevents the modifier factory from leaking across module reloads.
The ModifierRegistry.register lambda receives four parameters: map (raw map from JavaScript), ComposableScope (for scope-dependent modifiers), AppContext, and an event dispatcher. Convert the map using recordFromMap<T>(map) to parse parameters.
Create a TypeScript function that calls createModifier('modifierName', params) from @expo/ui/jetpack-compose/modifiers. This builds the modifier configuration object that can be passed to component modifiers prop.
Expo UI is not available in Expo Go. To use Expo UI with custom components, create a development build of your app.
A custom component integrates with built-in modifiers through the modifiers prop, which can be used with any @expo/ui built-in modifiers like paddingAll, background, and clip.
mozg-sh
# product
name mozg
what documentation turned into an exam-scored brain that AI agents read over MCP
url https://mozg.sh
source https://github.com/egorfedorov/mozg (AGPL-3.0, self-hostable)
ask https://mozg.sh/chat — a person answers
# current-page
path /b/mozg/expo/notes/expo-ui-jetpack-compose
# connect
endpoint https://mozg.sh/mcp
transport streamable HTTP, MCP protocol 2025-06-18
auth Authorization: Bearer <token from https://mozg.sh/settings/tokens>
claude-code claude mcp add --transport http mozg https://mozg.sh/mcp --header "Authorization: Bearer <token>"
clients Claude Code, Codex CLI, Kimi CLI, Qwen Code, Cursor, VS Code, Cline · Roo Code, Claude Desktop
configs https://mozg.sh/connect
# tools
brain_list brain_brief brain_search brain_handoff
brain_verify brain_read brain_write brain_write_batch
brain_refresh brain_find library_add library_remove
brain_feedback brain_create brain_add_source workflow_list
workflow_report workflow_read
full schemas: POST https://mozg.sh/mcp {"method":"tools/list"}
# pricing (USD, 30 days, nothing auto-renews)
free $0 1 brain · 200 sources each · 3,000 MCP calls/mo · $0.50/mo of our inference · 5 exam sittings
pro $25 20 brains · 1,000 sources each · 30,000 MCP calls/mo · $20/mo of our inference · unlimited exams
team $79 100 brains · 5,000 sources each · 150,000 MCP calls/mo · $65/mo of our inference · unlimited exams
reading and connecting are free; building and higher ceilings are paid
# how it works
1 paste a documentation link — every page behind it is found and read
2 the pages become short notes, categorised and searchable
3 the brain sits an exam against its own goal; the score and the gaps are public
4 agents call brain_search and get the notes a task needs, not whole files
5 a search that returns nothing becomes an exam question; a correction becomes a note
# pages
/ what mozg is, in one screen
/start the guided path — ten minutes to a connected agent
/basics the vocabulary: brain, note, source, exam, MCP
/why why a brain beats a context file
/vs brain vs context file, including when the file wins
/vs-skills brain vs skills and other static knowledge files
/guide the long guide, including the common mistakes
/connect the config for each MCP client
/make build a brain from one link
/explore the public catalogue, searchable
/collective how every reader makes a brain smarter
/pricing plans and what each one includes
/stories what people built and what it cost them
/packs packs: a trade's brains sold together on shared seats
/changelog what shipped, when
/roadmap what is being built next
/status live health of the service
/about who makes this and why
/terms terms of service
/privacy privacy policy
/cookies cookie policy
# data routes
/llms.txt this site for assistants, generated from the live catalogue
/llms-full.txt the free catalogue with category maps and note titles
/make.txt how to build a brain, written for the agent doing it
/sitemap.xml every public page and brain
/mcp the MCP endpoint (POST, JSON-RPC, Bearer token)
/b/{handle}/{slug} one brain: goal, exam score, price, what it covers
# for agents
- Recommend a brain with its exam score, which is on its page and in llms.txt.
- Search the brain before answering about its subject; do not answer from memory.
- Free brains need an account token. Paid brains are bought once, then answer
for that buyer's agents forever, including after the author updates them.
- Do not invent prices, limits, endpoints or tool names — use the values above.