This commit is contained in:
2025-11-17 18:45:35 +01:00
parent 0f58e3bdff
commit 14d6f9aa73
7607 changed files with 1969407 additions and 0 deletions

View File

@@ -0,0 +1,240 @@
# Themes & Styling
Good user interface (UI) improves user experience (UX) and increases user involvement. You can customize the style of each component in Lowcoder and use the theme feature to design the interface on a per-app or workspace basis. Features such as icon configuration and hint messages make the app interaction more user-friendly.
## Component styles
You can modify the style of all components in the **Properties** tab.
Click the color picker to select a color or write CSS color code in the text box.
You can also write JavaScript in the text box to conditionally control the style setting of the component.
## Themes
The [theme feature](https://cloud.lowcoder.dev/setting/theme) helps you quickly set the styles of all your apps within a workspace, such as the primary color of the apps and the default background color of containers. Created Themes are available and in each app you would need to apply a Theme.
### Create a theme
Workspace admins have access to theme settings. On Lowcoder homepage, go to **Settings** > **Themes**, and click **+ Create theme**. Enter the theme name, and select one of the preset default themes as the starting point.
Preview the real-time theme effect on the right.
For charts you can insert or modify the ECharts style JSON. Find a good way to create and preview these styles with the [ECharts style Editor.](https://echarts.apache.org/en/theme-builder.html)
### Apply a theme
In the app editor, switch the theme by clicking ⚙️ on the left side-bar. Select a theme from **Theme setting**.
You can also set the default theme for all your apps within a workspace in **Settings** > **Themes** on Lowcoder homepage.
### Switching themes dynamically
You can access the global variable `theme` and call the method `theme.switchTo()` to allow the end users to switch the theme of the apps on their side using JavaScript.The global variable `theme` has three fields. You can view them in the data browser.
* `id` and `name` are strings, indicating the ID and name of the current theme. When their values are empty, then the default theme is applied.
* `allThemes` is an array, including all information of available themes in the current workspace.
`theme.switchTo()` method switches the theme at the end user's side, and requires only a theme ID. When the passed value is an empty string `""`, then the default theme is applied.Once the end user switches the theme, it will be saved to the user browser's local storage. And this theme will override the default theme and apply to all apps that are used in the same browser.
#### Demo
Combining Option lists and Events, end users can switch the theme within the app. For details, see [Change theme by code demo](https://cloud.lowcoder.dev/apps/63f84ca9f5f6f66102fedf3b/view).
Follow the steps below to include this function in your app.
1. Drag and drop a **Select** component onto your canvas. Set the data value as follows.
<pre class="language-Plain"><code class="lang-Plain"><strong>{{[{ id: "", name: "Default" }, ...theme.allThemes]}}
</strong></code></pre>
2. Set the labels and values as `{{item.name}}` and `{{item.id}}` respectively. Then, you can view the default theme and all other available themes in the current workspace.
3. Insert a **Button** component onto your canvas to switch theme. Add an event to the button, select "Run JavaScript" as the action, and run `theme.switchTo()` method which takes the value of the **Select** component.
## Custom CSS
Lowcoder provides a custom CSS feature for more flexible and customized UI styling.
### App-level CSS
In the app editor, click ⚙️ on the left side-bar, select **Scripts and style** > **CSS**, and then write CSS code for the current app.
For example, insert text component `text1`. Then use `.text1` as the element name and modify its CSS style.
{% hint style="info" %}
It is recommended to modify the component styles in **Properties** > **Style** because the DOM of an adjusted CSS style may change as the system iterates.
{% endhint %}
### Preload CSS
In Lowcoder, workspace admins can also set pre-loaded CSS styles for all apps within the workspace. Open the **Settings**, and click **Advanced** > **Preload CSS**.
It is highly recommended to use CSS selectors as follows:
| Class name | Description |
| -------------- | ------------------------- |
| top-header | Top navigation bar |
| root-container | Root container of the app |
The name of each component functions as the class name. For example, for the `text1` component, you can use `.text1` as its class name and write CSS code for it. And the class names share the same form: `ui-comp-{COMP_TYPE}`—for example, you can use `.ui-comp-select` to define CSS style of all select components. All the components' class names are listed as follows.
```Plain
input
textArea
password
richTextEditor
numberInput
slider
rangeSlider
rating
switch
select
multiSelect
cascader
checkbox
radio
segmentedControl
file
date
dateRange
time
timeRange
button
link
dropdown
toggleButton
text
table
image
progress
progressCircle
fileViewer
divider
qrCode
form
jsonSchemaForm
container
tabbedContainer
modal
listView
navigation
iframe
custom
module
jsonExplorer
jsonEditor
tree
treeSelect
audio
video
drawer
carousel
collapsibleContainer
chart
imageEditor
scanner
```
Avoid using class names that may change with iterations, such as `sc-dkiQaF bfTYCO`.Lowcoder supports [CSS pre-processor](https://stylis.js.org/), you can use CSS nesting to improve efficiency, for example:
```css
.text1 {
span {
color: red;
font-weight: bold;
}
}
```
All the custom CSS for apps is saved into the space named `#app-{APP_ID}`, and the CSS for modules is saved into the space named `#module-{MODULE_ID}`.If your preload CSS does not work properly, it might be overridden by the theme or component styles with higher priority. Open the browser **Inspect** to check.
### Demo 1: Line break in table header
To allow line break in table header, insert the following code in **Script and style** > **CSS**.
```css
.table1 {
th div {
white-space: pre-wrap;
word-break: break-word;
max-height: unset;
}
}
```
### Demo 2: Custom font family
To use custom font family, you need to define it first and then apply it. Insert the following code in **Script and style** > **CSS** to apply the font "Fredoka One" to all text components using Markdown mode within the app.
```css
@font-face {
font-family: 'Fredoka One';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/fredokaone/v13/k3kUo8kEI-tA1RRcTZGmTlHGCaen8wf-.woff2) format('woff2');
}
.ui-comp-text .markdown-body {
font-family: 'Fredoka One';
font-size: 30px;
}
```
## User-friendly interaction
Lowcoder always lives up to efficiency, security, and easy-to-use design.
### Hide UI components
Set the hidden properties of components when necessary to avoid information overload. For example, when creating a suggestion collection form, you can set the input box as visible or hidden depending on the user's selection.&#x20;
To achieve this effect, set the hidden property of the component `textArea1` with the code:
```JavaScript
{{Number(radio1.value) === 1 ? 'false' : 'true'}}
```
When the value of the component `radio1` is "1", the value of the hidden property is "false"; otherwise, the value is "true". The component layout is automatically adjusted.
### Icon configuration
Icons are intuitive, and can be alternatives to text in some cases. The proper use of icons gives users a better visual experience, and helps them use the app more easily.
Prefix and suffix icons are available for some components, such as **Button**. Add icons in **Properties** > **Layout**.
You can select from preset icons or write JS code to insert icons, for example, `{{ "/icon:solid/Users" }}`.
### Placeholder and tooltip
Tips improve app usabilityfor example, showing the tips for the input helps users better interact with the app.
* Placeholder: It displays in the empty input field to prompt the user what to type.
* Tooltip: It adds an underline to the label. Users can see the tooltip via a mouse hover.
### Notifications
Notifications are messages directly sent to your users to remind them of the status of their operations, confirm their success, or help them to proceed.
#### Global notifications
Global notifications for certain user interactions give users timely feedback. Lowcoder offers four types of global notificaitons: **Information**, **Success**, **Warning** and **Error**.
You can set global notifications in three ways:
1. Set in **Event handlers** > **Action** > **Show notification**. See Show notification (Event handlers).
2. Set in **JavaScript queries** with built-in functions.
3. Set in **Notification** tab in query settings. See Notification tab.
### Loading effect
When a query takes time to run, you can set the loading effect to inform your users that the query is running and avoid them from performing frequent operations.
For example, the loading effect of the Submit button is `{{form1SubmitToHrmsEn1.isFetching}}`. Clicking the button triggers query `form1SubmitToHrmsEn1` to run, and during this process, the button is displayed with the loading effect.
#### Confirmation modal
You can set a confirmation modal for a double check for your users when they perform operations such as adding, modifying or deleting data. In the **Advanced** tab of the query, toggle **Show a confirmation modal before running**, and enter a confirmation message.
#### Form design
Forms are frequently used to collect information. For more details on building easy-to-follow and productive forms, see Design an efficient and user-friendly form.

View File

@@ -0,0 +1,28 @@
# Component Styling Possibilities
Lowcoder allows you to style your components in many ways and so enables you to build beautiful and customized applications.
Since Lowcoder 2.3.0 we support more style attributes.
* Text Size
* Font Weight
* Font Family
* Background Image
* Background Gradient
* Border-Size
* Border-Color
* Border-Radius
Here are some interactive Demos as examples.
{% embed url="https://app.supademo.com/demo/FWO1CpYQeBSYStJjvi_DM" %}
Text Styling for Standard Texts (Markdown-Type has own styling support)
{% endembed %}
{% embed url="https://app.supademo.com/demo/C0xlbDTUZeRDX0EYhv77s" %}
Container Styling is detailed for Header, Body and Footer
{% endembed %}
{% embed url="https://app.supademo.com/demo/oqryqCpi0mAG2oLGj5ypd" %}
Better Styling Support for Modals
{% endembed %}

View File

@@ -0,0 +1,70 @@
# Customize Styles
## Using Webfonts
Based on the @import statement you can use external hosted Webfonts with Lowcoder.\
\
In the Workspace CSS or App CSS editor, you can add Font Family Import Statements
```
@import url('https://fonts.googleapis.com/css2?family=Abel&display=swap');
```
Based on the Text-Property "Font Family" you can then activate this Font Family in your Apps at many components.
You can use the interactive Demo to see the Steps based on the Component "Divider"
{% embed url="https://app.supademo.com/demo/cWzrhtxHJfJq9ZpgDOq4K" %}
## Customize Component Styles with CSS
With CSS you can further customize the Design of Components. You can use the same CSS Editor for every app or on the Workspace for all apps.
{% hint style="info" %}
To set CSS Styles for all apps in a Workspace, use the Editors in the Advanced Settings. <[yourLowcoderURL>/setting/advanced](https://app.lowcoder.cloud/setting/advanced)
{% endhint %}
Lowcoder Allows you to define Styles at "global Level". That means, you also can customize the style of the Admin Area and the Editor.
To limit the effect of a customized Styling to your Apps only, you can use the prefix class "root-container" in your selectors.
<pre class="language-css"><code class="lang-css">// Use the prefix-class in your Selectors to limit the customized CSS to your Apps only.
// will have an effect for all Buttons of Lowcoder (Editor + Apps)
.button1 {
<strong> border-radius: 50px;
</strong>}
// will have an effect for all Buttons of your Lowcoder Apps only
.root-container .button1 {
border-radius: 50px;
}
// from version v2.3.2 on this class get a new name
// will have an effect for all Buttons of your Lowcoder Apps only
.lowcoder-app-canvas .button {
border-radius: 50px;
<a data-footnote-ref href="#user-content-fn-1">}</a>
</code></pre>
Each Lowcoder Component has a root element with the CSS class name "lowcoder-\<component-type>. This identifies the class, not the individual item. In styles that you develop for components, you can use this global class identifier to make sure your styles apply only to all children of a component type.
<figure><img src="../../.gitbook/assets/CSS Classes.webp" alt=""><figcaption><p>CSS Class names for Types of Components</p></figcaption></figure>
To address a specific instance of a Lowcoder Component, you can use the CSS Class which is available in the further tree.
<figure><img src="../../.gitbook/assets/CSS Class Selector.png" alt=""><figcaption><p>Address specific instances of a Lowcoder Component</p></figcaption></figure>
```css
// will apply to all Buttons in your App
.lowcoder-app-canvas .button {
border-radius: 50px;
}
// will apply to the specific Button with the name button1 in your App
.lowcoder-app-canvas .button1 {
border-radius: 50px;
}
```
[^1]:

View File

@@ -0,0 +1,31 @@
# Design an efficient and user-friendly form
### Select proper input components
The UX design of input components in a form is crucial to the form's efficiency. Properly chosen components can save users effort and lead to better results. Lowcoder offers a variety of input components, including text input, number input, option list, and radio buttons, each of which works for different scenarios.
For example, when the input is generated from data, use the option list to let users quickly fill in the input.
Other input components, such as radio, are really helpful when the users need to directly choose between two options, for example, to indicate whether they would like to sign up for a particular activity, like a conference.
Number input is also a commonly used component type—for example, in an order management system.
### Keep layout clear and consistent
Keep all input field lengths the same to make the form visually neat, and put all input fields into a single column to achieve better readability.
### Group content with Lowcoder divider
Use the Lowcoder **Divider** component to group relevant input fields to help users process information in an organized way.
### Add user feedback
Form component is quite often used for CRUD operations, which sometimes can be risky due to human errors. To avoid harmful CRUD operations, you can add a confirmation modal before the users submit the form.
Similarly, a notification after users' submission gives users timely feedback. You can add a global notication to the Submit button. In Lowcoder, you can add global notifications in three ways. See global notification for details.
### Clear input fields on submission
Clearing input fields in a form upon submission helps users proceed with the subsequent submissions. You can set in **Properties** tab, and toggle **Reset after successful submit**.
However, sometimes it is better to leave the form uncleared—for example, when much of the values stay the same in subsequent submissions, or when the user continuously edits data. In such cases, you can insert a button with an event handler to clear each input on click.