Overview
What Database does in SXL Studio: datasets, mappings, assets, Apply Data, Generate instance, and practical workflow in Figma.
Overview
Database connects your design layers in Figma with external content. Instead of filling cards, lists, and tables manually, you prepare data, define mapping rules, and run Apply Data or Generate instance.
| Building block | Stored as | What it is |
|---|---|---|
| Dataset | .json / .csv | Rows of content (a JSON array/object or a CSV table) |
| Asset | image file | A reusable image (base64 / data URL or a Git path) |
| Mapping | .map.json | Rules linking dataset keys → Figma layers (fields[]) |
| Action | What it does |
|---|---|
| Apply Data | Fills the existing selected nodes from a dataset through a mapping |
| Generate instance | Clones a template instance once per dataset row, then fills each row |
This keeps UI content synchronized with real product data and reduces manual errors.
What you can control
Database can apply data to:
- TEXT layers (
characters); - image-capable layers (
fills) from URLs, uploaded assets, data URLs, or Git paths; - INSTANCE component properties via directives;
- node visibility/opacity/lock via directives;
- row visibility in list-like containers via
@rows.
It also supports:
- Auto-hide unused for mapping targets;
- multi-row generation from one template instance;
- Git-backed datasets/mappings/assets.
Database workspace
The Database tab has two areas:
| Area | Purpose |
|---|---|
| Left panel | File tree (datasets, mappings, assets, folders) |
| Center panel | Dataset or mapping editor |
File types
- Dataset: JSON/CSV data source.
- Mapping (
.map.json): key/layer binding rules. - Asset: uploaded image file for replacements.
Main actions
Apply Data
Runs all mappings in selected scope and writes values to matching layers.
Available scopes:
- Selection (default)
- Page
- Document
Use Selection for fast iteration; use Page/Document for full updates.
Generate instance
Creates multiple rows/instances from one selected template and applies mapping row-by-row.
Typical use cases:
- product card grids,
- pricing rows,
- menu/catalog previews,
- large list mocks with realistic content.
Typical workflow
- Create/import a dataset (
.jsonor.csv). - Create a mapping (
.map.json) and set fields. - Select target objects in Figma.
- Click Apply Data.
- Optional: run Generate instance to duplicate rows automatically.
Plan-dependent features
Some controls depend on active feature flags (plan/tier), for example:
- Generate instance,
@prop/@nodedirectives,- Auto-hide + component binding.
If your plan does not include a feature, related controls may be hidden or ignored.
Related pages
- Full data/mapping format and keys: Data files & mappings
- Apply and generation behavior: Apply & Generate
- Git workflow for files: Git integration