This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
import React from 'react' import { User } from 'playbook-ui' const UserDefault = (props) => { return ( <div className="pb--doc-demo-row"> <div> <User align="center" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="vertical" size="lg" title="Remodeling Consultant" /> </div> <div> <User align="left" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="horizontal" title="Remodeling Consultant" /> </div> <div> <User align="left" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="horizontal" /> <br /> <User align="left" avatar name="Anna Black" orientation="horizontal" /> </div> </div> ) } export default UserDefault
import React from 'react' import { User } from 'playbook-ui' const UserWithTerritory = (props) => { return ( <div className="pb--doc-demo-row"> <div> <User align="center" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="vertical" size="lg" territory="PHL" title="Remodeling Consultant" /> </div> <div> <User align="left" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="horizontal" territory="PHL" title="Remodeling Consultant" /> </div> <div> <User align="center" name="Anna Black" orientation="horizontal" size="sm" territory="PHL" title="Remodeling Consultant" /> <br /> <User align="left" name="Anna Black" orientation="horizontal" size="lg" territory="PHL" title="Remodeling Consultant" /> </div> </div> ) } export default UserWithTerritory
import React from 'react' import { User } from 'playbook-ui' const UserTextOnly = (props) => { return ( <div className="pb--doc-demo-row"> <User align="center" name="Anna Black" orientation="horizontal" size="lg" title="Remodeling Consultant" /> <User align="left" name="Anna Black" orientation="horizontal" title="Remodeling Consultant" /> </div> ) } export default UserTextOnly
import React from 'react' import { User } from 'playbook-ui' const UserDefault = (props) => { return ( <div className="pb--doc-demo-row"> <User avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" size="sm" title="Remodeling Consultant" /> <User avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" size="md" title="Remodeling Consultant" /> <User avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" size="lg" title="Remodeling Consultant" /> </div> ) } export default UserDefault
import React from 'react' import { User } from 'playbook-ui' const UserVerticalSize = (props) => { return ( <div> <User align="center" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="vertical" size="sm" title="Remodeling Consultant" /> <br /> <br /> <User align="center" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="vertical" size="md" title="Remodeling Consultant" /> <br /> <br /> <User align="center" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="vertical" size="lg" title="Remodeling Consultant" /> </div> ) } export default UserVerticalSize
import React from "react" import { User } from "playbook-ui" const UserSubtitle = (props) => { return ( <div className="pb--doc-demo-row"> <User align="center" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="vertical" size="lg" subtitle="User ID: 12345" territory="PHL" title="Remodeling Consultant" /> <User align="left" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="horizontal" subtitle="User ID: 12345" territory="PHL" title="Remodeling Consultant" /> </div> ) } export default UserSubtitle
The subtitle
prop accepts strings as well as nodes. Whatever node is passed will display in the subtitle section.
import React from "react" import { Caption, Contact, Flex, Icon, User } from "playbook-ui" const MentorSubtitle = ( <Flex> <Icon icon="users" /> <Caption paddingLeft="xs" text="Admin" /> </Flex> ) const ContactSubtitle = ( <> <Contact contactType="cell" contactValue="349-185-9988" /> <Contact contactValue="5555555555" /> <Contact contactType="email" contactValue="email@example.com" /> </> ) const UserBlockContentSubtitleReact = (props) => { return ( <div className="pb--doc-demo-row"> <User align="left" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="horizontal" subtitle={MentorSubtitle} territory="PHL" title="Remodeling Consultant" /> <User align="left" avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" name="Anna Black" orientation="horizontal" subtitle={ContactSubtitle} /> </div> ) } export default UserBlockContentSubtitleReact