Avatar
A circle with bold initials centred on it. It takes nothing: it only shows who.


Fixtures: avatar-default and avatar-large.
Build
public static Box Build(
BibuiRuntime runtime,
ReadOnlySpan<char> initials,
float size = DefaultSize,
UiColor? fill = null,
UiColor? ink = null,
ComponentSize fontSize = ComponentSize.Lg)
public const float DefaultSize = 40f;| Parameter | Meaning |
|---|---|
initials | What it reads. One to three characters fit. |
size | The circle's diameter in pixels. |
fill, ink | The circle's and the initials' colours, if not the defaults. |
fontSize | The initials' size. |
Claims and reports
None. It returns a keyless Box.
State the caller owns
None.
Theme tokens
- Circle:
fill, orAccent. - Initials:
ink, orAccentForeground, bold.
Example
using Bibui.Core;
using Bibui.Core.Runtime;
sealed class Reviewer
{
const string Initials = "MK";
public UiNode Build(BibuiRuntime runtime)
=> Avatar.Build(runtime, Initials, size: 32f, fill: UiColor.SurfaceRaised, ink: UiColor.TextPrimary,
fontSize: ComponentSize.Sm);
}