The appearance column in rtSurvey allows you to customize the visual presentation and behavior of questions in your surveys. This feature enhances user experience and can significantly improve data collection efficiency. rtSurvey supports standard XLSForm appearance attributes and extends them with additional options.
Standard XLSForm Appearance Attributes
rtSurvey supports the following standard XLSForm appearance attributes:
| Appearance Attribute | Question Types | Description |
|---|---|---|
| multiline | text | Creates a multi-line text box (best for web clients) |
| minimal | select_one, select_multiple | Displays choices in a dropdown menu |
| quick | select_one | Auto-advances to next question after selection (mobile only) |
| no-calendar | date | Suppresses the calendar display (mobile only) |
| month-year | date | Allows selection of month and year only |
| year | date | Allows selection of year only |
| horizontal-compact | select_one, select_multiple | Displays choices horizontally (web only) |
| horizontal | select_one, select_multiple | Displays choices horizontally in columns (web only) |
| likert | select_one | Presents choices as a Likert scale |
| compact | select_one, select_multiple | Displays choices side by side with minimal padding |
| quickcompact | select_one | Combines compact display with auto-advance (mobile only) |
| field-list | groups | Displays entire group on one screen (mobile only) |
| label | select_one, select_multiple | Shows choice labels without inputs |
| list-nolabel | select_one, select_multiple | Shows inputs without labels (use with label) |
| table-list | groups | Displays questions in a table format |
| signature | image | Enables signature capture (mobile only) |
| draw | image | Allows freehand drawing (mobile only) |
| map, quick map | select_one, select_one_from_file | Enables selection from map features |
Best Practices for Using Appearance
- Consistency: Use appearance attributes consistently across your survey for a uniform look.
- Mobile vs. Web: Consider how appearances will render on different devices and platforms.
- Performance: Be cautious with appearance attributes that might slow down form loading (e.g.,
table-listfor large groups). - User Experience: Choose appearances that make data entry easier and more intuitive for respondents.
- Testing: Always test your form on target devices to ensure appearances work as expected.
Advanced Techniques
Combining Appearances
Some appearance attributes can be combined for more complex layouts:
| type | name | label | appearance |
|------|------|-------|------------|
| select_one options | choice | Select one: | minimal compact |Dynamic Appearances
rtSurvey allows for dynamic appearance changes based on form logic:
| type | name | label | appearance | relevant |
|------|------|-------|------------|----------|
| text | time | Enter time: | inline-[%H:%M] | ${show_time} = 'yes' |Mobile App Considerations
- Some appearances (e.g.,
quick,signature) are specific to mobile devices. - Test thoroughly on both Android and iOS to ensure consistent behavior.
rtSurvey Extended Appearance Attributes
In addition to standard XLSForm appearances, rtSurvey supports the following platform-specific options:
Data and display control
| Appearance Attribute | Question Types | Description |
|---|---|---|
invisible | any | Hides the field from view while still collecting or calculating its value. Different from hidden type — the field still participates in logic. |
displaytitle | any | Forces display of the field's label/title even when it would otherwise be suppressed. |
autopull | select_one, select_multiple | Automatically fetches external data to populate choices when the form loads or a trigger field changes. |
autopull(htmlContent) | note | Renders a dynamic HTML block inside a note field and re-evaluates it on every field change. Content must be supplied as a concat() expression in the appearance column. See HTML Styling. |
floating_hint | text, integer, decimal | Shows the hint text as a floating label above the input field rather than below it. |
calculate-button | calculate | Adds a visible button that triggers recalculation of the field on demand, rather than computing automatically. |
Group and navigation
| Appearance Attribute | Question Types | Description |
|---|---|---|
section | group | Renders the group as a top-level section header/divider in the form's navigation. Questions inside the group scroll normally — this does not collapse content or show questions one per screen. |
toc-hide | any | Excludes the question from the table-of-contents (TOC) navigation panel. |
minilog | begin_repeat | Displays completed repeat entries as a compact mini-log list rather than expanding each entry inline. |
Input behaviour
| Appearance Attribute | Question Types | Description |
|---|---|---|
proper | text | Auto-capitalises the first letter of each word as the respondent types (title-case behaviour). |
text-nolabel | text, integer, decimal | Renders the input field without a visible label. |
inline-1line | text | Forces the text input to display as a single line even when the question label is long. |
popup | any | Renders the field inside a popup / modal overlay rather than inline on the page. |
Layout
| Appearance Attribute | Question Types | Description |
|---|---|---|
1screen | group | Forces the entire group to display on a single screen regardless of group size. |
columns(n) | select_one, select_multiple | Displays choices in n columns. Example: columns(3) shows three columns of radio buttons. |
gridformat<row=R col=C colspan=S align=center> | any | Positions the field in a CSS-grid layout at row R, column C, spanning S columns. Used with advanced-extension/grid-layout. |
ignore-simplify | any | Instructs the form renderer to skip automatic simplification or condensing of this field's layout. |
horizontal(N) | select_one, select_multiple | Sets each choice to occupy N percent of the row width. Example: horizontal(50) places two choices per row. |
scroll-view(N%) | group, repeat, note | Constrains the container to a maximum height of N% of the viewport (or parent), adding a scroll bar when content overflows. Example: scroll-view(60%). Commonly combined with autopull(htmlContent) on note fields to cap summary panel height. |
Widgets
| Appearance Attribute | Question Types | Description |
|---|---|---|
likert | select_one | Presents choices as a Likert scale row (already in standard table above; confirmed supported). |
distress | select_one | Renders choices as the Kessler Psychological Distress Scale (K10) visual widget with emotional icons. |
rating_box-fill-{c1}-{c2} or rating_box-fill-{c1}-{c2}-{c3}-{c4} | select_one | Renders choices as a row of styled rectangular buttons. Accepts 0, 2, or 4 colour slots. See colour reference below. |
tagging-choices-noshow-v2-{c1}-{c2}-{c3}-{c4}-{c5} | select_one, select_multiple | Renders choices as coloured tag chips. Selected chips are highlighted; unselected chips are suppressed in the summary view. Accepts 0 or 5 colour slots. See colour reference below. |
rating_box-fill — colour slots
Accepts 0, 2, or 4 hex colour slots. When no colours are provided the widget uses built-in defaults.
| Slots provided | Slot | Controls |
|---|---|---|
| 0 (omit entirely) | — | Uses defaults: unchecked border/fill = #ffffff, checked border/fill = #fea500 |
| 2 | c1 | Unchecked border (and background when -fill is used) |
| 2 | c2 | Checked border (and background when -fill is used) |
| 4 | c1 | Unchecked border (and background when -fill is used) |
| 4 | c2 | Checked border (and background when -fill is used) |
| 4 | c3 | Unchecked text colour |
| 4 | c4 | Checked text colour |
Default colours (when no slots provided):
- Unchecked: border
#ffffff, background#ffffff(with-fill) - Checked: border
#fea500, background#fea500(with-fill) - Text colours inherit from CSS
Examples:
rating_box-fill-cccccc-04B404— grey unchecked, green checked (border + fill), text colours inherited.
rating_box-fill-cccccc-04B404-333333-ffffff— grey unchecked, green checked, dark text unselected, white text selected.
| type | name | label | appearance |
|---|---|---|---|
| select_one | satisfaction | Rate your satisfaction | rating_box-fill-cccccc-04B404-333333-ffffff |
tagging-choices-noshow-v2 — colour slots
Accepts 0 or 5 hex colour slots.
| Slot | Controls | Default |
|---|---|---|
c1 | Outer container / wrapper border | #7f7f7f (grey) |
c2 | Individual chip border — unselected | #ffffff |
c3 | Individual chip border and fill — selected | #fea500 (orange) |
c4 | Chip text colour — unselected | inherited from CSS |
c5 | Chip text colour — selected | inherited from CSS |
When colours are omitted entirely, the defaults above apply. All 5 slots must be provided together — partial colour lists are not supported for this widget.
Example:
tagging-choices-noshow-v2-cccccc-cccccc-3498db-333333-ffffff— grey wrapper border, grey chip borders unselected, blue fill selected, dark text unselected, white text selected.
| type | name | label | appearance |
|---|---|---|---|
| select_multiple | topics | Select all that apply | tagging-choices-noshow-v2-cccccc-cccccc-3498db-333333-ffffff |
Colour value format (both widgets)
Colour slots must be 6-digit hex codes without the # prefix (e.g. cccccc, 04B404, 3498db). CSS named colours such as grey or blue are not supported and will be ignored, causing the widget to fall back to defaults. Dynamic colours can be provided via colors(expression(...)) or theme variables (__COLOR_THEME_XXX).
API integration
| Appearance Attribute | Question Types | Description |
|---|---|---|
callapi | calculate, text, integer, decimal, select_one | Enables API call integration for this field. The calculation column should contain a callapi() expression. See Call API. |
callapi-verify(params) | text, integer, decimal, barcode, and other input types | Triggers an API verification call using static parameters. The form blocks progress until the API confirms the value. |
callapi-verify(dynamicParams) | text, integer, decimal, barcode, and other input types | Same as callapi-verify but with parameters derived from other field values at runtime. |
Language switcher
| Appearance Attribute | Question Types | Description |
|---|---|---|
change_language default('lang') | note, text | Renders a language-switcher button. The default('lang') token sets the initial language (e.g. default('en')); it is rewritten to rtDefault('lang') internally during parsing. Button styling is controlled by the active CSS theme, not by appearance colours. |
The change_language appearance does not accept colour parameters — any hex values appended after change_language- are ignored by the renderer. Use the CSS theme variables (--accent-color, --primary-color) to customise the button colour.
change_language default('vi')
change_language default('en')Inline date/time format
For date, time, and datetime fields, you can specify a custom display format using a format string appended to the appearance:
inline-[%d/%m/%Y]
inline-1line-[%d/%m/%Y %H:%M]Format tokens are the same as format-date() and format-date-time(). See Functions — Date and time functions.
Example:
| type | name | label | appearance |
|---|---|---|---|
| datetime | event_time | Event date and time | inline-[%d/%m/%Y %I:%M %p] |
| date | birth_date | Date of birth | inline-[%d/%m/%Y] |
Inline button layout — display{} and results{}
For question types that render as an inline icon button (date, time, datetime, image, audio, video, file, barcode, geopoint), two appearance modifiers control the button position and post-capture behavior.
display{...} — button position before capture
display{<align>, <size>, <color>}| Parameter | Values | Default |
|---|---|---|
| Align | left, right, top, center, bottom | right |
| Size | small, medium, large | small |
| Color | #RRGGBB hex e.g. #FF5500 | #0099FF (blue) |
| Flag | inline-icon | forces icon mode |
| Align value | Layout |
|---|---|
right | Button to the right of the label |
left | Button to the left of the label |
top | Button above the label, full-width centered |
center / bottom | Button below the label, full-width centered |
results{...} — layout and visibility after capture
Inherits display{} settings. Use to move the button or hide elements once a value has been captured.
results{<align>, hide(<element>)}hide value | Effect |
|---|---|
hide(capture) | Hides the capture button once a file/value exists |
hide(review) | Hides the review thumbnail / playback button |
hide(filename) | Hides the filename shown after upload |
hide(camera) | Hides the camera trigger button after capture |
hide(scanner) | Hides the barcode scan button after a value is scanned |
hide(value) | Hides the scanned value text (barcode / geopoint) |
The widget automatically switches from display{} to results{} layout the moment a value is captured.
Examples:
inline display{right} → icon right of label
inline display{left, large} → large icon on the left
inline display{center, large, #FF5500} → large orange icon below label
inline display{right} results{left} → icon moves left after capture
inline display{right} results{hide(capture)} → icon disappears after capture
inline display{center} results{hide(capture), hide(filename)}Known Limitations
- Complex appearances may not render identically across all platforms.
- Some advanced rtSurvey appearances may not be supported in offline mode.
Troubleshooting Appearance Issues
- Appearance Not Applied: Check for typos in the appearance column.
- Inconsistent Rendering: Verify compatibility with the question type and platform.
- Performance Issues: Consider simplifying complex appearances, especially for large surveys.