Lynx

Identity Placeholder

A visual placeholder shown when an image representing a person fails to load.

Available since@seed-design/lynx-react@0.8.0, @seed-design/lynx-css@0.12.0
Loading Lynx example…

Installation

npx @seed-design/cli@latest add ui:identity-placeholder

Usage

The IdentityPlaceholder background fills both the parent's width and height. The shape maintains its aspect ratio and is centered to fit the parent's shorter axis, so it is not clipped even in non-square containers.

Place it inside a Box with specified width and height.

import { Box } from "@seed-design/lynx-react";
import { IdentityPlaceholder } from "@/components/ui/identity-placeholder";

export function ProfileFallback() {
  return (
    <Box width="160px" height="160px">
      <IdentityPlaceholder />
    </Box>
  );
}

The default identity is "person" and displays a person shape. Passing identity="business" displays a business/store shape.

Props

Prop

Type

imageProps?SeedIdentityPlaceholder.ImageProps | undefined
style?CSSProperties | undefined
className?string | undefined

You can pass accessibility props for the internal native <image> with imageProps. The default accessibility label is "Identity placeholder" and can be overridden to match the context.

<IdentityPlaceholder imageProps={{ "accessibility-label": "Profile image not loaded" }} />

Examples

Identity

Use identity to select between person and business/store shapes.

Loading Lynx example…

Aspect Ratio

Maintains the aspect ratio of person and business shapes in square, landscape, and portrait areas.

Loading Lynx example…

Web Version Differences

AreaReactLynx
Rendering<svg> pathnative <image>
Image sourceSVG path from componentPerson/business 640×640 WebP included in package
Size fittingDefault preserveAspectRatio="xMidYMid meet"mode="aspectFit" to center the entire shape
ColorRecipe's gray-500 background and static-white-alpha-800 glyphSame gray-500 background. Glyph preserves the static-white-alpha-800 value from React Recipe (#ffffffde) fixed in WebP
Accessibilityaria-labelNative accessibility-label in imageProps
SVG / asChild propSVG prop and DOM Slot combination possibleNot supported. Use native <view> props on Root and native <image> props on Image

Since Lynx native image does not render SVG, both shapes are provided as internal WebP. The image is bundled via package asset import and makes no external URL requests. The glyph color preserves the original React Recipe's fixed alpha in the raster, so tint-color or dynamic tint hooks are not added.

Table of contents