Skip to content

Commit 0d493ce

Browse files
committed
....
1 parent debe126 commit 0d493ce

File tree

8 files changed

+173
-42
lines changed

8 files changed

+173
-42
lines changed

website/docs/packages/overview.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,43 @@ tags={[
1818

1919
<!-- vale on -->
2020

21-
Reusability is an integral part of application development, offering various advantages like speeding up the development process, centralizing business logic, and introducing standardization into applications. Appsmith enhances reusability by providing a feature set, which allows you to reuse widgets, queries, and JS logic across your applications.
21+
In modern application development, reusability is key to building efficiently and maintaining high standards. Appsmith empowers you to embrace reusability through Packages, a powerful feature set designed to help you create, share, and manage reusable logic and UI components across your applications.
22+
23+
Whether you need to standardize backend operations or ensure a consistent user interface, Packages provide the tools to build faster, reduce redundancy, and improve the overall quality of your Appsmith applications.
24+
2225

2326
:::info
2427
For Appsmith version v1.57 or earlier, refer to the legacy documentation for the packages. For more information, see [Package Legacy Documentation](https://appsmith-docs-git-packages-v156-get-appsmith.vercel.app/packages/overview).
2528
:::
2629

2730
## Packages
2831

29-
A package is a collection of JS and Query modules that can be shared across apps within the same workspace. With packages, developers can create, update, and share specific modules independently, making code more reusable and easier to maintain.
32+
A **Package** is a reusable bundle that can be shared across apps in the same workspace. There are two types of packages in Appsmith:
3033

3134
<ZoomImage
3235
src="/img/modules-landing.png"
3336
alt="Modules image"
3437
caption=""
3538
/>
3639

37-
### Modules
40+
### Code Packages
3841

39-
Modules are part of Package. There are two types of modules, query and JS, that can be used in multiple applications within the same workspace.
42+
Code Packages are reusable bundles that group multiple logic-based modules, which can be shared across applications within the same workspace.
43+
44+
Inside a Code Package, you can create two types of modules—Query Modules and JavaScript Modules. These modules allow you to encapsulate backend logic in a reusable, version-controlled way, helping you standardize how data is fetched and processed across your apps.
4045

4146
* **Query Modules:** Reusable datasource queries that can be used across different apps and pages. You can pass dynamic inputs to the query module, which allows you to change query parameters based on user input or widget actions. They are deployment-independent, meaning updates affect only applications in edit mode and not the deployed version.
4247

4348
* **JavaScript Modules:** Reusable objects containing JavaScript functions and logic, enabling efficient data manipulation and standardized handling. It allows you to pass data between query and JS modules, ensuring smooth integration and reuse across different applications.
4449

45-
* **UI Modules (Coming Soon):** Reusable widgets and UI components designed to enhance modularity and reusability in the user interface, streamlining the development and maintenance of consistent UI elements across multiple applications.
50+
### UI Packages
51+
52+
53+
UI Packages allow you to create and distribute reusable UI components across multiple applications in the same workspace.
54+
55+
Inside a UI Package, you can create UI Modules—self-contained user interface components that bundle widgets, logic, and internal queries into a configurable unit. These modules are designed to enhance consistency, simplify UI development, and promote reuse across your apps.
56+
57+
* **UI Modules:** Reusable widgets and UI components designed to enhance modularity and reusability in the user interface, streamlining the development and maintenance of consistent UI elements across multiple applications.
4658

4759

4860

website/docs/packages/reference/package.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
# Module
1+
---
2+
description: Learn about the Modules feature in Appsmith.
3+
title: Code Module
4+
hide_title: true
5+
---
6+
<!-- vale off -->
7+
8+
<div className="tag-wrapper">
9+
<h1>Code Module</h1>
10+
11+
<Tags
12+
tags={[
13+
{ name: "Business", link: "https://www.appsmith.com/pricing", additionalClass: "business" }
14+
]}
15+
/>
16+
17+
</div>
18+
19+
<!-- vale on -->
20+
221

322
Modules in Appsmith are integral components of a Package tailored. They are reusable components containing queries and JSObjects that can yield results across multiple applications within the same workspace.
423

website/docs/packages/reference/query-module.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
# Module Instance
1+
---
2+
description: Learn about the Modules feature in Appsmith.
3+
title: Code Module Instance
4+
hide_title: true
5+
---
6+
<!-- vale off -->
7+
8+
<div className="tag-wrapper">
9+
<h1>Code Module Instance</h1>
10+
11+
<Tags
12+
tags={[
13+
{ name: "Business", link: "https://www.appsmith.com/pricing", additionalClass: "business" }
14+
]}
15+
/>
16+
17+
</div>
18+
19+
<!-- vale on -->
20+
221

322

423

website/docs/packages/reference/ui-module-instance.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
# UI Module Instance
1+
---
2+
description: Learn about the UI Module Instance feature in Appsmith.
3+
title: UI Module Instance
4+
hide_title: true
5+
---
6+
<!-- vale off -->
7+
8+
<div className="tag-wrapper">
9+
<h1>UI Module Instance</h1>
10+
11+
<Tags
12+
tags={[
13+
{ name: "Business", link: "https://www.appsmith.com/pricing", additionalClass: "business" }
14+
]}
15+
/>
16+
17+
</div>
18+
19+
<!-- vale on -->
20+
21+
222

323

424
When you add a UI Module from a package into your application, you create a UI Module Instance. Each instance acts as a reusable, self-contained UI component that can be configured dynamically without modifying the internal structure of the module.
@@ -29,13 +49,18 @@ Inputs enable you to dynamically populate widget properties, run queries, or exe
2949
You can bind static values, widget outputs, query results, or app/user data into Inputs using JavaScript bindings.
3050

3151

32-
*Example:* If you want to pass customer details fetched from a query into the module, you can set Inputs using the query response fields.
52+
*Example:* If you want to pass customer details fetched from a query into the module, you can bind the input like:
3353

34-
```js
35-
//inputCustomerName
54+
```javascript
3655
{{getCustomerDetails.data.name}}
3756
```
3857

58+
Then inside the module, the corresponding widget (e.g., `Input1`) can use:
59+
60+
```javascript
61+
{{inputs.customerName}}
62+
```
63+
3964

4065
</dd>
4166

@@ -47,12 +72,11 @@ Allows you to access dynamic values from the UI Module Instance in your parent a
4772

4873
Outputs enable you to retrieve internal module state, computed values, or processing results without needing to understand the module's internal implementation.
4974

50-
**Accessing Module Outputs**
75+
You can access outputs using the module instance name followed by .`outputs.outputName`:
5176

52-
Module outputs can be accessed directly using the module instance name:
5377

5478
```javascript
55-
{{ModuleInstanceName.outputName}}
79+
{{ModuleInstanceName.outputs.outputName}}
5680
```
5781

5882
*Example:* If you want to display data from a module in a Table widget on your application:

website/docs/packages/reference/ui-module.md

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
# UI Module
1+
---
2+
description: Learn about the UI Modules feature in Appsmith.
3+
title: UI Module
4+
hide_title: true
5+
---
6+
<!-- vale off -->
7+
8+
<div className="tag-wrapper">
9+
<h1>UI Modules</h1>
10+
11+
<Tags
12+
tags={[
13+
{ name: "Business", link: "https://www.appsmith.com/pricing", additionalClass: "business" }
14+
]}
15+
/>
16+
17+
</div>
18+
19+
<!-- vale on -->
20+
221

322
A UI Module is a reusable container that groups widgets, queries, and JavaScript logic into a single unit. It is created inside a UI Package and is designed for reuse across multiple applications.
423

@@ -19,41 +38,33 @@ Content properties control the functional behavior of the UI Module container an
1938

2039

2140
Inputs allow you to pass dynamic values from the application into the UI Module.
22-
They act as a bridge between the app and the widgets, queries, or JS logic inside the module.
41+
They act as a bridge between the app and the widgets, queries, or JS logic inside the UI module.
2342

2443
You can create multiple Inputs when designing the module. Each Input has:
2544

2645
- **Name:** Used to reference the value inside the module.
2746

2847
- **Default value (optional):** Used if no value is passed from the application at runtime.
2948

30-
Inputs help you dynamically configure the behavior of widgets inside the UI Module without modifying the module itself.
31-
32-
**Accessing Inputs**
33-
34-
Inputs can be accessed using the same syntax across widgets, queries, and JavaScript functions within the module:
49+
You can access input values using:
3550

3651
```javascript
3752
{{inputs.inputName}}
3853
```
3954

55+
*Example 1:* If you want to show dynamic data in a widget, bind the property like:
4056

41-
- **Widget**: Use `{{inputs.inputName}}` inside widget properties such as Default Text, Label, Data, or Options.
42-
43-
*Example:* If you want to prefill a customer profile form with the user's email, create an input named `inputemail` and set the Input widget’s Default Text property to `{{inputs.inputemail}}`, passing `{{appsmith.user.email}}` from the application.
57+
```js
58+
{{inputs.ordersData}}
59+
```
4460

45-
- **Query**: Use `{{inputs.inputName}}` inside the query body to dynamically inject input values at runtime.
61+
*Example 2:* If you want to filter a query using an input value, use:
4662

47-
*Example:* If you want to fetch customer addresses based on the selected country, create a query that uses:
48-
49-
```js
50-
SELECT * FROM addresses WHERE country = {{inputs.inputCountry}}
51-
```
63+
```js
64+
SELECT * FROM addresses WHERE country = {{inputs.inputCountry}}
65+
```
5266

53-
- **JavaScript**: Use `inputs.inputName` directly inside JavaScript Object functions to dynamically operate based on input values.
5467

55-
*Example:* If you want to adjust available shipping options based on country, create a function that checks `inputs.inputCountry` and returns different options accordingly.
56-
5768

5869
</dd>
5970

@@ -68,15 +79,23 @@ Each Output has:
6879
- **Name:** Used to reference the value in the parent application.
6980
- **Value:** The internal module data, state, or computed result you want to expose.
7081

71-
**Accessing Outputs**
72-
73-
When a UI Module is added to an application, its outputs become available through the module instance name:
82+
You can access output values using the module instance name from the application:
7483

7584
```javascript
76-
{{ModuleName.outputName}}
85+
{{ModuleInstanceName.outputs.outputName}}
86+
```
87+
88+
:::note
89+
Outputs are only accessible in the parent app, not inside the module itself.
90+
:::
91+
92+
*Example:* If you want to filter a query using a value generated inside the module (e.g., customerId),
93+
create an output in the module and access it in your app query:
94+
95+
```sql
96+
SELECT * FROM orders WHERE customer_id = {{CustomerModule1.outputs.customerId}}
7797
```
7898

79-
*Example:* If you have a login module that generates an authentication token, you can access it in the parent app using `{{LoginModule.authToken}}` for subsequent API calls.
8099

81100

82101
</dd>

website/docs/packages/reference/versioning.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
# Package Version Control
1+
---
2+
description: Learn about the Modules feature in Appsmith.
3+
title: Package Version Control
4+
hide_title: true
5+
---
6+
<!-- vale off -->
7+
8+
<div className="tag-wrapper">
9+
<h1>Package Version Control</h1>
10+
11+
<Tags
12+
tags={[
13+
{ name: "Business", link: "https://www.appsmith.com/pricing", additionalClass: "business" }
14+
]}
15+
/>
16+
17+
</div>
18+
19+
<!-- vale on -->
20+
221

322
This page provides information about versioning and tagging in Packages. You can connect a Package to any Git remote repository, similar to applications. When a Package is Git-connected, you can commit changes, merge branches, and create tagged releases.
423

website/docs/packages/tutorial/js-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ hide_title: true
66
<!-- vale off -->
77

88
<div className="tag-wrapper">
9-
<h1>JS modules</h1>
9+
<h1>JS Modules</h1>
1010

1111
<Tags
1212
tags={[

website/docs/packages/tutorial/ui-module.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
# UI Modules
1+
---
2+
description: Learn about the Modules feature in Appsmith.
3+
title: UI Modules
4+
hide_title: true
5+
---
6+
<!-- vale off -->
7+
8+
<div className="tag-wrapper">
9+
<h1>UI Modules</h1>
10+
11+
<Tags
12+
tags={[
13+
{ name: "Business", link: "https://www.appsmith.com/pricing", additionalClass: "business" }
14+
]}
15+
/>
16+
17+
</div>
18+
19+
<!-- vale on -->
20+
221

322
A UI Module is a reusable, self-contained component built using widgets, queries, and JS Objects. It allows you to group UI elements, logic, and data interactions into a single unit that can be reused across multiple applications.
423

@@ -87,7 +106,7 @@ These widgets will display user details such as the user's name, email, ID, and
87106
To bind an input value to a widget, use the following syntax:
88107

89108
```js
90-
{{inputs.<inputName>}}
109+
{{inputs.inputName}}
91110
```
92111

93112
Set the widget properties as follows:

0 commit comments

Comments
 (0)