Section
This view allows you to define and display character sheet sections. It contains the basic skeleton for a section in the RPG Companion App for character sheets.
JSON Format
{
"type": "section",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"header": ...,
"content": ...,
"content_item_min_width": ...,
"show_divider": ...,
"collapsible": ...,
"start_collapsed": ...,
"always_show_collapse_icon": ...,
"alignment": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | String | ✓ | A unique identifier for the view. You can use it to reference view values in stat formulas by doing $view.view_id (where view_id is the id that was assigned to this view by you in the system definition) |
type | RPGViewType | ✓ | The type of this view. Note that these are all in camelCase. |
margin_left | double | Optional. How much margin to add to the left of this view. | |
margin_right | double | Optional. How much margin to add to the right of this view. | |
margin_top | double | Optional. How much margin to add to the top of this view. | |
margin_bottom | double | Optional. How much margin to add to the bottom of this view. | |
is_visible | StatFormulaComponent | Optional. A formula to specify if the view should be visible or not. Must return a bool. | |
validation_message | StatFormulaComponent | Optional. If this view is an input, you can define this formula to return a message when the input value is invalid. If the input is valid, you should return null. Otherwise, make the formula return the string that should be shown to the user. | |
header | List<RPGView> | ✓ | A list of views to display in the header of the section. This often includes the title of the section and some key buttons (e.g: to add content to a resource list, etc). |
content | List<RPGView> | ✓ | The list of views that compose the actual content of the section (after the header). These views will be displayed one after the other horizontally, wrapping over to the next row if needed due to space constraints (similar to the Composite view). |
content_item_min_width | double | Optional. Defaults to nothing (no constraints enforced). The minimum width for an item in this section's content. If the number is a fraction (ie: between 0 (exclusive) and 1 (inclusive)) it will be taken as a fraction of the screen size (e.g: 1 is the full screen width, 0.5 is half the screen width, etc). This is useful for responsive layouts. If the number is above 1, it will be treated as an absolute number for the width. | |
show_divider | bool | ✓ | Whether or not the divider between the header and content should be displayed. |
collapsible | bool | Optional. Defaults to false. Whether this section should be collapsible by tapping on the header or not. This helps keep the character sheet uncluttered, but is probably counter-productive for key sections in the sheet. | |
start_collapsed | bool | Optional. Defaults to false. Whether or not the section should start in the collapsed state. Only works if collapsible has been specified as true. | |
always_show_collapse_icon | bool | Optional. Defaults to false. Whether or not the collapse icon should be displayed all the time or not. If not, it will only display when the section is in the 'collapsed' state. | |
alignment | CompositeRPGViewAlignment | Optional. Defaults to center. The alignment for the views in content within this section. |