AvatarUpload
La foto de una persona, en un círculo: sus iniciales mientras no haya una.
import { AvatarUpload } from '@sypnia/ui/react'
En esta página
Una foto de perfil
AR
Código
import { useState } from 'react';
import { AvatarUpload } from '@sypnia/ui/react';
// The initials until there is a photo.
export default function Photo() {
const [file, setFile] = useState<File | null>(null);
return <AvatarUpload name="Ana Ruiz" file={file} onChange={setFile} />;
} Cuándo usarlo
Úsalo cuando
- Perfiles y miembros.
No lo uses cuando
- Logos: usa ImageUpload, que conserva la forma.
Para todos
- El avatar lleva el nombre de la persona.
Props
| AvatarUpload | Tipo | Por defecto |
|---|---|---|
nameobligatorio | string | |
onChangeobligatorio | (f: File | null) => void | |
file | File | null | |
loadingThe person's picture is on its way: the circle and the buttons are skeletons of their own boxes (pass the last known `value`, so the buttons are the ones that will come). | boolean | |
maxSize | number | 1024 * 1024 |
value | string | null |