Showcase control
When do you use it?
Add a control to activate showcase for a given field or set of selectors via a list of labels, buttons or a dropdown menu.
Basic Editor
To create a showcase control, follow these steps:
Click the settings icon on the right
to open the editor, then click "Add custom control".
In the menu that opens up, change the first dropdown to "Showcase elements by field".
Use the other dropdowns to customize the look and location of your controls
Click Save at the bottom to save your changes
To add multiple controls, repeat steps 1-4 for each control.
Advanced Editor
If you like to get into the nitty-gritty of the advanced editor, you can type out controls directly. The advanced editor also allows for more advanced controls, as explained below.
Example
Showcase by field:
@controls {
bottom {
showcase {
by: "State";
}
}
}
Showcase using custom selectors:
@controls {
bottom {
showcase {
option {
label: "People";
selector: person;
}
option {
label: "Orgs";
selector: organization;
}
}
}
}
Supported properties
byis the field you'd like to use for showcasing wrapped in double quotes. If you don't includeby: fieldyou need to list out each option - see "supported children" guidance below.modecontrols how the selection is showcasednormalshowcase the selection plus any connections between the showcased elements (default)looseshowcase the selection plus neighboring elementsstrictonly showcase the selection itself
ascontrols how the control is presented. Do you want a list of labels, buttons, or a dropdown for activating showcase?labelsshow options as a list of clickable labelsbuttonsshow options as a group of buttonsdropdownshow options as dropdown
multiplecontrols whether more than one value can be selected at a timefalseallows the reader to only select a single optiontrueallows the reader to select multiple optionsmatch-allallows the reader to select multiple options, and only showcases items that match all of the selected options
placeholderthe text to display when nothing is selected (foras: dropdownonly)summaryoverride the summary that's shown for the current selection (foras: dropdown). The summary will be shown regardless of what's selected so there's no need to useplaceholderin this case.defaultdefines which field values should be selected by default (forby: "field"only). Useselect-allto select everything by default.
Check out our controls reference to see the full list of properties and values recognized by the showcase control.
Supported children
If you want to use custom selectors to build the showcase, you'll need to list each option out separately. The options are defined by option blocks nested within the control and each option supports the following properties:
labelthe text to display for that optionselectorthe selector to use for the showcasedefaulttruevalue is selected by defaultfalsevalue is unselected by default
Additional examples
Showcase by state and include neighboring elements, allowing multiple states to be selected at the same time:
@controls {
bottom {
showcase {
by: "State";
mode: loose;
multiple: true;
}
}
}Showcase by state using a dropdown menu, and include a placeholder with instructions:
@controls {
bottom {
showcase {
by: "State";
as: dropdown;
placeholder: "Select a state";
}
}
}Showcase by state and select all states by default:
@controls {
bottom {
showcase {
by: "State";
default: select-all;
}
}
}Last updated
Was this helpful?