qat

Avatar

Avatar, AvatarGroup. They are copied into your app’s ui/ by qatjs add avatar: the code is yours to edit.

Example

LMRƏNHLMRƏ+3

Example.qx16 linesOpen in the playground
import { Avatar, AvatarGroup } from './ui/avatar/avatar.qx'

export default function Example() {
  return (
    <p class="example-row">
      <Avatar name="Leyla Məmmədova" size={24} />
      <Avatar name="Rəşad Əliyev" />
      <Avatar name="Nigar Hüseynova" size={40} status="online" />
      <AvatarGroup
        names={['Leyla Məmmədova', 'Rəşad Əliyev', 'Nigar Hüseynova', 'Orxan Qasımov', 'Aysel Rzayeva']}
        max={2}
        label="The team"
      />
    </p>
  )
}

Add it

shell1 line
npx qatjs add avatar

Avatar

As a custom element: <ui-avatar>.

Avatar: props
PropTypeAttribute
namestringyes
srcstringyes
size24 | 32 | 40property only
status'online' | 'away' | 'busy'yes

AvatarGroup

Several people: the first `max` (3 by default), then "+N". As a custom element: <ui-avatar-group>.

AvatarGroup: props
PropTypeAttribute
namesstring[]property only
maxnumberyes
size24 | 32 | 40property only
labelstringyes