SikandarJODD/ai-elements
소개
Svelte AI Elements is a unofficial port of Vercel AI Elements, built on top of shadcn-svelte.
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSvelte AI Elements
Svelte AI Elements is a unofficial port of Vercel AI Elements for Svelte. It provides a set of components and utilities to help developers build AI-powered applications with Svelte.
Installation
1. Create a Svelte app
pnpm dlx sv create my-app
2. Initialize shadcn-svelte
cd my-app
pnpm dlx shadcn-svelte@latest init
3. Add Prompt Input Component
pnpm dlx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/r/prompt-input.json
Usage
Here is a very basic Prompt Input example f:
<script lang="ts">
import * as PromptInput from "$lib/components/ai-elements/prompt-input";
import type { Message } from "$lib/components/ai-elements/prompt-input";
import { Chat } from "@ai-sdk/svelte";
let chat = new Chat({});
function handleSubmit(message: Message) {
chat.sendMessage({
text: message.text,
});
}
</script>
<div class="space-y-4">
<PromptInput.Root class="w-xl" onSubmit={handleSubmit}>
<PromptInput.Body>
<PromptInput.Textarea />
</PromptInput.Body>
<PromptInput.Toolbar class="justify-end">
<PromptInput.Submit />
</PromptInput.Toolbar>
</PromptInput.Root>
<!-- Showcase messages -->
<ul>
{#each chat.messages as message, messageIndex (messageIndex)}
<li>
<div class="text-base font-semibold">{message.role}</div>
<div>
{#each message.parts as part, partIndex (partIndex)}
{#if part.type === "text"}
<div class="text-muted-foreground text-sm">{part.text}</div>
{/if}
{/each}
</div>
</li>
{/each}
</ul>
</div>
Libraries
Svelte AI Elements
Full-featured components for chat apps, streaming responses, reasoning UIs, tools, and workflow-style AI interfaces.
- Docs: https://svelte-ai-elements.vercel.app/components
- Registry: https://svelte-ai-elements.vercel.app/r/index.json
Svelte Prompt Kit
Lightweight prompt engineering and conversational UI components that are easy to compose into simple AI interfaces.
Most Used Components
Svelte AI Elements
| Component | What it helps with |
|---|---|
Message |
Role-based chat messages and response layout |
Prompt Input |
Prompt submission with AI-focused input controls |
Conversation |
Scrollable conversation containers and chat structure |
Response |
Streaming markdown response rendering |
Reasoning |
Expandable AI thinking and reasoning views |
Streaming Responses
For markdown and streaming response rendering, this project uses streamdown-svelte, the Svelte port used throughout the repo for streamed markdown output.
Inspired By
License
This project is licensed under the MIT License. See LICENSE for details.
Made with ❤️ by Bhide Svelte
관련 프로젝트 살펴보기
불러오는 중…