{"data":{"prismicDocsCategory":{"data":{"pages":[{"page":{"uid":"what-is-uxpin-merge","document":[{"data":{"title":{"text":"What is UXPin Merge?"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"using-react.js-components","document":[{"data":{"title":{"text":"Using React.js Components"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"creating-a-library","document":[{"data":{"title":{"text":"Creating a Library"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"start-with-a-boilerplate-repo","document":[{"data":{"title":{"text":"Start with a Boilerplate Repo"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"integrating-your-own-components","document":[{"data":{"title":{"text":"Integrating Your Own Components"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"config-file","document":[{"data":{"title":{"text":"Config File"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"webpack-configuration","document":[{"data":{"title":{"text":"Webpack Configuration"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"wrapper-component","document":[{"data":{"title":{"text":"Wrapper Component"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"adjusting-components","document":[{"data":{"title":{"text":"Adjusting Components"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"configuring-the-properties-panel","document":[{"data":{"title":{"text":"Configuring the Properties Panel"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"authoring-and-managing-jsx-presets","document":[{"data":{"title":{"text":"Authoring and Managing JSX Presets"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"cli-tool","document":[{"data":{"title":{"text":"CLI Tool"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"ci-servers","document":[{"data":{"title":{"text":"Connecting code to UXPin (CI & push)"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"version-control","document":[{"data":{"title":{"text":"Version Control"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"patterns","document":[{"data":{"title":{"text":"Patterns"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"tailwind-css-integration","document":[{"data":{"title":{"text":"Tailwind CSS Integration"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-design-system-documentation","document":[{"data":{"title":{"text":"Merge Design System Documentation"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-component-manager","document":[{"data":{"title":{"text":"Merge Component Manager"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"storybook-integration","document":[{"data":{"title":{"text":"Storybook integration"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-faq","document":[{"data":{"title":{"text":"Frequently Asked Questions"},"visible_in_table_of_content":"true"}}]}}]}},"prismicDocsPage":{"data":{"title":{"text":"Using React.js Components"},"isVisibleForRobots":"true","body":[{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>This article explains how you can use React.js components integrated with your UXPin account thanks to the Merge Technology. If you&#39;re looking for a technical integration guide, you can go to <a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/creating-a-library\">Creating a UXPin Merge Library</a> right away.</p>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/97d57986-b60d-4bb2-b089-c507670c3b97_UsingReact_02.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"How to Access Merge?"},"content":{"html":"<p>As a user you have access to both – <strong>UXPin Merge Dev Environment</strong> (to integrate your own components or any of our sample libraries) and <strong>Merge libraries</strong> integrated directly with your UXPin account (providing that any coded components have been pushed to your UXPin account). If:</p><ul><li>you want to integrate your own components – follow the steps in <a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/creating-a-library/\">Creating a UXPin Merge Library</a>.</li><li>the components have already been integrated with your UXPin account (by some nice person on your team!) and you want to learn how to use them – keep reading this guide.</li><li>the components haven&#39;t been integrated with your account and you&#39;re not sure what to do – contact your account manager.</li></ul>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Adding Components"},"content":{"html":"<p>Adding components works exactly like in the regular design systems library in UXPin. Simply drag &amp; drop a component, adjust its position on canvas and you&#39;re good to go!</p>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/97d57986-b60d-4bb2-b089-c507670c3b97_UsingReact_02.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyTip","slice_type":"tip","primary":{"tip_type":"Info tip","tip_title":"Note","tip":{"html":"<p>Adjusting the size of the component depends on the way the component was coded. If a component has a fixed width or height set up in css, then adjusting the size in UXPin will not be possible, unless the value is passed through props to a React component. Merge uses the very same code as you do in the production of your app.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":""},"content":{"html":"<h3>Nesting Components</h3><p>If a component allows for a nested structure – you can do it.</p>"}}},{"__typename":"PrismicDocsPageBodyImageWithCaption","slice_type":"image_with_caption","primary":{"image":{"url":"https://images.prismic.io/uxpincommunity%2F6fe63283-80b6-487f-8320-61d203eb80f7_webp.net-resizeimage.gif?auto=compress,format","Retina__2x_":{"url":"https://images.prismic.io/uxpincommunity%2F6fe63283-80b6-487f-8320-61d203eb80f7_webp.net-resizeimage.gif?auto=compress,format"}},"image_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>A great example is this <strong>Card</strong> <strong>Component</strong> above. Once you have the container on the canvas (Card Component) you can add a CardImage, a CardFooter and other components to it. Either double click on the container and drag and drop <em>children</em> from the library, or drag and drop <em>children</em> to any place on the canvas and then use the layers panel to nest them. To select one of the deeply nested components, press and hold the Cmd (Ctrl) button and click on the nested element.</p><p>To rearrange the order of <em>children</em> inside a <em>parent</em> use the Layers Panel. Merge automatically applies all the relevant cards, e.g. if the container has a layout set up as flexbox, <em>children</em> are going to behave according to the css.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Editing Components"},"content":{"html":"<p>Components imported from code repositories are special! You can edit them only as much as the code allows you to. React.js creates a special communication channel with the component from the place of its implementation. This communication happens through the so-called <strong>props</strong>.<strong> </strong>Props can take any value (text, hex code, object with data, number...) and trigger special styles or behaviors of the component. </p><p>Merge can automatically recognize these <em>props</em> and show them in the UXPin Properties Panel. That&#39;s why instead of the ordinary controls for color, text, border, shadow etc., in case of coded components, you see a set of predefined properties coming directly from the coded version of your component.</p><p>This is perfect for Design Systems, a nobody can mess up your components by applying the styling that isn&#39;t permitted in the system! </p>"}}},{"__typename":"PrismicDocsPageBodyTip","slice_type":"tip","primary":{"tip_type":"Info tip","tip_title":"Note","tip":{"html":"<p>All React components have their descriptions, including the library and branch name, available in the properties panel.</p>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/d93cb45c-a705-41ad-945a-bedaffa4b247_UsingReact_04.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyTip","slice_type":"tip","primary":{"tip_type":"Power tip","tip_title":"Tip","tip":{"html":"<p>Make Merge components flex by using UXPin&#39;s Flexbox Component. Select your components, then add flexbox directly from the properties panel or by right-clicking and choosing &#39;Add flexbox&#39; from the menu. Adjust flex properties as needed.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":""},"content":{"html":"<p>In the early access, the content of components can be edited by modifying the children property. </p>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/d93cb45c-a705-41ad-945a-bedaffa4b247_UsingReact_04.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Custom Styling Components"},"content":{"html":"<p>If your components don’t have specific properties, you can easily style them using the custom <strong>CSS control</strong>. It allows you to adjust properties like colors, images, padding, margins, borders, and more through a simple and intuitive interface - no coding required.</p><p></p><p>Additionally, you can enhance your components further by using <strong>Custom Props </strong>to add custom attributes, like id or define slots, to the root element. </p>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/Z2Le7JbqstJ98pFL_02_CUSTOM_CSS.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>How to Enable Custom Styles and Properties</h3><p>1. Make sure you are using <strong>@</strong>uxpin/merge-cli <strong>3.4.3 </strong>or<strong> newer</strong>.</p><p>2.<strong> </strong>Confirm that your library supports styles. If it does, you can enable this feature by following these steps:</p><ul><li>Modify your uxpin.config.js file and add the following:</li></ul>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"settings: { useUXPinProps: true }"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<ul><li>Push a new version of your library to apply the changes.</li></ul><p>3. After enabling, every component will include:</p><ul><li><strong>Custom Styles</strong>: An object type property to customize the root element’s styles.</li><li><strong>Custom Props</strong>: An object type property to add attributes to the root element.</li></ul><p></p><h4>Example:</h4>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"customStyles: { textDecoration: 'underline', fontSize: '20px' },  \ncustomProps: { id: 'my-id' },"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h4>Element Structure</h4>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"<div>\n  <h1>Hello world</h1>\n  <span>span</span>\n</div>\n"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h4>Result</h4>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"<div style=\"text-decoration: underline; font-size: 20px;\" id=\"my-id\">\n  <h1>Hello world</h1>\n  <span>span</span>\n</div>"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Reordering Components "},"content":{"html":"<p>You can easily organize code-backed components using drag-and-drop or keyboard shortcuts:</p><ul><li><strong>Drag and Drop:</strong> Adjust the order by dragging components directly on the canvas.</li></ul>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/Z07ej5bqstJ97-x4_01_REORDERING_dragdrop.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<ul><li><strong>Use Arrow Keys: </strong>Press ↑ or ← arrow to move a component forward in the layer order. Press ↓ or → arrow to move it backward in the layer order. </li></ul>"}}},{"__typename":"PrismicDocsPageBodyImageWithCaption","slice_type":"image_with_caption","primary":{"image":{"url":"https://images.prismic.io/uxpincommunity/Z07ei5bqstJ97-x2_01_REORDERING_arrow.png?auto=format,compress&rect=0,0,1504,900&w=752&h=450","Retina__2x_":{"url":"https://images.prismic.io/uxpincommunity/Z07ei5bqstJ97-x2_01_REORDERING_arrow.png?auto=format,compress&rect=0,0,1504,900&w=1504&h=900"}},"image_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>To adjust a component&#39;s nesting level:</p><ul><li>Press &quot;Cmd&quot; ↑ or &quot;Cmd&quot; ↓ arrow to move it between hierarchy levels.</li></ul><p>This helps you easily manage and keep your nested components organized!</p>"}}},{"__typename":"PrismicDocsPageBodyImageWithCaption","slice_type":"image_with_caption","primary":{"image":{"url":"https://images.prismic.io/uxpincommunity/Z07ei5bqstJ97-x3_01_REORDERING_command_arrow.png?auto=format,compress&rect=0,0,1504,900&w=752&h=450","Retina__2x_":{"url":"https://images.prismic.io/uxpincommunity/Z07ei5bqstJ97-x3_01_REORDERING_command_arrow.png?auto=format,compress&rect=0,0,1504,900&w=1504&h=900"}},"image_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Two Properties Interfaces"},"content":{"html":"<p>Merge has two options for editing the properties of components.</p><p>One which is presented on all the videos above allows you to edit all the properties via a familiar and convenient collection of inputs, dropdowns and checkboxes. The way it works is similar to the way you edit elements in the UXPin Editor. The other option is editing properties through a JSX based interface.</p><p>This version of the UI will present a full JSX code. To edit properties, choose the right configuration of properties on the right of all the listed props. </p>"}}},{"__typename":"PrismicDocsPageBodyImageWithCaption","slice_type":"image_with_caption","primary":{"image":{"url":"https://images.prismic.io/uxpincommunity%2F39f1b34b-d77e-495e-8f68-3f7c499dcc2b_two_uis.gif?auto=compress,format","Retina__2x_":{"url":"https://images.prismic.io/uxpincommunity%2F39f1b34b-d77e-495e-8f68-3f7c499dcc2b_two_uis.gif?auto=compress,format"}},"image_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>Both versions deliver the same value so feel free to use the one that feels more comfortable to you!</p>"}}}]}}},"pageContext":{"isCreatedByStatefulCreatePages":false,"categoryUid":"merge","pageUid":"using-react.js-components","meta_description":"UXPin's merge Docs, using react.js components for new and advanced users","meta_image":"https://images.prismic.io/uxpincommunity/fa3875f8df8606e6405ba46165becc1ea6ed3d34.png?auto=compress,format","meta_title":"Using React.js Components | Merge","page_title":"Using React.js Components | Merge"}}