Skip to content

Avatar

Person: photo or initials, name, role.

Updated View as Markdown
Preview

Loading preview…

root = Row(Avatar("Ada Lovelace", "Engineering lead"), Avatar("Alan Turing", "Research", src:"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&q=75&auto=format&fit=crop"), gap:lg)

Signature

This is the line a model reads in the system prompt.

Avatar(name, subtitle?, src:str, size:Size)
  • Group: Content
  • Children: No
  • Positional arguments: name, subtitle? (a trailing ? means it may be left out)

Props

Prop Type How to write it Notes
name string positional, required
subtitle string positional, optional
src string (URL) named: src:…
size sm · md · lg named: size:… Also accepts small, medium, large.

Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model’s output do not change.

import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Avatar: MyAvatar });
<GistUI library={lib} stream={response.body} />;
<GistUI :source="answer" :components="{ Avatar: MyAvatar }" />
<GistUI source={answer} components={{ Avatar: MyAvatar }} />
<GistUI source={answer()} components={{ Avatar: MyAvatar }} />
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Avatar: (ctx) => ({ el: myElement(ctx) }) });

See Custom components for the full contract. Style hook: [data-gistui="Avatar"].

Navigation

Type to search…

↑↓ navigate↵ selectEsc close