Overview
What Database is in SXL Studio: backend-powered data inside Figma, JSON and CSV workflows, mappings, component control, and full design–data synchronization.
Why Database matters
Imagine you have 200 product cards, 40 promotional banners, and a pricing table with 12 rows. Filling them by hand takes hours and always introduces mistakes. Content changed? Do it all over again.
Database solves this problem. You load the data once, describe the binding rules, and the plugin fills your design in seconds. Data updated? One click — the design follows.
It goes far beyond simple text replacement. Database lets you:
- populate text layers and swap in images;
- control component properties (component props): toggle variants, boolean flags, instance swap values;
- show and hide layers conditionally;
- generate multiple instances from a single template;
- sync data files with a Git repository.
Key idea: Database is a bridge between backend data and design. You work with the same JSON/CSV files your developers use and get a layout that always reflects real data.
Database tab interface
Layout
The Database tab has two zones:
| Zone | Purpose |
|---|---|
| Left panel | File tree: datasets, mappings, assets, folders |
| Central area | Editor for the selected file, or an empty state |
Left panel — file tree
The tree displays three object types:
- Datasets (file icon) — JSON or CSV data files;
- Mappings (script icon) — rules that bind data to layers;
- Assets (thumbnail) — images for substitution.
Files are organized into folders. The panel supports:
- search by file name and mapping field contents;
- drag-and-drop of files between folders;
- context menu (right click): Rename, Duplicate, Delete, Copy Path;
- multi-select via
Shift/Cmd/Ctrlwith batch actions; - shortcuts:
F2to rename,Delete/Backspaceto delete.
Toolbar
| Button | Action |
|---|---|
| New Data | Create a dataset (JSON or CSV) |
| New Mapping | Create a mapping file |
| Folder (icon) | Create a new folder |
| Upload | Upload a file from disk (JSON, CSV, or image) |
| Refresh (icon) | Refresh the Git file list (if a repository is connected) |
Uploaded WebP and SVG images are automatically converted to PNG.
Header actions (plugin top bar)
When the Database or Tokens tab is active:
| Button | What it does |
|---|---|
| Apply Data | Apply data to the layout through all mappings |
| Apply Tokens | Apply token bindings |
Both buttons include a scope selector (dropdown):
- Selection — selected objects only (default);
- Page — the entire current page;
- Document — the whole file.
Tip: for large files, use the
SelectionorPagescope to avoid long processing times across the entire document.
Generate Instance
At the bottom of the tree (when the feature is available) you'll find the Generate instance button. It creates multiple copies of a component, each filled with its own data row.
Learn more: Apply & Generate.
Central area — editors
Dataset editor
Clicking a dataset file opens an editor with two modes:
For JSON:
- full-featured code editor (Monaco) with syntax highlighting;
- structure validation on save.
For CSV:
- Code mode — raw CSV editing in a text editor;
- Table mode — a spreadsheet-like table with columns.
In Table mode you can:
- rename columns (double-click the header);
- add rows and columns;
- drag columns to reorder;
- use the context menu for row operations.
Tip: start with CSV and Table mode when your data is tabular (products, users, content). Use JSON when data is nested or contains objects.
Mapping editor
Clicking a mapping file opens the field table:
| Column | Description |
|---|---|
| Key Expression | Data path in the dataset: [name], [price], [user.avatar] |
| Target Layer | Figma layer name that will receive the data |
| Fill | Fill strategy: A-Z, Z-A, or Random |
Additional mapping settings:
- Dataset — default dataset for this mapping;
- Bind component — bind to a specific component (by key);
- Auto-hide unused — automatically hide layers with no matching data;
- Auto-fill — auto-generate fields from the dataset structure.
Component control via data
Database works beyond text and images. You can control component properties through special directives in data values.
@prop directive
Value format in the dataset:
"@prop:PropertyName=value"
Examples:
[
{ "card": "@prop:HasBadge=true;Status=active" },
{ "card": "@prop:HasBadge=false;Status=inactive" }
]
Use ; to set multiple properties. Boolean values: true / false.
@hide directive
Hides a layer:
{ "promo-banner": "@hide" }
@node:visible directive
Control visibility:
{ "badge": "@node:visible=false" }
Figma limitation: component property control only works on Instance nodes. If the target layer is not a component instance, the
@propdirective will be ignored.
Data sources
Dataset files can be:
- created directly in the plugin (New Data);
- uploaded from disk (Upload);
- synced from a Git repository (GitHub / GitLab).
When synced with Git, data updates automatically on pull. Learn more: Git integration.
Quick start example
1. Create a dataset products.csv:
name,price,image,badge
"Nike Sneakers",129.90,https://example.com/nike.png,true
"Adidas T-Shirt",34.90,https://example.com/adidas.png,false
"Puma Backpack",59.90,https://example.com/puma.png,true
2. Create a mapping products.map.json with fields:
| Key Expression | Target Layer |
|---|---|
[name] | product-name |
[price] | product-price |
[image] | product-image |
[badge] | badge-icon |
3. Select the cards in Figma and click Apply Data.
The plugin finds layers named product-name, product-price, product-image, badge-icon inside the selection and fills them with data from the CSV.
Related pages
- Format details and mapping structure: Data files & mappings
- Apply and generate mechanics: Apply & Generate