Skip to content

Avatar

widgetsdisplay

Avatar: a widget that displays user initials with a generated color

Installation

$ bunx termuijs add avatar

Copies the source into src/components/avatar/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { Avatar } from '@termuijs/widgets'
ts
new Avatar(name: string, style: Partial<Style> = {}, opts: AvatarOptions = {})

API Reference

Avatar

PropTypeRequiredDescription
namestringrequired
colorColoroptionalOverride the dynamically generated color
shape'square' | 'circle'optionalShape of the avatar
#display#avatar