ShadKit is a SwiftUI port of shadcn/ui and Vercel AI Elements that faithfully replicates the original components from their registry sources, with no dependencies and support for macOS 14+ and iOS 17+.

Stars

15

7-day growth

No data

Forks

1

Open issues

0

License

MIT

Last updated

2026-07-30

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It ports components not from screenshots but from the actual registry JSON, ensuring class-level fidelity, and includes a complete AI chat runtime with streaming, tool calls, and multiple composer templates—all in pure SwiftUI.

Who it is for

  • SwiftUI developers building native macOS/iOS interfaces
  • Developers who want to use shadcn/ui design system in SwiftUI
  • AI chat interface developers needing a Swift-native `useChat` alternative
  • Developers building node-graph editors or canvas-based UIs in SwiftUI

Use cases

  • Building AI-powered chat interfaces with streaming responses and tool calls
  • Creating macOS/iOS apps that follow shadcn's design tokens and components
  • Developing interactive node-graph editors for visual programming or data flow
  • Showcasing AI UI components in a gallery app for demos or testing

Strengths

  • Zero external dependencies—pure SwiftUI with no UIKit or AppKit bridging
  • Components are accurately ported from official shadcn and AI SDK registries, preserving exact styling (e.g., Tailwind class details, dark mode overrides)
  • 205 unit tests focused on high-risk areas like color space conversion, protocol boundaries, and streaming edge cases
  • Includes a full `AIChat` runtime with streaming, delta coalescing, tool result in‑place updates, and mock transport for previews/tests

Considerations

  • Markdown rendering does not include tables, and syntax highlighting is a compact tokeniser, not a full grammar per language
  • Overlays (popover, dropdown, select) render at the theme root and cannot escape a clipping ancestor above the theme root
  • Canvas node-graph lacks edge creation by dragging handles, sub‑flows, NodeResizer, and undo/redo support

README quick start

ShadKit

A SwiftUI port of shadcn/ui and Vercel AI Elements, built to match the originals rather than approximate them. No dependencies — pure SwiftUI, macOS 14+ / iOS 17+.

Components were ported from the actual registry sources (ui.shadcn.com/r/styles/new-york-v4/*.json and registry.ai-sdk.dev), not from screenshots, so class-for-class details — the has-[>svg]:px-3 padding shift on buttons, dark:bg-input/30 on inputs, the ten-spoke loader's per-spoke opacity — carry across.

Products

LibraryContents
ShadcnUIDesign tokens + the shadcn primitives
AIElementsUIThe AI Elements set, plus a useChat-shaped runtime
CanvasUINode-graph canvas, ReactFlow-shaped
AIElementsGalleryA browsable showcase of everything
.package(url: "https://github.com/jasonkneen/ShadKit", from: "0.1.0")

Design tokens

shadcn publishes its tokens in OKLCH. OKLCH converts to sRGB via OKLab, so a theme can be pasted in verbatim:

OKLCH(css: "oklch(0.145 0 0)")          // #0A0A0A
OKLCH(0.577, 0.245, 27.325).hexString   // #E7000B

Apply a theme once near the root. Components below read the resolved palette for the current appearance:

ContentView()
    .shadcnSurface()                 // theme + the `background` token
    .shadcnTheme(myTheme)            // theme only

Custom themes are the same shape as a shadcn :root block — see ShadcnPaletteSpec. Space.x4 maps Tailwind's spacing scale to points (p-416), and theme.radius derives the whole radius scale from one --radius.

AI controls

AIConversation(streamToken: chat.streamToken) {
    ForEach(chat.messages) { AIMessageView(message: $0) }
}

AIReasoning(content: thinking, isStreaming: true)
AITool(name: "search_codebase", state: .outputAvailable) {
    AIToolInput(json: input)
    AIToolOutput(output: output)
}
AIResponse(markdown)                 // streaming-safe markdown
AICodeBlock(code: swift, language: "swift")

useChat parity

AIChat is the Swift counterpart to the AI SDK's useChat — same message shape (UIMessage / UIMessagePart), same ChatStatus, same verbs.

@StateObject private var chat = AIChat(transport: MyTransport())

AIChatbot(chat: chat, suggestions: ["Explain this repo"]) { text, status in
    AIPrompt

Description

SwiftUI port of shadcn/ui and Vercel AI Elements — design tokens, AI chat components, node canvas, diff viewer. No dependencies.

Related repositories

Similar projects matched by category, topics, and programming language.

yetone
Featured
yetone GitHub avatar

kill-ai-slop

Kill AI Slop is a multilingual field guide and agent skill that catalogues 33 common AI-generated design tells with interactive before-after demos, and provides a tool to scan and fix web projects.

AI & Machine LearningAI Agents
805
Blaizzy
Featured
Blaizzy GitHub avatar

nativ

Nativ is a native macOS app that lets you run AI models locally on Apple silicon, offering chat, model management, performance analytics, and an OpenAI/Anthropic-compatible API server.

AI & Machine LearningAI Vision & Audio
985
uzairansaruzi
Featured
uzairansaruzi GitHub avatar

hermex

Hermex is a native SwiftUI iPhone app that lets you control a self-hosted Hermes AI agent directly from your phone, with no subscriptions, tracking, or third-party relay.

AI & Machine LearningLarge Language Models
941