kylebshr

kylebshr / slots

Public

Convenient SwiftUI view slots without the init explosion

19
1
100% credibility
Found Apr 01, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Swift
AI Summary

Slots simplifies building flexible reusable UI components for SwiftUI apps by automatically generating convenient customization initializers for generic view properties.

How It Works

1
🕵️ Discover Slots

While designing your app's buttons, cards, and lists, you find a helpful tool that makes reusable pieces super easy to customize.

2
📱 Add to Your App

Simply bring the tool into your app project with a quick copy-paste link, and it's ready to use.

3
✨ Tag Your Building Blocks

Sprinkle special markers on your design pieces to tell the tool which parts can hold text, icons, or actions.

4
🎨 Mix and Match Easily

Drop in simple words, pictures, or buttons into those spots, and skip all the extra setup work.

5
đź‘€ Preview Instantly

Watch your creations update live as you tweak titles, add icons, or remove extras effortlessly.

🎉 Perfect App Design

Celebrate your sleek, consistent app interface that looks professional and feels intuitive.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 19 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is slots?

Slots is a Swift macro library for SwiftUI devs building design system components like cards, badges, or rows with flexible generic view slots. It auto-generates all the initializers you need—handling optionals via Never types, text conveniences like LocalizedStringResource or plain strings, and even system images—without the init explosion that plagues multi-slot views. Annotate your struct with @Slots, mark slots optionally with @Slot(.text) or .systemImage, and get clean APIs matching SwiftUI's Button style.

Why is it gaining traction?

Unlike manual extensions with exploding where clauses, Slots delivers convenient SwiftUI view slots without boilerplate, supporting optional omission, unlabeled params, and custom resolvers for enums-to-views. Devs love the ergonomic call sites: Card(title: "Hello") or ListRow(leadingSystemName: "star", content: "Wi-Fi"). It mirrors SwiftUI conventions perfectly, slashing design system setup time.

Who should use this?

SwiftUI engineers at iOS, macOS, or watchOS teams crafting component libraries—think cards with headers/media/footers, list rows with icons/text/trailing, or banners with styled messages. Ideal for frontend devs tired of writing 30+ inits per view in slots-heavy UIs.

Verdict

Grab it for new SwiftUI design systems; the macro magic pays off fast despite 19 stars and 1.0% credibility score. Excellent README with examples, full test coverage, but watch for macro limits on complex slots—mature enough for prototypes, promising for production.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.