--- title: Introduction toc: menu order: 1 nav: title: Guide order: 1 --- ### What is dooringx lib? Dooringx lib is the base of dooringx and a visual drag and drop framework with dooringx plug-ins removed. Dooring x lib provides its own set of data flow event mechanism, pop-up window and other solutions, which can enable you to customize and develop your own visual drag and drop platform faster. ### How does dooringx lib work? Dooringx lib maintains a set of data flow at runtime, which is mainly divided into JSON data part, left component part, right configuration item part, shortcut key part, pop-up window part, event and function part and data source part. In addition to providing basic drag, move, zoom, select all, rotate and other functions, it can also use exposed components. If you feel that the components are not customized enough, you can adjust the style or rewrite it yourself. ### Get started quickly #### Installation Install using NPM or yarn ```bash npm i dooringx-lib ``` Dooring x lib provides two containers for editing, which can be used as needed. One is an ordinary container and the other is an iframe container. These two containers are slightly different in some implementations. If you use a normal container, that is, the div that is normal when editing is not iframe, while if you use iframe, you will see the iframe content when editing. When previewing, use the preview component, and the preview can be placed in any container, including iframe. It is recommended to use iframe to view the preview during preview. If there is a pop-up window, exceptions will be displayed in non iframe or PC. The iframe container may have a slight delay in operation because it uses PostMessage communication. If the style isolation requirements are not high, you can use ordinary containers, and the preview style can be normal. Common container usage reference Demo: ```js import { RightConfig, Container, useStoreState, innerContainerDragUp, LeftConfig, ContainerWrapper, Control, } from 'dooringx-lib'; import { useContext } from 'react'; import { configContext } from '@/layouts'; import { useCallback } from 'react'; import { PREVIEWSTATE } from '@/constant'; export const HeaderHeight = '40px'; export default function IndexPage() { const config = useContext(configContext); const everyFn = () => {}; const subscribeFn = useCallback(() => { localStorage.setItem(PREVIEWSTATE, JSON.stringify(config.getStore().getData())); }, [config]); const [state] = useStoreState(config, subscribeFn, everyFn); return (