Skip to content

Accordion

An accordion. Either children or child must be provided. If child is provided, it must be an iterator. Iterator can be used to iterate data from a datasource

Name Description
component accordion
title string, title for the according
subTitle (optional) string, subTitle for the according
children (optional) list of children to be rendered when expanded
child (optional) optional iterator

Options

Name Description
id optional id use to track state
tilePadding optional string, insets for title, leading, etc, see tilePadding
contentPadding optional string, insets for content padding, see childrenPadding

Examples

Children

  "ux": {
    "component": "accordion",
    "title": "Did you eat a staple?",
    "options": {
      "id": "staple-accordion"
    },
    "children": [
      {
        "component": "layout",
        "description": "rice",
        "options": {
          "id": "meal-entry-staple-entry",
          "parameters": {
            "tracker": "meal-entry",
            "checkboxMetric": "stapleRice",
            "dropdownMetric": "stapleRiceAmount",
            "image": "https://weave-io-files.s3.amazonaws.com/files/org/413ac917-3853-4ea6-8871-924a41f2974b/ebSo30iIcGr4MJxRtdeu8FgObaI0jV04bcb422ae774a2cacba4766d5334bd2/food_gohan_ochawan.png",
            "text": "ごはん",
            "description": "お茶椀ふつう盛り"
          }
        }
      }
    ]
}

Child iterator

  "data": {
    "sources": {
      "id": "staple",
      "kind": "dispatch",
      "query": "given tracker [breakfast]"
    }
  },
  "ux": {
    "component": "accordion",
    "title": "Did you eat a staple?",
    "options": {
      "id": "staple-accordion"
    },
    "child": {
      "component": "iterator",
      "dataSource": "staple",
      "child": {
        "component": "grid",
        "direction": "row",
        "children": [
          {
            "component": "text",
            "text": "{values.fooName}"
          },
          {
            "component": "text",
            "text": "{values.fooTitle}"
          }
        ]
      }
    }
}