> ## 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.

# gifts.eligible

> Brindes elegíveis para o carrinho atual (quantidade + total).

# storefront.gifts.eligible(input)

Retorna só os brindes que passam nas regras de quantidade e total do carrinho.

Use em handlers / `useEffect` no **cliente** — **não** em `defineSectionData` (SSR bloqueia `eligible`, como `coupons.validate`).

***

## Input

| Campo | Obrigatório | Descrição |
| - | - | - |
| `cartQuantity` | ✅ | Soma de quantidades dos itens |
| `cartTotal` | ✅ | Subtotal do carrinho |

***

## Retorno

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
Connection<Gift>
```

***

## Exemplo

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { useCorvexCart, useStorefront } from '@corvex/theme-sdk';

function FreeGiftsBanner() {
  const storefront = useStorefront();
  const { cart } = useCorvexCart();
  const [gifts, setGifts] = useState([]);

  useEffect(() => {
    if (!cart) return;
    let cancelled = false;

    storefront.gifts
      .eligible({
        cartQuantity: cart.itemsCount ?? cart.itemCount ?? 0,
        cartTotal: cart.subtotalPrice ?? cart.totalPrice ?? 0,
      })
      .then((connection) => {
        if (!cancelled) setGifts(connection.nodes ?? []);
      });

    return () => {
      cancelled = true;
    };
  }, [storefront, cart]);

  if (!gifts.length) return null;

  return (
    <ul>
      {gifts.map((gift) => (
        <li key={gift.id}>{gift.name}</li>
      ))}
    </ul>
  );
}
```

Veja [gifts.list](https://docs-loja.usecorvex.com.br/data/queries/gifts-list.md) e [Gift (resource)](https://docs-loja.usecorvex.com.br/data/resources/gift.md).


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