# Identity Placeholder URL: /lynx/components/identity-placeholder Source: https://github.com/daangn/seed-design/blob/dev/docs/content/lynx/components/identity-placeholder.mdx A visual placeholder shown when an image representing a person fails to load. 사용 가능 버전: @seed-design/lynx-react@0.8.0, @seed-design/lynx-css@0.12.0 ## Preview ```tsx import "./styles"; import { Box, useSeedClassName } from "@seed-design/lynx-react"; import { IdentityPlaceholder } from "@/components/ui/identity-placeholder"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( ); } ``` ## Installation - npm: npx @seed-design/cli@latest add ui:identity-placeholder - pnpm: pnpm dlx @seed-design/cli@latest add ui:identity-placeholder - yarn: yarn dlx @seed-design/cli@latest add ui:identity-placeholder - bun: bun x @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. ```tsx import { Box } from "@seed-design/lynx-react"; import { IdentityPlaceholder } from "@/components/ui/identity-placeholder"; export function ProfileFallback() { return ( ); } ``` The default `identity` is `"person"` and displays a person shape. Passing `identity="business"` displays a business/store shape. ## Props You can pass accessibility props for the internal native `` with `imageProps`. The default accessibility label is `"Identity placeholder"` and can be overridden to match the context. ```tsx ``` ## Examples ### Identity Use `identity` to select between person and business/store shapes. ```tsx import "./styles"; import { Box, HStack, useSeedClassName } from "@seed-design/lynx-react"; import { IdentityPlaceholder } from "@/components/ui/identity-placeholder"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( ); } ``` ### Aspect Ratio Maintains the aspect ratio of person and business shapes in square, landscape, and portrait areas. ```tsx import "./styles"; import { Box, HStack, VStack, useSeedClassName } from "@seed-design/lynx-react"; import { IdentityPlaceholder } from "@/components/ui/identity-placeholder"; const identities = ["person", "business"] as const; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( {identities.map((identity) => ( ))} ); } ``` ## Web Version Differences | Area | React | Lynx | | -------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | Rendering | `` path | native `` | | Image source | SVG path from component | Person/business 640×640 WebP included in package | | Size fitting | Default `preserveAspectRatio="xMidYMid meet"` | `mode="aspectFit"` to center the entire shape | | Color | Recipe's gray-500 background and `static-white-alpha-800` glyph | Same gray-500 background. Glyph preserves the `static-white-alpha-800` value from React Recipe (`#ffffffde`) fixed in WebP | | Accessibility | `aria-label` | Native `accessibility-label` in `imageProps` | | SVG / `asChild` prop | SVG prop and DOM Slot combination possible | Not supported. Use native `` props on Root and native `` 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.