Catalog Uploads

<.avatar>

ConnieUI.Uploads

HEEx
<.live_component
  module={ConnieUI.Playground.Catalog.Uploads.Uploader}
  id="catalog-upload-avatar"
  kind={:avatar}
  controls=
/>

Controls

:string

URL of the current avatar image

:string

Size class for the avatar

Set by the example

upload target

Docs

Avatar upload component. Looks like a regular avatar but acts as a file upload trigger. Clicking opens the file picker, and it supports drag-and-drop. On hover, shows a camera icon overlay. When a file is selected, shows a preview with a cancel option. Pass `target={@myself}` when used inside a LiveComponent. ## Examples <ConnieUI.Uploads.avatar upload={@uploads.profile_photo} current={@current_avatar_url} size="size-24" target={@myself} />
Attribute Type Default Description
upload * {:struct, Phoenix.LiveView.UploadConfig}
current :string nil
URL of the current avatar image
size :string "size-24"
Size class for the avatar
target :any nil
Target for cancel event (e.g., @myself in LiveComponents)