# Svelte Prompt Kit
> Lightweight, focused components for building beautiful prompt engineering interfaces with Svelte and SvelteKit
## Overview
**Svelte Prompt Kit** is a curated library of 17 lightweight components designed specifically for prompt engineering and simpler AI interfaces. Built on top of shadcn-svelte, it provides focused, easy-to-use components without the complexity of full-featured AI applications.
## Quick Links
- **Website**: https://svelte-ai-elements.vercel.app/prompt-kit
- **GitHub**: https://github.com/SikandarJODD/ai-elements
- **Documentation**: https://svelte-ai-elements.vercel.app/prompt-kit/installation
- **Component Registry**: https://svelte-ai-elements.vercel.app/p/index.json
- **Blocks**: https://svelte-ai-elements.vercel.app/prompt-kit/blocks
## When to Use Prompt Kit
Choose **Prompt Kit** when you need:
- **Lightweight prompt engineering** interfaces
- **Simple chat applications** without advanced features
- **Quick prototypes** and MVPs
- **Minimal dependencies** and smaller bundle sizes
- **Focused components** for specific use cases
- **Easy customization** with less complexity
- **Fast development** with pre-built blocks
For full-featured AI applications with file uploads, model selection, and workflow visualization, consider **AI Elements** instead.
## Installation
### Prerequisites
Prompt Kit requires shadcn-svelte to be installed first:
```bash
npx shadcn-svelte@latest init
```
### Install AI SDK v5 (Optional)
```bash
pnpm add ai @ai-sdk/svelte @ai-sdk/openai
```
### Install Components
Components are installed individually using the shadcn-svelte CLI:
```bash
# Input & interaction
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/prompt-input.json
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/prompt-suggestion.json
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/chat-container.json
# Display components
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/message.json
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/code-block.json
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/markdown.json
# AI features
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/reasoning.json
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/chain-of-thought.json
npx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/p/tool.json
```
**Registry Structure**: `/p/[component-name].json` (p = prompt-kit)
## Component Catalog (17 Components)
### Input & Interaction (4)
- **Prompt Input** - Comprehensive text input with actions, state management, and keyboard shortcuts
- **Prompt Suggestion** - Clickable prompt suggestions with icons, highlighting, and categories
- **File Upload** - Drag-and-drop file upload with preview, validation, and progress
- **Chat Container** - Chat interface with scroll management, auto-scrolling, and sticky-to-bottom
### Display Components (5)
- **Message** - Chat messages with avatar, markdown content, and interactive actions
- **Code Block** - Syntax-highlighted code with copy functionality and language detection
- **Markdown** - Render markdown content with GitHub Flavored Markdown support
- **Image** - Image display with zoom, fullscreen, and loading states
- **System Message** - System-level notifications, status messages, and alerts
### AI Features (5)
- **Reasoning** - Display AI reasoning process with collapsible content (DeepSeek R1, o1, o3)
- **Chain of Thought** - Step-by-step AI reasoning with collapsible steps and visual connectors
- **Tool** - Display AI tool execution with parameters, results, and status
- **Source** - Source citations with favicons, titles, and descriptions in popover format
- **Steps** - Multi-step process display with progress indicators and completion states
### Utility Components (3)
- **Loader** - Loading indicators with multiple variants (dots, spinner, pulse)
- **Scroll Button** - Floating button to scroll to bottom with auto-hide behavior
- **System Message** - System notifications and status updates
## Pre-built UI Blocks (8)
Ready-to-use conversation layouts:
1. **Prompt Input with Actions** - Input field with action buttons
2. **Prompt Input with Suggestions** - Input with clickable suggestions
3. **Prompt Input with Autocomplete** - Input with autocomplete functionality
4. **Basic Full Conversation** - Simple conversation layout
5. **Conversation with Avatars** - Conversation with user/AI avatars
6. **Conversation with Actions** - Conversation with message actions
7. **Advanced Conversation Layout** - Complex conversation interface
8. **Multi-step Conversation Flow** - Step-by-step conversation
**Access blocks at**: https://svelte-ai-elements.vercel.app/prompt-kit/blocks
## Key Features
- **Lightweight & Fast**: Minimal dependencies and smaller bundle sizes
- **Easy to Use**: Simple APIs with sensible defaults
- **Highly Customizable**: Built with Tailwind CSS for easy theming
- **TypeScript Ready**: Full TypeScript support with type definitions
- **AI SDK Compatible**: Works seamlessly with Vercel AI SDK v5
- **Responsive**: Mobile-first design that works on all devices
- **Accessible**: ARIA attributes and keyboard navigation
- **Pre-built Blocks**: 8 ready-to-use conversation layouts
## Technology Stack
- **Framework**: Svelte 5 + SvelteKit
- **UI Foundation**: shadcn-svelte
- **Styling**: Tailwind CSS v4
- **AI Integration**: Vercel AI SDK v5 (optional)
- **Type Safety**: TypeScript
- **State Management**: Svelte 5 runes ($state, $derived, $effect) + runed library
- **Code Highlighting**: Shiki
- **Markdown**: marked + isomorphic-dompurify
- **Icons**: @lucide/svelte
## Integration Example with AI SDK v5
### Simple Chat Interface
```svelte