2025-04-25 16:42:10 +08:00
|
|
|
---
|
2026-06-03 23:08:41 +08:00
|
|
|
templateEngineOverride: njk
|
2025-05-01 12:50:40 +08:00
|
|
|
layout: layouts/page.njk
|
2025-04-25 16:42:10 +08:00
|
|
|
title: Avatar
|
|
|
|
|
description: An image element with a fallback for representing the user.
|
|
|
|
|
toc:
|
|
|
|
|
- label: Usage
|
|
|
|
|
id: usage
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
{% from "macros/code_preview.njk" import code_preview %}
|
|
|
|
|
{% from "macros/code_block.njk" import code_block %}
|
|
|
|
|
|
|
|
|
|
<div class="alert mb-6">
|
|
|
|
|
{% lucide "circle-alert" %}
|
2025-11-02 11:56:40 +08:00
|
|
|
<h2>There is no dedicated Avatar component in Basecoat.</h2>
|
2025-04-25 16:42:10 +08:00
|
|
|
</div>
|
|
|
|
|
|
2025-11-02 11:56:40 +08:00
|
|
|
{% set code %}
|
2025-11-04 12:46:00 +08:00
|
|
|
<div class="flex flex-row flex-wrap items-center gap-12">
|
|
|
|
|
<img class="size-8 shrink-0 object-cover rounded-full" alt="@hunvreus" src="https://github.com/hunvreus.png">
|
|
|
|
|
<img class="size-8 shrink-0 object-cover rounded-lg" alt="@shadcn" src="https://github.com/shadcn.png">
|
|
|
|
|
<div class="flex -space-x-2 [&_img]:ring-background [&_img]:ring-2 [&_img]:grayscale [&_img]:size-8 [&_img]:shrink-0 [&_img]:object-cover [&_img]:rounded-full">
|
|
|
|
|
<img alt="@hunvreus" src="https://github.com/hunvreus.png">
|
|
|
|
|
<img alt="@shadcn" src="https://github.com/shadcn.png">
|
|
|
|
|
<img alt="@adamwathan" src="https://github.com/adamwathan.png">
|
2025-11-02 11:56:40 +08:00
|
|
|
</div>
|
2025-11-04 12:46:00 +08:00
|
|
|
</div>
|
2025-11-02 11:56:40 +08:00
|
|
|
{% endset %}
|
2025-11-04 12:46:00 +08:00
|
|
|
{{ code_preview("avatar", code | prettyHtml, "w-full max-w-md") }}
|
2025-04-25 16:42:10 +08:00
|
|
|
|
|
|
|
|
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
|
|
|
|
|
2025-11-04 12:46:00 +08:00
|
|
|
<section class="prose">
|
|
|
|
|
<p>Avatars are just <code><img></code> elements styled with Tailwind utility classes.</p>
|
|
|
|
|
</section>
|
2025-11-02 11:56:40 +08:00
|
|
|
|
|
|
|
|
{% set code_simple %}
|
|
|
|
|
<img class="size-8 shrink-0 object-cover rounded-full" alt="@hunvreus" src="https://github.com/hunvreus.png">
|
|
|
|
|
{% endset %}
|
|
|
|
|
{{ code_block(code_simple | prettyHtml, "html") }}
|