-
Notifications
You must be signed in to change notification settings - Fork 3
Labels
component:newCreation of a new componentCreation of a new component
Description
Summary
Implement the Avatar component for NativeUI, inspired by the shadcn/ui Avatar.
Requirements
- Use
Image
andView
fromreact-native
as base components. - Support the following features:
- Display an image from a
src
prop. - Provide a fallback with initials or icon when the image fails to load or is absent.
- Optional
alt
text for accessibility. - Optional
size
variants:sm
,md
,lg
. - Optional
rounded
variants:default
(rounded),full
(circular).
- Display an image from a
- Style the component using nativewind utility classes.
- Allow passing a
className
prop to customize or extend the default styles. - Ensure type safety with TypeScript.
Deliverables
- Create an
avatar.tsx
file under/registry/avatar
. - Follow the structure and naming conventions similar to shadcn/ui Avatar.
References
Notes
Focus on keeping the Avatar simple, accessible, and easily customizable.
The goal is to make it easy to clone and adapt when building apps.
Metadata
Metadata
Assignees
Labels
component:newCreation of a new componentCreation of a new component