Fluent Commerce Logo
Docs
Sign In

Configuring Components with Dynamic Attributes

Essential knowledge

Authors:

Cameron Johns, Cille Schliebitz, Anita Gu

Changed on:

3 Feb 2025

Overview

This lesson explores the use of Dynamic Attributes within components, a powerful mechanism for making component content configurable. We'll demonstrate how to create a component, in this case an

`InfoBox`
that appears when a map pin is clicked, and how to fully configure the information displayed within it directly from the Manifest using Dynamic Attributes. This approach allows for flexible and data-driven component content.

Key points

  • Dynamic Content: Learn how Dynamic Attributes enable you to configure the information displayed within a component without modifying its code.
  • Manifest-Driven Configuration: Understand how to define and configure Dynamic Attributes within the Manifest, controlling the content of components.
  • InfoBox Example: This lesson uses an InfoBox component that appears on pin click as a practical example of using Dynamic Attributes.
  • Flexibility and Reusability: Dynamic Attributes make components more flexible and reusable, as their content can be easily adapted through Manifest configuration.

Watch the video below to learn how to use

`DynamicAttributes`
within your components.

`DynamicAttributes`
mean that the information to be displayed in the component is configurable.

For example, the

`fc.card.attribute`
 component displays the fields specified in the manifest configuration for that instance of the card. Similarly, the 
`fc.list`
component columns are dynamically configured from the manifest.

For this scenario, a small 

`InfoBox`
 will 'pop up' when a location pin is clicked on the map. The information displayed in this
`InfoBox`
component will be fully configurable from the Manifest by using
`DynamicAttributes`
.

Right-click to download the code for the InfoBox.tsx file here.

To learn more about Dynamic Attributes, see UX Configuration - Common Concepts > Dynamic Attributes section

Using DynamicAttributes Within Components

This video explains how to use

`DynamicAttributes`
within components