Skip to content

Data Files

Aleksi Peebles edited this page Feb 5, 2021 · 1 revision

JSON data files are used in building the component library website. Component JSON data can contain any data that can be passed to the component in a $this->render() call.

Main data file

The component's machine name should be used for the main data file name.

Example: finna-panel.json.

Variation data files

A component may also have other data files to demonstrate variations or different content. Additional data files should have a tilde (~) and a variation name after the component's machine name.

Example: finna-panel~collapsible.json.

Merged data

When the component library website is built, variation data is merged with the data in the main data file. This means that variation data files only need to contain data that is different from the main data file.