Skip to content

The open alternative to Salesforce, designed for AI.

9.6 KB
Raw Blame
{/*
 * _____                    _
 *|_   _|_      _____ _ __ | |_ _   _
 *  | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
 *  | |  \ V  V /  __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
 *  |_|   \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
 *                              |___/
 *
 * This file is generated from the documentation data in packages/twenty-ui/generated.
 * To update it, edit the component prop types or design tokens in twenty-ui and run:
 *   npx nx generate:ui twenty-docs
 */}

<ParamField body="backgroundColor" type="string">
  Background color override for a first-letter fallback.
</ParamField>

<ParamField body="borderColor" type="string">
  Border color override for the outline fallback.
</ParamField>

<ParamField body="className" type="string | ((state: AvatarRootState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="color" type="string">
  Text color override for a first-letter fallback.
</ParamField>

<ParamField body="colorSeed" type="string">
  Stable value used to choose fallback colors. Defaults to `name`.
</ParamField>

<ParamField body="fallbackProps" type="AvatarFallbackProps">
  Complete `Avatar.Fallback` props, including caller-owned children, labeling, refs, `render`, and fallback `delay` in milliseconds.
</ParamField>

<ParamField body="icon" type="ReactNode">
  Decorative icon rendered instead of the image and first-letter fallback. Give the root an accessible label when the icon conveys information.
</ParamField>

<ParamField body="imageProps" type="AvatarImageProps">
  Complete `Avatar.Image` props, including native image attributes, refs, `render`, `keepMounted`, and `onLoadingStatusChange`. Alternative text defaults to an empty string. Supply a nonempty `alt` to label the image and default fallback.
</ParamField>

<ParamField body="name" type="string">
  Name used for the first-letter fallback and fallback colors. Does not add an accessible label.
</ParamField>

<ParamField body="pulsing" type="boolean" default="false">
  Animates the avatar opacity. Respects reduced-motion preferences.
</ParamField>

<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, AvatarRootState&gt;">
  Caller-supplied root element or renderer. Defaults to a presentational span. Compose a native button or link explicitly for interaction, and put its click handler and disabled state on that owner.
</ParamField>

<ParamField body="ring" type="boolean" default="false">
  Surrounds the avatar with a background-colored ring so overlapping avatars stay distinct.
</ParamField>

<ParamField body="shape" type="&quot;circle&quot; | &quot;rounded-square&quot; | &quot;square&quot;" default="square">
  Shape of the avatar and its fallback.
</ParamField>

<ParamField body="size" type="&quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xl&quot; | &quot;xs&quot; | &quot;xxl&quot;" default="md">
  Avatar size: `xs` (12px), `sm` (14px), `md` (16px), `lg` (24px), `xl` (32px), or `xxl` (40px).
</ParamField>

<ParamField body="src" type="string | null">
  Image URL. A missing or failed image shows the fallback. `imageProps.src` overrides this value.
</ParamField>

<ParamField body="style" type="CSSProperties | ((state: AvatarRootState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="variant" type="&quot;outline&quot; | &quot;soft&quot;" default="soft">
  Visual treatment of the fallback.
</ParamField>

### Avatar.Root

<ParamField body="Root.backgroundColor" type="string">
  Background color override for a first-letter fallback.
</ParamField>

<ParamField body="Root.borderColor" type="string">
  Border color override for the outline fallback.
</ParamField>

<ParamField body="Root.children" type="ReactNode">
  Caller-owned Image, Fallback, and other content.
</ParamField>

<ParamField body="Root.className" type="string | ((state: AvatarRootState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Root.color" type="string">
  Text color override for a first-letter fallback.
</ParamField>

<ParamField body="Root.colorSeed" type="string">
  Stable value used to choose fallback colors. Defaults to `name`.
</ParamField>

<ParamField body="Root.name" type="string">
  Name used to choose fallback colors. Does not add children or accessible labels.
</ParamField>

<ParamField body="Root.pulsing" type="boolean" default="false">
  Animates the avatar opacity. Respects reduced-motion preferences.
