3.0.4 • Published 8 months ago

@licuido-ui/ui_draggable-layout v3.0.4

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

DraggableLayout

DraggableLayout - DraggableLayout component, You Can drag and move the layout Mostly you can customize the Layout and using this to display the layout import '@licuido-ui/ui_draggable-layout/dist/index.css'

Author

Link

Story Book Link Calender

PlayGround

Try it have a fun codeBox

Installation

npm i @licuido-ui/ui_draggable-layout

Import component

import { DraggableLayout } from '@licuido-ui/ui_draggable-layout';

Usage

<DraggableLayout
     layout={  {
        title: 'component 1',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 2',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 3',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 4',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 5',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },}
     onLayoutChange={onLayoutChange} 
    breakPoints={ lg: 1200, md: 996, sm: 768, xs: 480,xxs: 0 }

    />

Image

alt text

Samplecode

<DraggableLayout
     layout={ [
       {
        title: 'component 1',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 2',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 3',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 4',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
      {
        title: 'component 5',
        ChildrenComponent: 'children'
        RightSideAction: <Move width={'14px'} />,
        poisitionX: 1,
        positionY:2,
        width:2,
        height:2,
      },
    ]}
     onLayoutChange={onLayoutChange} 
    styleProps= {
    layoutStyle: {
      border: '0px',
      borderRadius: '8px',
      backgroundColor: '#fff',
    },
    totalLayoutStyle: {
      backgroundColor: '#eee',
      cursor: 'grab',
    },
  }
   cols = { lg: 4, md: 4, sm: 4, xs: 1, xxs: 1 }
   width = {100}
   rowHeight = {150}
   localstoragekey={false}
    breakPoints={ lg: 1200, md: 996, sm: 768, xs: 480, xxs:0 }
        autoSize={true}

     />

Props

NameDescriptionDefaultControl
classNamestring-Set object
sxsx property-sx : {}
compactTypeDefinewe can define vertical or horizontal-horizontal
colsCols is define as lg ,md,sm,xs-cols : {lg : 4md : 4sm : 4xs : 1xxs : 1}
widthwidth of the Total layout-
autoSizeautosize-FalseTrue
rowHeightrowHeight of the Total layout-
headingStyleheadingStyle-headingStyle : {}
layoutBddIdlayout BDD Id for BDD Test-
layoutBddTestIdlayout BDD Test Id-
totalHeadingStyletotalHeadingStyle-totalHeadingStyle : {}
totalLayoutStyle-totalLayoutStyle : {}
ChildrenStyleChildrenStyle-ChildrenStyle : {}
stylePropsyou can customize your css into style-styleProps : {layoutStyle : {...} 3 keystotalLayoutStyle : {...} 2 keys}
localstorageKeyif u want to save in local u can use Localstorage key-FalseTrue
layoutlayout has title, Children, rightsideicon, x, y width,height-layout : [0 : {...} 7 keys1 : {...} 7 keys2 : {...} 7 keys3 : {...} 7 keys4 : {...} 7 keys]
breakPointsbreakpoints for Layout-breakPoints : {lg : 1200md : 996sm : 768xs : 480xxs : 0}