> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qomicex.top/llms.txt
> Use this file to discover all available pages before exploring further.

# Data

## Data

Declares a data source. `Data` renders nothing; it only fetches/reads data.

## Signature

```xml theme={null}
<Data Name="News" Type="Json" Source="Url"
      Url="https://api.example.com/news"
      Refresh="3600" />

<Data Name="Cover" Type="Binary" Source="File"
      Path="./cover.png" Mime="image/png" />
```

## Attributes

| Attribute | Type | Required | Default | Description |
| :- | :- | :- | :- | :- |
| `Name` | identifier | No | `Data` | Data source name, unique |
| `Type` | `Json` / `Text` / `Xml` / `Binary` | No | `Json` | Parse type |
| `Source` | `Url` / `File` | No | `Url` | Origin |
| `Url` | https URL | Source=Url | — | Remote address; supports `{Inputs.*}` |
| `Path` | path | Source=File | — | Local path; supports `{Inputs.*}` |
| `Mime` | string | No | — | Binary MIME type |
| `Refresh` | 0–86400 | No | `3600` | Cache lifetime in seconds |
| `Async` | `True` / `False` | No | `True` | Load in the background without blocking render |

## Data shape

| Type | Bound value |
| :- | :- |
| `Json` | Parsed object/array |
| `Text` | String |
| `Xml` | `{ Root: { Name, Attributes, Text, Children } }` |
| `Binary` | `{ Url, Base64, Mime, Size }` |

## Access

* Named source: `{Data.News.Title}` or `{News.Title}`
* Default source (Name=Data): `{Data.Title}`
* Per-source status: `{Data.Status.News}` = `Loading` / `Completed` / `Error`
* At most 8 data sources.

## Local paths

* Absolute paths are used as-is.
* Relative paths: for a locally imported widget the base is the `.qwidget` directory; for a widget imported by URL the base is the launcher data directory.
* The editor info panel shows the resolved absolute path.

## Caching

* The cache is reused for `Refresh` seconds; `0` means refresh on every mount.
* Dynamic URL/Path containing `{Inputs.*}` bypasses the cache and refetches when inputs change.
* Non-binary data is cached in localStorage; binary data is cached in memory only.
* The `Refresh` action refetches expired data sources.

## Example

```xml theme={null}
<Data Name="News" Type="Json" Url="https://api.example.com/news" Refresh="600" />
<Data Name="Feed" Type="Xml" Url="https://example.com/feed.xml" />
<Data Name="Cover" Type="Binary" Source="File" Path="./cover.png" />

<Text Value="{Data.News.Title}" />
<List Items="{Data.News.Items}" As="Item">
  <ListItem><Text Value="{Item.Title}" /></ListItem>
</List>
<Image Src="{Data.Cover.Url}" />
```

## Gotchas

* `Url` / `Path` support `{Inputs.*}`; the resolved URL must still be https:443 on an approved host. Parameterize query values or path segments, not the host.
* Input changes cancel the old request and refetch; dynamic sources are not cached.
* Online requests require an approved domain; non-https:443 and private-network addresses are rejected.
* Text/JSON/XML are limited to 1MB, binary to 8MB.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.