Types

JsxElement

Type definition for structured HTML-like elements in translatable JSX content

Overview

JsxElement represents structured HTML-like elements in translatable JSX content.

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

Properties

PropertyTypeDescription
t?stringHTML tag name
i?numberInternal identifier
d?GTPropGT properties/attributes
c?JsxChildrenChild content

Common GT Keys

GT KeyHTML Attribute
plplaceholder
tititle
altalt
arlaria-label

Examples

Basic Usage

import { JsxElement, Variable } from 'generaltranslation';

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

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

How is this guide?

JsxElement