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

# collection

> Field type collection — UUID de categoria/coleção.

# `collection`

| | |
| - | - |
| **type** | `collection` |
| **Valor salvo** | `string` — UUID da categoria |

No backend, coleção é categoria. A URL da vitrine usa `/collections/:handle`. O campo não grava o handle.

## Propriedades

O validador exige `id` e `type`. `label` é recomendado. `default` é opcional.

O picker grava `collection.id`. `storefront.products.list({ collection: settings.collection })` envia esse id como `categoryId`. Sem id, `products.get` e `categories.get` devolvem `null` quando o argumento é vazio.

## Exemplo

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "collection",
  "type": "collection",
  "label": "Coleção"
}
```

## Runtime — filtrar produtos

```jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
const products = await storefront.products.list({
  first: settings.limit ?? 8,
  collection: settings.collection,
});
```

Ver [Coleção](https://docs-loja.usecorvex.com.br/data/resources/category.md).


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