@tiendanube/nube-sdk-jsx
v0.16.0
Published
Library for building JSX interfaces for NubeSDK
Downloads
957
Maintainers
Readme
@tiendanube/nube-sdk-jsx
Library for building JSX-based UI components in NubeSDK.
About
@tiendanube/nube-sdk-jsx enables developers to use JSX/TSX syntax to define UI components declaratively within NubeSDK. This package simplifies UI development by allowing a more familiar and ergonomic way to create interfaces while maintaining compatibility with the NubeSDK UI system.
Apps in NubeSDK run inside isolated web workers, without direct access to the DOM. This package ensures that JSX components are converted into structured objects, which are then interpreted by the platform for rendering.
Installation
npm install @tiendanube/nube-sdk-jsx @tiendanube/nube-sdk-ui @tiendanube/nube-sdk-typesNote:
@tiendanube/nube-sdk-uiand@tiendanube/nube-sdk-typesare peer dependencies and must be installed alongside this package.
Example Usage
import type { NubeSDK } from "@tiendanube/nube-sdk-types";
import { Field } from "@tiendanube/nube-sdk-jsx";
function MyComponent() {
return (
<>
<Field
label="First Name"
name="firstname"
onChange={(e) => {
console.log(`User first name: ${e.value}`);
}}
/>
<Field
label="Last Name"
name="lastname"
onChange={(e) => {
console.log(`User last name: ${e.value}`);
}}
/>
</>
);
}
export function App(nube: NubeSDK) {
nube.send("ui:slot:set", () => ({
ui: {
slots: {
after_line_items: <MyComponent />,
},
},
}));
}Example Project Setup
A minimal example project using @tiendanube/nube-sdk-jsx is available in the repository under:
This repository includes example projects to help you get started quickly:
This example includes a pre-configured setup with:
tsupfor building the project.tsconfig.jsonproperly set up for JSX support.- No need to manually specify the JSX runtime.
Developers can refer to this project as a starting point to quickly integrate JSX components with NubeSDK.
Official Documentation
For more details about NubeSDK and how to build apps, check out our official documentation:
Support
- Questions? Use GitHub Issues.
- Found a bug? Open an issue with a reproducible example.
© Tiendanube / Nuvemshop, 2025. All rights reserved.
