Slot Content Via Composable Lambda
When a component has a region the caller might want to customise — header, leading icon, trailing action, body — expose that region as a `@Composable () -> Unit` parameter (a 'slot'), not as a typed config object or a St…
$ prime install @android-compose/rule-slot-content-via-composable-lambda Projection
Always in _index.xml · the agent never has to ask for this.
SlotContentViaComposableLambda [rule] v0.1.0
When a component has a region the caller might want to customise — header, leading icon, trailing action, body — expose that region as a @Composable () -> Unit parameter (a 'slot'), not as a typed config object or a String. The component lays out the slot; the caller fills it with whatever composables it likes. This is how Material 3 components like Scaffold, TopAppBar, ListItem, and Card stay flexible without exploding their parameter lists.
Loaded when retrieval picks the atom as adjacent / supporting.
SlotContentViaComposableLambda [rule] v0.1.0
When a component has a region the caller might want to customise — header, leading icon, trailing action, body — expose that region as a @Composable () -> Unit parameter (a 'slot'), not as a typed config object or a String. The component lays out the slot; the caller fills it with whatever composables it likes. This is how Material 3 components like Scaffold, TopAppBar, ListItem, and Card stay flexible without exploding their parameter lists.
Checks
- Customisable regions are
content: @Composable () -> Unit(or a typed scope receiver, e.g.@Composable RowScope.() -> Unit). - Multiple slots are named for the region they fill:
title,leadingIcon,trailingContent,bottomBar,content. - The primary content slot is conventionally named
contentand is the LAST parameter — so callers can use trailing-lambda syntax:Card { ... }. - Slots receive their own scope when geometry context matters (e.g.
RowScope,ColumnScope) so callers can useModifier.weight(...)inside.
Label
Expose customisable regions as @Composable content lambdas (slots)
Loaded when retrieval picks the atom as a focal / direct hit.
SlotContentViaComposableLambda [rule] v0.1.0
When a component has a region the caller might want to customise — header, leading icon, trailing action, body — expose that region as a @Composable () -> Unit parameter (a 'slot'), not as a typed config object or a String. The component lays out the slot; the caller fills it with whatever composables it likes. This is how Material 3 components like Scaffold, TopAppBar, ListItem, and Card stay flexible without exploding their parameter lists.
Checks
- Customisable regions are
content: @Composable () -> Unit(or a typed scope receiver, e.g.@Composable RowScope.() -> Unit). - Multiple slots are named for the region they fill:
title,leadingIcon,trailingContent,bottomBar,content. - The primary content slot is conventionally named
contentand is the LAST parameter — so callers can use trailing-lambda syntax:Card { ... }. - Slots receive their own scope when geometry context matters (e.g.
RowScope,ColumnScope) so callers can useModifier.weight(...)inside.
Label
Expose customisable regions as @Composable content lambdas (slots)
Label
Expose customisable regions as @Composable content lambdas (slots)
Source
prime-system/examples/android-compose/primes/compiled/@android-compose/rule-slot-content-via-composable-lambda/atom.yaml