HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • Artwork
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Brand SVG
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Cart Button
  • Cart Line Item
  • Cart Summary
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Fill Blank
  • File Icon
  • File Upload
  • Form Guide
  • Hover Card
  • Icon Tile
  • Image Export
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • League Table
  • Marquee
  • Match Score
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Person Avatar
  • Phone Input
  • Popover
  • Price
  • Product Card
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sonner
  • Sortable
  • Spinner
  • Stat
  • Stat Tabs
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
  • Message Toolbar
Blocks
  • Airtable
  • Airtable Kanban
  • CRM
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • App Shell
  • Record Files
  • Settings Shell
  • Help Panel
  • Note Editor
  • Email Drafts
  • Task List
  • Notifications Panel
  • Dual Pane Sidebar
  • Team Members Panel
  • Mix Pack Builder
  • Record Picker and Date Quick-pick
  • Record List
  • Record Page
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • AI Assistant
  • Voice Message
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Standings
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Templates
  • Sign In Page
  • Upload Page
  • Showcase Onboarding
  • Agreement Sign
  • Email
  • Email Composer
  • Share Dialog
  • Integrations
  • Transactions
  • Analytics
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Bot Avatar

PreviousNext

An animated assistant avatar with idle, thinking, talking and done states, sized like Avatar.

UI SDKBase UIRadix UI
Radix UI
"use client"

import * as React from "react"

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/bot-avatar.json

Usage#

import { BotAvatar } from "@/components/ui/bot-avatar"
<BotAvatar state="thinking" />

BotAvatar is an Avatar: it takes the same size prop, has data-slot="avatar", and sits in an AvatarGroup with the same ring. The ball is drawn in currentColor and the eyes are cut out of it, so it follows light and dark mode and takes a className like any other avatar.

States#

StateWhat you see
idleThe ball, blinking and glancing about.
thinkingThe ball shrinks to a dot, with a dot pulsing either side.
talkingWide eyes and a soft pulse, easing in and out.
doneA wink, held for 1.6 seconds, then back to the idle face.
idle
thinking
talking
done
import { BotAvatar, type BotAvatarState } from "@/components/ui/bot-avatar"

const STATES: BotAvatarState[] = ["idle", "thinking", "talking", "done"]

Changing state morphs from the current face to the new one. A BotAvatar that mounts in a state starts in it.

Sizes#

Use the size prop, as on Avatar.

import { BotAvatar } from "@/components/ui/bot-avatar"

export function BotAvatarSizesExample() {

Avatar Group#

JVML
import {
  Avatar,
  AvatarFallback,

Reduced motion and still frames#

When the visitor prefers reduced motion, BotAvatar draws one still frame for the state and does not animate, whatever animated says. Set animated={false} to get the same stills on purpose.

import { BotAvatar, type BotAvatarState } from "@/components/ui/bot-avatar"

const STATES: BotAvatarState[] = ["idle", "thinking", "talking", "done"]

Performance#

Every BotAvatar on a page shares one requestAnimationFrame loop, and an avatar that scrolls out of view stops animating. A feed of twenty costs one loop, not twenty.

Credits#

The engine is bloub by Jérémy Perret, MIT licensed. It draws one shape that morphs between measured states, with two eyes cut out of it. It is a pure function of time, which is why this component can draw the same frame on the server and in the browser. Only the idle, thinking, wink and wide states are kept, and the licence text is in the header of bot-avatar-engine.ts.

We also looked at Bible Strong's Avatar Lab. It is AGPL-3.0, and code under the AGPL cannot go in a registry that projects install from.

API Reference#

BotAvatar#

PropTypeDefault
state"idle" | "thinking" | "talking" | "done""idle"
size"default" | "sm" | "lg""default"
animatedbooleantrue
labelstring (the accessible name; the state is added)"Assistant"
classNamestring-

The root also accepts every Avatar prop.

Bot AvatarNext.js

On This Page

InstallationUsageStatesSizesAvatar GroupReduced motion and still framesPerformanceCreditsAPI ReferenceBotAvatar