Label
Show a read-only text in the form hardcoded in the xml form.
Simple example
<label string="This is an example" />
With diferent sizes
<label string="This is a heading 1" widget_props='{"label_size": 1}' />
This is a heading 1
This is a heading 2
This is a heading 3
This is a heading 4
This is a heading 5
With diferent types
<label string="This is a success label" widget_props="{'label_type': 'success'}" />
Combining size and type
<label string="This is a heading 1 success label" widget_props='{"label_size": 1, "label_type": "success"}' />
This is a heading 1 success label
Dynamic label
<field name="name" widget="label" widget_props="{'label_type': 'warning'}" />
Showing a date in human readable format
v2.53.0We can use the label
widget to show a date in a human readable format.
<field name="date" widget="label" widget_props="{'human_date': true}"/>
API
Property | Description | Type | Default | Version |
---|---|---|---|---|
string | Content for the label | string | - | - |
align | Alignment of the label | left | center | right | - | - |
widget_props | Props for the widget. See Widget props | object | - | - |
Widget props
Property | Description | Type | Default | Version |
---|---|---|---|---|
label_type | Type of the label | secondary | success | warning | danger | default | - |
label_size | Size of the label | 1 | 2 | 3 | 4 | 5 | - | - |
human_date | Show the date in human readable format | boolean | false | v2.53.0 |