Authors:
Cameron Johns, Cille Schliebitz, Anita Gu
Changed on:
3 Feb 2025
This lesson dives into the practical application of the Component SDK, focusing on how to build custom components for OMX Web Apps. We'll explore the different types of custom components you can create, the powerful hooks available for interacting with the Fluent platform, and the utility components that streamline development and ensure consistency. We'll also touch on the crucial concept of component registries.
`useAuth`
`useI18n`
`useQuery`
The Component SDK lets you build new content (or view) components, field components, and template functions for use within the OMX Web Apps.
Fluent-specific custom components include:
Custom components, such as cards, form fields, and pages, can be created to fit into existing screens/interfaces.
Custom components can easily interact with OMX functionality via the provided hooks.
Hooks are a React feature and are basically an easy way to add functionality to your components (such as making an API call and automatically showing the updates when it finishes) without having to implement it yourself.
Some examples of React hooks include:
`useState`
`useEffect`
The Component SDK provides some Fluent-specific hooks to make working with the Fluent platform quicker and simpler.
Some examples include:
`useAuth`
`useI18n`
`useQuery`
This means that with a line or two of code, you can make your custom components:
✓ load information from our (authenticated) APIs
✓ use our i18n translation services
✓ show modals or drawers over the top of the page
✓ check a user's roles to show/hide things on the UI
✓ check what actions are currently available for a given entity (Order/Wave/Product, etc) in the workflow and generate buttons and forms to perform these actions (this is what we mean when we say it "adapts to your workflows")
Some utility components are provided to make building custom components easier and more consistent.
The UX Framework provides some "component primitives" that can be used as base components to build more complex components on top. The advantage of this is that these utility components:
✓ provide a consistent look and feel
✓ update according to theme options
✓ enable mobile responsiveness
Examples of utility components include:
Before a custom component can be used in an OMX web app, it must be registered with one of the three registries:
Learn more about registering SDK components
Copyright © 2025 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.