Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 38 ยท Components and ALM

Canvas Components and Component Libraries

Reuse UI in canvas apps with components: input and output properties, behavior properties, component libraries, updates across apps and design-system tips.

If you copy the same header, button or card into twenty screens, one change means twenty edits. A component lets you build it once and reuse it everywhere. A component library shares components between apps, so a company can keep one consistent look.

What is a canvas component?

A component is a custom control made from other controls, with its own properties. You create it in the Tree view by switching from Screens to Components, then New component. Inside, you place labels, icons, buttons and so on, and you define custom properties.

A component has no access to the app's variables, collections or controls. This is intentional: it keeps components reusable. Everything it needs comes in through input properties, and everything it reports goes out through output properties or behavior properties.

Custom properties

When you select the component, choose New custom property. You choose a Property type:

  • Input: a value the app provides (a title, a colour, a table). The component's controls read it, for example Label1.Text = ComponentName.Title.
  • Output: a value the component calculates for the app (the selected item, a validity flag). Set the output's formula in the component's properties.
  • Input function (behavior): an event the component raises, such as OnSelectItem. The app writes the response formula, like Set(varPicked, Self.Picked).
  • Output function: a function the app can call on the component (for example Reset).

Data types: Text, Number, Boolean, Date, Color, Table, Record, Screen, Image and more. Pick the exact type; a Table input lets you also specify columns.

Parts of a component

Input App gives values in
Output Component reports values
Behavior Events the app answers

No direct access to app variables.

1 / 2

A component as a function: a stand-in

A canvas component behaves like a function with typed inputs, outputs and callbacks. This stand-in builds a "rating stars" component that way. It models the contract; it does not render real controls.

JS Stand-in: a component with inputs, outputs and an event

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Component libraries

A single component lives inside one app. To share it, move it to a component library:

  1. In the maker portal choose Solutions (or More, Components), then New, then Component library (older UI: Apps, Component libraries).
  2. Add and design components as in an app.
  3. Save and Publish the library.
  4. In an app, choose Insert then Get more components (or the Components icon, then Get more components), pick the library and import its components.

Imported components behave like normal controls. When a library is republished, apps using it show an update available message; the app maker chooses to update, so changes never break an app by surprise.

Treat a library like a small product:

  • Version your changes with notes.
  • Keep property names stable; renaming one breaks apps that use it.
  • Put the library in a solution so it can move to test and production (Solutions and Environments).
  • Document how to use each component in its description.

Keeping a design system consistent

Combine a library with a theme: store colours and fonts as input properties or as a small theme component with output properties such as PrimaryColor. Apps read Theme.PrimaryColor instead of hard-coded RGBA(...) values, so a rebrand is one change.

JS Stand-in: a theme component feeding controls

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Components and performance

  • A component adds overhead per instance; for a list item shown 200 times, a simple gallery template is lighter.
  • Avoid formulas inside components that call data sources; pass data in as inputs.
  • Test a library update in a copy of the app before updating the production one.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. How does an app give a component a value?

    Components cannot see app variables; inputs carry data in.
  2. 2. What is a behavior (input function) property used for?

    Behavior properties let the component raise events such as OnSelect whose formulas the app writes.
  3. 3. How are component libraries shared?

    Apps import components from a published library and can update them later.
  4. 4. Why keep property names stable in a library?

    Apps bind to property names, so renames are breaking changes.

Summary

  • Components are reusable controls with input, output and behavior properties, isolated from app variables.
  • Libraries share components across apps; updates are opt-in per app.
  • Use a theme component for consistent styling, keep names stable, and ship libraries in solutions.
  • Mind the per-instance cost in large galleries.

Next: Solutions and Environments