# General Translation Platform: JsxElement
URL: https://generaltranslation.com/en-GB/docs/platform/core/reference/types/jsx-element.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Structured JSX-like element used in translatable content. API reference for JsxElement type.

`JsxElement` lets General Translation preserve an element&#39;s structure inside translatable [`JsxChildren`](/docs/platform/core/reference/types/jsx-children) content. It captures an element&#39;s tag, identifier, GT properties, and child content in a compact, serialisable form.

## Overview [#overview]

Each `JsxElement` field is optional. The `t` field holds the tag name, `i` an internal identifier, `d` the GT properties, and `c` the element&#39;s children.

```typescript
type JsxElement = {
  t?: string;      // tag name
  i?: number;      // id
  d?: GTProp;      // GT data/properties
  c?: JsxChildren; // children
};
```

## Properties [#properties]

| Property         | Description                   | Type                                                              | Optional |
| ---------------- | ----------------------------- | ----------------------------------------------------------------- | -------- |
| [`t`](#tag)      | HTML tag name.                | `string`                                                          | Yes      |
| [`i`](#id)       | Internal identifier.          | `number`                                                          | Yes      |
| [`d`](#gt-props) | GT properties and attributes. | `GTProp`                                                          | Yes      |
| [`c`](#children) | Child content.                | [`JsxChildren`](/docs/platform/core/reference/types/jsx-children) | Yes      |

### `t` [#tag]

**Type** `string` · **Optional**

HTML tag name, such as `'div'`, `'a'`, or `'h1'`.

### `i` [#id]

**Type** `number` · **Optional**

Internal identifier used by General Translation.

### `d` [#gt-props]

**Type** `GTProp` · **Optional**

GT properties and attributes for the element. `GTProp` contains branch content (`b`), a transformation type (`t`), and HTML attribute keys:

```typescript
type GTProp = {
  b?: Record<string, JsxChildren>; // branches (e.g. plural/branch content)
  t?: 'p' | 'b';                   // transformation type: 'p' (plural) or 'b' (branch)
} & HtmlContentPropKeysRecord;
```

The HTML attribute keys map short GT keys to their HTML attributes:

| GT key | HTML attribute     |
| ------ | ------------------ |
| `pl`   | `placeholder`      |
| `ti`   | `title`            |
| `alt`  | `alt`              |
| `arl`  | `aria-label`       |
| `arb`  | `aria-labelledby`  |
| `ard`  | `aria-describedby` |

*Note:* transformations are only read on the server side when `t` is `'p'` (plural) or `'b'` (branch).

### `c` [#children]

**Type** [`JsxChildren`](/docs/platform/core/reference/types/jsx-children) · **Optional**

Child content of the element.

## Example [#example]

```typescript
import { JsxElement, Variable } from 'generaltranslation/types';

// Simple element
const heading: JsxElement = {
  t: 'h1',
  c: ['Welcome']
};

// With attributes
const button: JsxElement = {
  t: 'button',
  d: { ti: 'Submit form' },
  c: ['Submit']
};
```

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
