Survey Design
Appearance

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 AttributeQuestion TypesDescription
multilinetextCreates a multi-line text box (best for web clients)
minimalselect_one, select_multipleDisplays choices in a dropdown menu
quickselect_oneAuto-advances to next question after selection (mobile only)
no-calendardateSuppresses the calendar display (mobile only)
month-yeardateAllows selection of month and year only
yeardateAllows selection of year only
horizontal-compactselect_one, select_multipleDisplays choices horizontally (web only)
horizontalselect_one, select_multipleDisplays choices horizontally in columns (web only)
likertselect_onePresents choices as a Likert scale
compactselect_one, select_multipleDisplays choices side by side with minimal padding
quickcompactselect_oneCombines compact display with auto-advance (mobile only)
field-listgroupsDisplays entire group on one screen (mobile only)
labelselect_one, select_multipleShows choice labels without inputs
list-nolabelselect_one, select_multipleShows inputs without labels (use with label)
table-listgroupsDisplays questions in a table format
signatureimageEnables signature capture (mobile only)
drawimageAllows freehand drawing (mobile only)
map, quick mapselect_one, select_one_from_fileEnables selection from map features

Best Practices for Using Appearance

  1. Consistency: Use appearance attributes consistently across your survey for a uniform look.
  2. Mobile vs. Web: Consider how appearances will render on different devices and platforms.
  3. Performance: Be cautious with appearance attributes that might slow down form loading (e.g., table-list for large groups).
  4. User Experience: Choose appearances that make data entry easier and more intuitive for respondents.
  5. 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 AttributeQuestion TypesDescription
invisibleanyHides the field from view while still collecting or calculating its value. Different from hidden type — the field still participates in logic.
displaytitleanyForces display of the field's label/title even when it would otherwise be suppressed.
autopullselect_one, select_multipleAutomatically fetches external data to populate choices when the form loads or a trigger field changes.
autopull(htmlContent)noteRenders 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_hinttext, integer, decimalShows the hint text as a floating label above the input field rather than below it.
calculate-buttoncalculateAdds a visible button that triggers recalculation of the field on demand, rather than computing automatically.

Group and navigation

Appearance AttributeQuestion TypesDescription
sectiongroupRenders 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-hideanyExcludes the question from the table-of-contents (TOC) navigation panel.
minilogbegin_repeatDisplays completed repeat entries as a compact mini-log list rather than expanding each entry inline.

Input behaviour

Appearance AttributeQuestion TypesDescription
propertextAuto-capitalises the first letter of each word as the respondent types (title-case behaviour).
text-nolabeltext, integer, decimalRenders the input field without a visible label.
inline-1linetextForces the text input to display as a single line even when the question label is long.
popupanyRenders the field inside a popup / modal overlay rather than inline on the page.

Layout

Appearance AttributeQuestion TypesDescription
1screengroupForces the entire group to display on a single screen regardless of group size.
columns(n)select_one, select_multipleDisplays choices in n columns. Example: columns(3) shows three columns of radio buttons.
gridformat<row=R col=C colspan=S align=center>anyPositions the field in a CSS-grid layout at row R, column C, spanning S columns. Used with advanced-extension/grid-layout.
ignore-simplifyanyInstructs the form renderer to skip automatic simplification or condensing of this field's layout.
horizontal(N)select_one, select_multipleSets each choice to occupy N percent of the row width. Example: horizontal(50) places two choices per row.
scroll-view(N%)group, repeat, noteConstrains 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 AttributeQuestion TypesDescription
likertselect_onePresents choices as a Likert scale row (already in standard table above; confirmed supported).
distressselect_oneRenders 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_oneRenders 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_multipleRenders 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 providedSlotControls
0 (omit entirely)Uses defaults: unchecked border/fill = #ffffff, checked border/fill = #fea500
2c1Unchecked border (and background when -fill is used)
2c2Checked border (and background when -fill is used)
4c1Unchecked border (and background when -fill is used)
4c2Checked border (and background when -fill is used)
4c3Unchecked text colour
4c4Checked 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.

typenamelabelappearance
select_onesatisfactionRate your satisfactionrating_box-fill-cccccc-04B404-333333-ffffff

tagging-choices-noshow-v2 — colour slots

Accepts 0 or 5 hex colour slots.

SlotControlsDefault
c1Outer container / wrapper border#7f7f7f (grey)
c2Individual chip border — unselected#ffffff
c3Individual chip border and fill — selected#fea500 (orange)
c4Chip text colour — unselectedinherited from CSS
c5Chip text colour — selectedinherited 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.

typenamelabelappearance
select_multipletopicsSelect all that applytagging-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 AttributeQuestion TypesDescription
callapicalculate, text, integer, decimal, select_oneEnables 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 typesTriggers 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 typesSame as callapi-verify but with parameters derived from other field values at runtime.

Language switcher

Appearance AttributeQuestion TypesDescription
change_language default('lang')note, textRenders 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:

typenamelabelappearance
datetimeevent_timeEvent date and timeinline-[%d/%m/%Y %I:%M %p]
datebirth_dateDate of birthinline-[%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>}
ParameterValuesDefault
Alignleft, right, top, center, bottomright
Sizesmall, medium, largesmall
Color#RRGGBB hex e.g. #FF5500#0099FF (blue)
Flaginline-iconforces icon mode
Align valueLayout
rightButton to the right of the label
leftButton to the left of the label
topButton above the label, full-width centered
center / bottomButton 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 valueEffect
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

  1. Appearance Not Applied: Check for typos in the appearance column.
  2. Inconsistent Rendering: Verify compatibility with the question type and platform.
  3. Performance Issues: Consider simplifying complex appearances, especially for large surveys.