Name card
Username
Show username using username
prop.
<>
<NameCard user={{username:"james"}} />
</>
Full name
Show full name using fullName
prop.
<>
<NameCard user={{details:{fullName:"James Smith"}}} />
</>
Avatar size
You can change avatar size with avatarSize
prop.
<>
<NameCard avatarSize={50} user={{details:{fullName:"James Smith"}}} />
</>
User E-mail
Show user e-mail using email
prop.
<>
<NameCard user={{details:{fullName:"James Smith"},email:"[email protected]"}} />
</>
Single Line
Make the secondLine invisible with singleLine
prop.
<>
<NameCard singleLine={true} user={{details:{fullName:"James Smith"},email:"[email protected]"}} />
</>
Second line
Show second line using secondLine
prop.
<>
<NameCard secondLine="Intern" user={{details:{fullName:"James Smith"}}} />
</>
API
import Namecard from "erxes-ui/lib/components/namecard/Namecard";
- required prop
NAME | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
username* | string | Defines the username | |
fullName | string | Define fullname object of user. If you have both "details" and "username", it will only show "details" | |
string | Define email object of user | ||
singleLine | string | Make the second line invisible | |
secondLine | string | Define line below the username or full name. You can write anything in the second line | |
avatarSize | number | 40 | Set avatar size to your name card |