shadcn-chat

repository·master·Indexed 22 days ago

https://github.com/jakobhoeg/shadcn-chat

A collection of customizable and reusable chat components for building chat interfaces. It includes a CLI (shadcn-chat-cli) for installing components such as ChatBubble, ChatInput, ChatMessageList, and ExpandableChat. The library requires Tailwind CSS and shadcn/ui as prerequisites and provides integration examples for the Vercel AI SDK and OpenAI.

Tokens
5.8K
Snippets
17
Records
45
Agent score
81%

What's inside shadcn-chat

  1. Introduction to shadcn-chat

    master
    shadcn-chat provides a collection of beautifully designed chat components designed to be copied and pasted directly into your applications. The components are built with a focus on simplicity: they have no external dependencies, no unnecessary bloat, and provide full ownership of the code once integrated.
  2. Prerequisites for using shadcn-chat

    master

    Before installing shadcn-chat components, ensure your project meets the following requirements:

    1. Tailwind CSS: The components are built using Tailwind CSS.
    2. shadcn-ui: The components rely on existing shadcn-ui components. You must initialize shadcn-ui in your project before proceeding with the shadcn-chat installation.
  3. Bootstrap the Vercel AI SDK chatbot example

    master

    You can bootstrap a new Next.js project using this specific shadcn-chat example by running the create-next-app command with the example URL. Replace nextjs-shadcn-chat-vercel-ai with your desired project name.

    npx create-next-app --example https://github.com/jakobhoeg/shadcn-chat/tree/master/examples/shadcn-chat-example-vercel-ai nextjs-shadcn-chat-vercel-ai
  4. Install shadcn-chat components via CLI

    master

    To add chat components to your project, use the shadcn-chat-cli. Note that some components depend on shadcn-ui, so ensure shadcn-ui is already installed in your project before proceeding.

    To install all available components at once (recommended), run:

    npx shadcn-chat-cli add --all

    To install a specific component, run:

    npx shadcn-chat-cli add [component]

    To see a list of all available components, run:

    npx shadcn-chat-cli add
    npx shadcn-chat-cli add --all
  5. Run the shadcn-chat Vercel AI example locally

    master

    After bootstrapping the project, follow these steps to get the development server running:

    1. Obtain an API Key: Create an API key in your OpenAI dashboard.
    2. Configure Environment Variables: Create a .env.local file in the project root and add the required environment variables (refer to the example .env file in the repository for the exact keys).
    3. Install Dependencies: Run npm install (or your preferred package manager).
    4. Start Development Server: Run npm run dev.
  6. Install individual shadcn-chat components

    master

    You can choose to install only specific components instead of the entire library.

    To see a list of all available components, run:

    npx shadcn-chat-cli@latest add

    To install a specific component, append its name to the command:

    npx shadcn-chat-cli@latest add <component-name>

    Components will be added to the src/components/ui/chat directory.