> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements/api-reference/components/collections/collections-in-properties-json.md).

# Collections in properties.json

Display collections in the component inspector

After creating your collection folder structure, you need to register it in your component's main `properties.json` file. This makes the collection appear in the inspector panel alongside your other component controls.

## Syntax

Add a collection reference using the `collection` control type:

```json
{
    "title": "Collection Title",
    "property": "collectionName",
    "collection": {
        "identifier": "com.company.component.collections.name"
    }
}
```

## Parameters

| Property                | Required | Description                                                  |
| ----------------------- | -------- | ------------------------------------------------------------ |
| `title`                 | Yes      | Display name shown in the inspector                          |
| `property`              | Yes      | The property name used to access the collection in templates |
| `collection.identifier` | Yes      | Must match the `identifier` in your collection's `info.json` |

## Examples

### Basic Collection Reference

Add a features collection to your component:

```json
{
    "groups": [
        {
            "title": "Content",
            "icon": "square.stack",
            "properties": [
                {
                    "title": "Features",
                    "property": "features",
                    "collection": {
                        "identifier": "com.company.features.collections.features"
                    }
                }
            ]
        }
    ]
}
```

### Tags Collection with Icon

The Grid, Flex, and Container components use a tags collection for filtering:

```json
{
    "groups": [
        {
            "title": "Tags",
            "icon": "tag",
            "properties": [
                {
                    "title": "Tags",
                    "property": "tags",
                    "collection": {
                        "identifier": "com.realmacsoftware.grid.collections.tags"
                    }
                }
            ]
        }
    ]
}
```

### Audio Playlist Tracks

The Audio Playlist component registers its tracks collection:

```json
{
    "groups": [
        {
            "title": "Tracks",
            "icon": "music.note",
            "properties": [
                {
                    "title": "Tracks",
                    "property": "tracks",
                    "collection": {
                        "identifier": "com.realmacsoftware.audioPlaylist.collections.tracks"
                    }
                }
            ]
        }
    ]
}
```

### Multiple Collections

Components can have multiple collections. Each gets its own group for clarity:

```json
{
    "groups": [
        {
            "title": "Slides",
            "icon": "photo.stack",
            "properties": [
                {
                    "title": "Slides",
                    "property": "slides",
                    "collection": {
                        "identifier": "com.company.slider.collections.slides"
                    }
                }
            ]
        },
        {
            "title": "Thumbnails",
            "icon": "square.grid.3x3",
            "properties": [
                {
                    "title": "Thumbnails",
                    "property": "thumbnails",
                    "collection": {
                        "identifier": "com.company.slider.collections.thumbnails"
                    }
                }
            ]
        }
    ]
}
```

### Collection with Related Controls

Place collection controls alongside related settings:

```json
{
    "groups": [
        {
            "title": "Accordion",
            "icon": "list.bullet",
            "properties": [
                {
                    "title": "Items",
                    "property": "items",
                    "collection": {
                        "identifier": "com.company.accordion.collections.items"
                    }
                },
                {
                    "divider": {}
                },
                {
                    "title": "Default State",
                    "property": "defaultState",
                    "responsive": false,
                    "segmented": {
                        "default": "closed",
                        "items": [
                            { "title": "Open", "value": "open" },
                            { "title": "Closed", "value": "closed" }
                        ]
                    }
                }
            ]
        }
    ]
}
```

## Accessing Collection Data

Once registered, the collection data is available:

* **In templates**: `collections.{property}` (e.g., `collections.features`)
* **In hooks.js**: `rw.collections.{property}` (e.g., `rw.collections.features`)

See [Accessing Data in Templates](/elements/api-reference/components/collections/accessing-data-in-templates.md) and [Data Collections in hooks.js](/elements/api-reference/components/collections/data-collections-in-hooks.js.md) for usage details.

## Best Practices

1. **Use descriptive property names** - The property name becomes part of the template syntax, so make it clear and concise.
2. **Add appropriate icons** - Use SF Symbols that represent the collection content (e.g., `music.note` for tracks, `tag` for tags).
3. **Group collections logically** - Place collections in dedicated groups or alongside related controls.
4. **Match identifiers exactly** - The identifier must match your collection's `info.json` exactly, including case.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/elements/api-reference/components/collections/collections-in-properties-json.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
