Ballmac UI home

AI ChatPRO

The layout for a chat UI: a message log that sticks to the bottom while replies stream unless the reader scrolls up, a jump-to-latest button, an empty state with suggestions and a footer.

6/6 checksv1.0.0Updated Sep 28, 2026
What changed
YO
Where do Ballmac components get installed?
AI
Ballmac components install into components/ballmac, so they never overwrite your shadcn/ui files. Add one with `npx shadcn@latest add @ballmac/prompt-input`, then import it from @/components/ballmac/prompt-input.

Installation

  1. Get a Pro licence key.

    The source is part of Ballmac UI Pro.

    Log in with your licence key to read and copy it here, or install it through the shadcn CLI or the MCP server. You own the code once it is in your project.

    $49 once regular price $99for this and every other Pro item. Tax included.Money back if it does not work.

  2. Once per project: add the Pro registry and your licence key.

    components.json
    {
      "registries": {
        "@ballmac": "https://ui.ballmac.com/r/{name}.json",
        "@ballmac-pro": {
          "url": "https://ui.ballmac.com/r/pro/{name}.json",
          "headers": { "Authorization": "Bearer ${BALLMAC_LICENSE_KEY}" }
        }
      }
    }
    .env.local
    BALLMAC_LICENSE_KEY=your-licence-key
  3. Add it.

    $ pnpm dlx shadcn@latest add @ballmac-pro/ai-chat

Usage

import { Chat, ChatMessages, ChatEmpty, ChatSuggestions, ChatSuggestion, ChatFooter, useChatScroll } from "@/components/ballmac/ai-chat"

The full example is in the Code tab above.

Examples

Empty state with suggestions

How can I help?

Ask about your code, docs or data.

API reference

<ChatMessages>

PropTypeDefault
contentClassName

Classes for the inner column that holds the messages (width, gap, padding).

string—
label

Accessible name of the log.

string—
scrollButtonLabel

Accessible name of the jump-to-latest button.

string—

<ChatEmpty>

PropTypeDefault
icon

Small mark above the title (an icon or logo).

React.ReactNode—
title

Headline, e.g. "How can I help?"

React.ReactNode—
description

One line under the title.

React.ReactNode—

<ChatSuggestions>

PropTypeDefault
onSelect

Called with a suggestion's value when it is clicked. Usually sends it as a message.

(value: string) => void—

<ChatSuggestion>

PropTypeDefault
value

Text passed to onSelect. Defaults to the button's text when children is a string.

string—

<ChatFooter>

PropTypeDefault
contentClassName

Classes for the inner column (match ChatMessages' width).

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabFocuses the message log (scroll with arrow keys / Page Up / Page Down), then the jump-to-latest button when shown
Enter / SpaceOn a suggestion, sends it through onSelect
—The log is role=log with aria-live=polite; set aria-busy on ChatMessages while a reply streams to avoid announcing every token

Quality scorecard

6/6

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 2 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    No endless animation to begin with.

  • Passed: Right to left

    Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (0% of elements off the mirror, limit 15%).

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    5 tab stops, each showing a visible change when it takes focus. 3 documented keys.

  • Not applicable: Loading, empty and error

    Does not show data or take submissions.

  • For information: Automated tests

    No test file of its own yet.

  • For information: Footprint

    3.2 KB of source (gzip) in 1 file. Installs lucide-react, motion.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Use with AI

Layout only: <Chat> (a full-height column) > <ChatMessages> (role=log, auto-scroll) + <ChatFooter>. Put ai-message items inside ChatMessages and a prompt-input inside ChatFooter. It holds no chat state, so any source works (Vercel AI SDK useChat, your own fetch stream). With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI AI Chat (@ballmac-pro/ai-chat) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Building an assistant, support bot or copilot panel from ai-message and prompt-input
  • Any log that receives streaming content and should follow the newest line unless the reader scrolls up
  • A first-run screen with suggested prompts (ChatEmpty + ChatSuggestions)

Not for

  • A single one-off AI answer on a page (use ai-message or streaming-text alone)
  • Terminal-style command output (use terminal)

Registry JSON (needs your licence key): https://ui.ballmac.com/r/pro/ai-chat.json

Credits

Covered by the Ballmac UI Pro license.