{"enrichment":{"faq":[{"a":"The compose-slot-api-pattern skill teaches how to build flexible, reusable Compose components by delegating content to callers through `@Composable` lambda slots instead of accumulating primitive parameters. You'll learn to structure components around layout responsibility, use scope receivers to expose layout features, and co-locate sensible defaults in a `Defaults` object\u2014the pattern Material 3's `ListItem` exemplifies.","q":"What is the compose slot API pattern?"},{"a":"The compose-slot-api-pattern shows how to use `@Composable` lambda slots for flexible component content. Instead of adding boolean flags or string parameters, you delegate content areas to the caller. This lets you design reusable components that accept composable functions as parameters, giving callers full control over what renders in each slot while you manage the layout structure.","q":"How do I make composable components flexible with slot APIs?"},{"a":"compose-slot-api-pattern covers `@Composable` lambda parameters as a core technique for content delegation. These are function parameters of type `@Composable () -> Unit` that let callers pass composable content directly into your component. Use them when you want to avoid primitive parameters like booleans or strings, and instead let callers define what renders in specific layout areas.","q":"What are @Composable lambda parameters and when should I use them?"},{"a":"The compose-slot-api-pattern skill reviews component signatures to identify and fix anti-patterns like boolean flags or string parameters. Instead, use `@Composable` lambda slots to let callers provide content. This approach scales better than adding more parameters, keeps your component signature clean, and follows Material 3 patterns like `ListItem` and `TopAppBar`.","q":"How do I avoid primitive parameters and anti-patterns in Compose?"},{"a":"compose-slot-api-pattern explains scope receivers and nullable slots for optional composable content areas. Scope receivers (like `RowScope`) expose layout features to slot content, letting callers use modifiers specific to that layout. Nullable slots let you provide optional content areas with sensible defaults, often co-located in a `Defaults` object for consistency.","q":"What are scope receivers and nullable slots in Compose components?"},{"a":"The compose-slot-api-pattern teaches refactoring by replacing primitive parameters with `@Composable` lambda slots, applying scope receivers to expose layout context, and grouping defaults in a `Defaults` object. This pattern improves component reusability and scalability, following Material 3 design principles used in `ListItem` and other flexible layout components.","q":"How do I refactor Compose components using the slot pattern?"}],"shadow_tags":["component-design","reusability-pattern","lambda-slots","content-delegation","scope-receivers","composable-architecture","ui-flexibility","parameter-design","layout-composition","api-scalability"],"summary_rewrite":"This skill shows how to build flexible, reusable Compose components by delegating content to callers through `@Composable` lambda slots instead of accumulating primitive parameters. You'll learn to structure components around layout responsibility, use scope receivers to expose layout features, and co-locate sensible defaults in a `Defaults` object\u2014the pattern Material 3's `ListItem` exemplifies."},"files":[{"bytes":12641,"path":".claude/skills/compose-slot-api-pattern/SKILL.md","sha256":"b46c86968dc8fb89bb29761d68afd979cd3afcfefcec3deafdc7ec2bd5f26df7","url":"https://skillfed.io/files/vitorpamplona/amethyst/compose-slot-api-pattern/dfd816bd/SKILL.md"}],"id":"vitorpamplona/amethyst/compose-slot-api-pattern","links":{"html":"https://skillfed.io/vitorpamplona/amethyst/compose-slot-api-pattern","md":"https://skillfed.io/vitorpamplona/amethyst/compose-slot-api-pattern.md","repo":"https://github.com/vitorpamplona/amethyst"},"meta":{"agents_supported":["claude-code"],"first_seen":"2026-07-28","forks":212,"language":"Kotlin","last_updated":"2026-07-28","license":"MIT","name":"compose-slot-api-pattern","publisher":"vitorpamplona","stars":1565},"relations":{"similar":[{"id":"chrisbanes/skills/compose-slot-api-pattern"},{"id":"vitorpamplona/amethyst/compose-expert"},{"id":"vitorpamplona/amethyst/compose-modifier-and-layout-style"},{"id":"chrisbanes/skills/compose-modifier-and-layout-style"},{"id":"skydoves/compose-performance-skills/avoiding-subcomposition-pitfalls"},{"id":"wshobson/agents/mobile-android-design"},{"id":"vitorpamplona/amethyst/compose-state-holder-ui-split"},{"id":"chrisbanes/skills/compose-state-holder-ui-split"},{"id":"cometchat/cometchat-skills/cometchat-android-v6-compose-customization"},{"id":"ehmo/platform-design-skills/android"}]},"slug":{"owner":"vitorpamplona","repo":"amethyst","skill":"compose-slot-api-pattern"},"version":"dfd816bd"}