</ParamField>

<ParamField body="Root.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, AvatarRootState&gt;">
  Caller-supplied root element or renderer. Defaults to a presentational span. Compose a native button or link explicitly for interaction, and put its click handler and disabled state on that owner.
</ParamField>

<ParamField body="Root.ring" type="boolean" default="false">
  Surrounds the avatar with a background-colored ring so overlapping avatars stay distinct.
</ParamField>

<ParamField body="Root.shape" type="&quot;circle&quot; | &quot;rounded-square&quot; | &quot;square&quot;" default="square">
  Shape of the avatar and its fallback.
</ParamField>

<ParamField body="Root.size" type="&quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xl&quot; | &quot;xs&quot; | &quot;xxl&quot;" default="md">
  Avatar size: `xs` (12px), `sm` (14px), `md` (16px), `lg` (24px), `xl` (32px), or `xxl` (40px).
</ParamField>

<ParamField body="Root.style" type="CSSProperties | ((state: AvatarRootState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="Root.variant" type="&quot;outline&quot; | &quot;soft&quot;" default="soft">
  Visual treatment of the fallback.
</ParamField>

### Avatar.Image

<ParamField body="Image.alt" type="string">
  Caller-owned alternative text. Use an empty string for decorative images.
</ParamField>

<ParamField body="Image.className" type="string | ((state: AvatarImageState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Image.crossOrigin" type="&quot;&quot; | &quot;anonymous&quot; | &quot;use-credentials&quot;">
  Native image cross-origin policy, also used during preloading.
</ParamField>

<ParamField body="Image.keepMounted" type="boolean" default="false">
  Keeps the image mounted and loads it in place. Loading and failed images stay hidden while Fallback is shown.
</ParamField>

<ParamField body="Image.loading" type="&quot;eager&quot; | &quot;lazy&quot;">
  Native eager or lazy loading. Use keepMounted for lazy loading.
</ParamField>

<ParamField body="Image.onLoadingStatusChange" type="((status: ImageLoadingStatus) =&gt; void)">
  Called when Base UI reports a loading, loaded, or error status. Shares that state with Root and Fallback.
</ParamField>

<ParamField body="Image.referrerPolicy" type="&quot;&quot; | &quot;no-referrer-when-downgrade&quot; | &quot;no-referrer&quot; | &quot;origin-when-cross-origin&quot; | &quot;origin&quot; | &quot;same-origin&quot; | &quot;strict-origin-when-cross-origin&quot; | &quot;strict-origin&quot; | &quot;unsafe-url&quot;">
  Native image referrer policy, also used during preloading.
</ParamField>

<ParamField body="Image.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;DetailedHTMLProps&lt;ImgHTMLAttributes&lt;HTMLImageElement&gt;, HTMLImageElement&gt;, AvatarImageState&gt;">
  Replaces the image. Preserve a native image and forward the supplied attributes, events, and ref.
</ParamField>

<ParamField body="Image.sizes" type="string">
  Native responsive image sizes used with srcSet.
</ParamField>

<ParamField body="Image.src" type="string">
  Image URL. Image renders after a successful load unless keepMounted is enabled.
</ParamField>

<ParamField body="Image.srcSet" type="string">
  Native responsive image source candidates.
</ParamField>

<ParamField body="Image.style" type="CSSProperties | ((state: AvatarImageState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Avatar.Fallback

<ParamField body="Fallback.children" type="ReactNode">
  Caller-owned fallback content, such as initials or an icon.
</ParamField>

<ParamField body="Fallback.className" type="string | ((state: AvatarFallbackState) =&gt; string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Fallback.delay" type="number" default="0">
  Milliseconds before the initial fallback is shown. Defaults to 0.
</ParamField>

<ParamField body="Fallback.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, AvatarFallbackState&gt;">
  Replaces the fallback span. Forward the supplied props and ref, and provide its accessible label or decorative attributes.
</ParamField>

<ParamField body="Fallback.style" type="CSSProperties | ((state: AvatarFallbackState) =&gt; CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>