Create custom components to reuse across pages with component builder
Reuse custom components across experiences and pages in UI Builder.
Create custom components in UI Builder's component building UI. The component building UI shares many similarities to page building and enables you to configure components the same way you would when configuring a page in UI Builder.
The power of custom components
Building custom components improves efficiency, consistency, and maintainability across your experience. By creating reusable UI elements, you avoid duplicating configurations, ensure a uniform look and feel, and make it easier to manage updates or design changes. Custom components also simplify complex layouts, support flexible configurations, and enable for easier testing and debugging. They’re also helpful in team environments, where shared components help streamline collaboration and keep the user experience consistent at scale.
Custom components are especially valuable when designing pages for different user types within your experience. For example, you can create a reusable component that includes both a list and a data visualization, then tailor its content or behavior based on the user group enabling you to maintain a consistent layout while delivering role-specific information.
Components edited in the Component Builder will automatically update on all pages where they are used.
Custom components or page collections
To build efficient, scalable digital experiences, it’s important to reuse elements wherever possible. Two ways to do this are through custom components and page collections. Each serves a distinct purpose depending on the scope of reuse that you need.
- Custom Components
- Use custom components when you want to replicate a specific part of a page like a heading, list, form, or buttons across multiple pages.
- Page Collections
- You want to reuse an entire page layout and configuration across multiple pages or experiences.
Custom component UI
You can access the component builder in UI Builder by selecting Create in the header or the Component tile on the UI Builder home page.
Components built with UI Builder can be found in the toolbox when adding a component to a page and in the component list on the home page of UI Builder. You can update or modify custom components by locating it in the components list on the home page of UI Builder.
Use test values in component builder to supply simulated values for required and optional URL parameters when building a custom component. Test values help validate how a component will act when added to a page by ensuring bindings and data resources are functioning correctly. For more information about test values see, Test values in a page.
You can quickly duplicate a custom component from the component settings screen by selecting Duplicate, which creates an exact copy of the component for reuse or modification.
Component Builder vs NOW CLI Component Development
There are two ways to build components for UI Builder. The first is using the low-code component within UI Builder, which offers a drag-and-drop interface for creating custom components. The second is using NOW CLI developer tools to build components through code. Both methods produce components that can be added to the UIB toolbox and reused across experiences. Keep in mind that changes to included components may impact both types.
Although both tools create components for UI Builder, there are important differences to consider.
- Components built within UI Builder can reference controllers and data resources.
- Creates "Macroponent Components," which are stored in the sys_ux_macroponent table.
- Component Builder is ideal for users who prefer a visual, drag-and-drop interface for building components.
- Great for quickly creating simple to moderately complex components.
- Intended for developers who need to write custom HTML, CSS, and JavaScript.
- Suitable for building complex and customizable components.
- Components created with NOW CLI are stored in the sys_uib_toolbox_component table.
Best practices
The UI Builder custom component builder lacks governance capabilities and can lead to duplication and inconsistency in your experience. Teams may create similar components with slight variations, resulting in a fragmented UI, and confusing user experience. It is recommended that your team completes regular audits and cross-team communication to maintain alignment and avoid fragmentation as your experiences grows.
All components are designed to be upgrade safe, as long as their security policy is set to read_only. This provides greater upgrade protection for larger components or page partials compared to other deployable units like bundles and page templates. However, this also means that out-of-the-box (OOTB) components may not be editable.
Create components to reuse across pages
Build reusable custom components to use across experiences and pages in UI Builder.
始める前に
Role required: ui_builder_admin
このタスクについて
In this Component Builder example, we will create a stopwatch component to track elapsed time, which can be added to any page. The component will include customizable properties that can be modified once it's placed onto a page.
手順
タスクの結果
Your custom component is now available in the UI Builder toolbox.