---
title: "location: attribute in the TypeShade language reference"
description: "location, an attribute in the TypeShade language reference. The decorated form of location<I, T>, a numeric shader IO location: uv: location<0…"
url: https://typeshade.dev/reference/attributes/location/
language: en
---

# `@location`

Attribute

The decorated form of `location<I, T>`, a numeric shader IO location: `uv: location<0, vec2>` for `@location(0) uv: vec2`.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
declare function location(n: number): (target: unknown, context?: unknown) => void
```

## Parameters

- `n` `number`

The declaration also names what the TypeScript decorator runtime hands a decorator, `target` and `context`. A call passes neither.

## Examples

- [`gallery/id-pick/id-pick.shade.ts`](https://typeshade.dev/guide/examples/id-pick/)
- [`gallery/twin-structs/twin-structs.shade.ts`](https://typeshade.dev/guide/examples/twin-structs/)

## See also

- [Attributes](https://typeshade.dev/reference/attributes/)
