The list component can be used in cards to create a different style of selection that lists out each of the specified elements.
Follow the below steps to create a selectable listing.
Top tips for Styling
Follow the below steps to create a selectable listing.
- Drag a list component into the card editor.
- Open the “Instructions” property.
- Click the plus button to add a dimension. This dimension will be the dimension that contains the elements that are desired to be selected from.
- Click on the pencil icon to open the set editor. Add the desired elements accordingly and save changes.
- Either place a container or a button within the list. For this example we will use buttons.
- These components serve the same function effectively by making use of the “Set Context” or “Set Variables” properties, but the difference between them is the styling options. A container provides more styling options as the text component needs to be dragged in and is separate. A button is the simpler option.
- Open the “Text” property of the button through the calculator icon.
- Set the button text to the ELEMENT of the dimension selected in the List set editor. (e.x. ELEMENT(”Department”).
- Open the “Set Context” property of the button through the calculator icon.
- Set the dimension selected in the List set editor to the ELEMENT context. Follow the below structure:
- “[Dimension Name]=”&ELEMENT(”Dimension Name”)
- See working example below:
“Department=”&ELEMENT(”Department”)
Top tips for Styling
- Use the “Set Variables” component to have a variable which tracks which element is selected. This can be used in a conditional colour formula on the button background colour or text colour property so the button can display the selected element in a different formula.
- Example variable formula:
"active="&ELEMENT("Department")
- Example colour formula:
IF( ELEMENT("Department") = VARIABLE("active") , "#000" , "#f0f0f0" )
- Example variable formula:
- Wrap the list in a container, set the height property to a static pixel value and the overflow-y property to scroll on the container. This makes your list scrollable if the number of elements is lengthy.
- Try different options on the List “List Type” property to rearrange the elements