Entity

The entity component allows the user to use entity (sections, field-rows and entity-fields) as the preview content.

Long-press on a widget

This example displays a preview after long-pressing the widget See the full example on GitHub.

entity-longpress-widget
preview:
  isCompact: false
  children:
    - type: component.entity
      options:
        isCompact: true
        children:
          - type: component.section
            options:
              title: General info
              children:
                - type: component.field-row
                  options:
                    children: 
                      - type: component.entity-field
                        options:
                          label: First Name
                          value: Karl 
                          contentType: default
                      - type: component.entity-field
                        options:
                          label: Middle Name
                          value: Joseph
                          contentType: default
                      - type: component.entity-field
                        options:
                          label: Last Name
                          value: Fisher
                          contentType: default
                - type: component.entity-field
                  options:
                    label: Date of birth
                    value: 1988-01-19
                    rightIcon: calendar
                - type: component.entity-field
                  options:
                    label: Phone
                    value: +987 654 321
                    contentType: phone
                - type: component.entity-field
                  options:
                    label: Email
                    value: [email protected]
                    contentType: email
                - type: component.entity-field
                  options:
                    label: ""
                    value: Tap to see more details!
  header: 
    type: component.jig-header
    options:
      height: small
      children: 
        type: component.image
        options:
          title: Activities
          source:
            uri: https://images.unsplash.com/photo-1603988363607-e1e4a66962c6?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Njl8fHNwb3J0fGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=900&q=60

Long-press onPress action

This example displays a preview after long-pressing the list-item on the widget

This example displays a preview after long-pressing the list-item in the jig. It includes the entity component as well as the go-to actions.

As you can see in the code snippet, the original list doesn't include the preview. Our onPress action allows us to use the preview that is included in the detail jig.

See the full examples of LongPress onPress and entity-detail in GitHub.

LongPress on Calendar jig

This example displays a preview after long-pressing the event in the Calendar jig (on the widget)

This example displays a preview after long-pressing the event in the Calendar jig (on the event)

See the full example of entity longpress and entity-calendar-detail in GitHub.

Last updated

Was this helpful?