0.0.2 • Published 8 months ago

@licuido-ui/ui_viewer v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Viewer

The Viewer component is a versatile and customizable UI element designed to showcase user profiles, information, or forms with a modern and consistent look. It's built using the Material-UI library and offers flexible configuration options to suit a variety of use cases.

npm i  @licuido-ui/ui_viewer

Author

Link

Story Book Link EmptyPage

PlayGround

Try it have a fun codeBox

Import component

import { Viewer } from '@licuido-ui/ui_viewer';

Usage

<Viewer   rootStyle= { backgroundColor: '' }
    headerOptions= {
      title: 'My Profile',
      fontSize: '20px',
      fontWeight: 'bold',
      color: '#111111',
      titleBoxStyle: { backgroundColor: '' },
    }
    viewBody= {
      viewBodyStyle: {},
      gridStyle: { justifyContent: 'center' },
      profileimage: {
        breakpoints: { xs: 12, sm: 3.5, md: 3, lg: 2 },
        profileImgStyle: {},
        imgSrc: '',
        variant: 'rounded',
        profileimgContainer: {},
        avatarconStyle: {},
        profileImgEditStyle: {},
        profileImgEditIcon: <EditIcon color='#fff' />,
        onClick: () => {
          console.log('Profile Edit');
        },
      },
      form: {
        breakpoints: { xs: 12, sm: 6, md: 6, lg: 4.5, xl: 4.5 },
        title: 'Michael Bloomberg',
        subTitle: 'Male',
        description: 'Senior Graphic Designer',
        titleStyle: {},
        descriptionStyle: {},
        subTitleStyle: {},
        formContainer: {},
        formList: [
          {
            icon: <DocsIcon color='#665CD7' />,
            label: 'Email',
            value: 'Michaelbloomberg@email.com',
            breakPoint: {
              xs: 12,
              sm: 12,
              md: 12,
              lg: 12,
              lx: 12,
            },
            iconStyle: { backgroundColor: '#FAFAFA' },
            labelStyle: {},
            valueStyle: {},
            listWraper: { py: 1 },
          },
          {
            icon: <DocsIcon />,
            label: 'Date Of Birth',
            value: '01/06/1990',
            breakPoint: {
              xs: 12,
              sm: 12,
              md: 12,
              lg: 12,
              lx: 12,
            },
            iconStyle: { backgroundColor: '#FAFAFA' },
            labelStyle: {},
            valueStyle: {},
            listWraper: { py: 1 },
          },
          {
            icon: <DocsIcon />,
            label: 'Mobile Number',
            value: '+1 9999999999',
            breakPoint: {
              xs: 12,
              sm: 12,
              md: 12,
              lg: 12,
              lx: 12,
            },
            iconStyle: { backgroundColor: '#FAFAFA' },
            labelStyle: {},
            valueStyle: {},
            listWraper: { py: 1 },
          },
          {
            icon: <DocsIcon />,
            label: 'Desgination',
            value: 'Developer',
            breakPoint: {
              xs: 12,
              sm: 12,
              md: 12,
              lg: 12,
              lx: 12,
            },
            iconStyle: { backgroundColor: '#FAFAFA' },
            labelStyle: {},
            valueStyle: {},
            listWraper: { py: 1 },
          },
        ],
      },
      btnList: [
        {
          buttonText: 'Edit',
          onClick: () => {
            console.log('Edit');
          },
          breakPoint: {
            xs: 12,
            sm: 12,
            md: 12,
            lg: 12,
            lx: 12,
          },
          btnStyle: { backgroundColor: '#665CD7' },
          btnListConStyle: { mt: 3, display: 'flex', justifyContent: 'center' },
        },
      ],
    } />

Image

Variant1

  1. alt text

Variant2

  1. alt text

Props

Prop NameTypeDescriptionDefault Value
idstringA unique identifier for the component.'viewer'
classNamestringOverrides or extends the applied styles.''
sxSxPropsSystem overrides and additional CSS styles.{}
rootStyleobjectWrapping style for the viewer.{}
viewBodyobjectConfiguration for the content displayed below the header.{}
headerOptionsobjectHeader properties for the profile viewer.{}

viewBody Configuration:

Prop NameTypeDescriptionDefault Value
viewBodyStyleobjectStyle for the content area.{}
gridStyleobjectStyle for the grid splitting the profile image and content area.{}
profileimageobjectConfiguration for the profile image section.{}
formobjectConfiguration for the profile detail area.{}
btnListarrayList of buttons to be displayed.[]

profileimage Configuration:

Prop NameTypeDescriptionDefault Value
breakpointsobjectBreakpoints for different screen sizes.{}
profileImgStyleobjectStyles for the profile image.{}
imgSrcstring or anyPath or source of the profile image.''
variant'circular' | 'rounded' | 'square'Profile image variant.'rounded'
profileimgContainerobjectContainer styles for the profile image.{}
profileImgEditIconReact.ReactNode or anyIcon for editing or removing the profile image.<></>
customCompReact.ReactNode or anyCustom component to be displayed.<></>
avatarconStyleobjectStyles for the avatar container.{}
profileImgEditStyleobjectStyles for the background of the edit icon.{}
onClick() => voidCallback fired when the profile image is clicked.() => undefined

form Configuration:

Prop NameTypeDescriptionDefault Value
breakpointsobjectBreakpoints for different screen sizes.{}
titlestringProfile title.''
subTitlestringProfile subtitle.''
descriptionstringDescription of the profile.''
titleStyleobjectStyles for the title.{}
descriptionStyleobjectStyles for the description.{}
subTitleStyleobjectStyles for the subtitle.{}
formContainerobjectOverall container styles for the form content.{}
formListContainerobjectContainer styles for the list of profile data.{}
formListarrayList of profile data like name, email, etc.[]
formList Configuration:
Prop NameTypeDescriptionDefault Value
breakPointobjectBreakpoints for different screen sizes.{}
iconReact.ReactNode or anyIcon for the profile data.<></>
iconStyleobjectStyles for the icon.{}
labelstringLabel for the profile data.''
labelStyleobjectStyles for the label.{}
valuestringValue for the profile data.''
valueStyleobjectStyles for the value.{}
customCompReact.ReactNode or anyCustom component to be displayed.<></>

btnList Configuration:

Prop NameTypeDescriptionDefault Value
breakPointobjectBreakpoints for different screen sizes.{}
buttonTextstringText to display on the button.''
btnStyleobjectStyles for the button.{}
onClick() => voidCallback function to execute when the button is clicked.() => undefined

headerOptions Configuration:

Prop NameTypeDescriptionDefault Value
titlestringMain title for the profile viewer.''
fontSizestringFont size for the header.''
fontWeightstringFont weight for the header.''
colorstringColor of the header.''
titleBoxStyleobjectHeader container style.{}