AlxixDocs

DocumentationDevelopers

Code components

Write React with any npm package and use it on the canvas like any other block.

  1. 1In Professional mode, open Components in the project and create a component.
  2. 2Write it in React and TypeScript; add npm packages by name.
  3. 3Declare its properties. They appear in the right panel when the component is selected.
  4. 4Insert it on any page.
PriceTag.tsx
export default function PriceTag({ amount, currency = 'TRY' }: {
  amount: number;
  currency?: string;
}) {
  const text = new Intl.NumberFormat('tr-TR', { style: 'currency', currency }).format(amount);
  return <span className="price">{text}</span>;
}

Code components run in an isolated frame, so they cannot reach your platform session. They are available from the Pro plan.