Inputs & outputs (Alpha)
Inputs
Examples and code snippets

# components/media-types.jigx
type: component.default
# Inputs determine the name, alignment, indicator and value of the tabs
inputs:
# inputs for indicators
tabIndicator1:
required: false
type: boolean
tabIndicator2:
required: false
type: boolean
tabIndicator3:
required: false
type: boolean
tabIndicator4:
required: false
type: boolean
# inputs for tab names
tabName1:
required: true
type: string
tabName2:
required: true
type: string
tabName3:
required: false
type: string
tabName4:
required: false
type: string
# inputs for tab values
tabValue1:
required: true
type: string
tabValue2:
required: true
type: string
tabValue3:
required: false
type: string
tabValue4:
required: false
type: string
# input to determine alignment of the tab, e.g. center, left, right.
tabsAlignment:
required: false
type: string
children:
# There are 4 tabs configured in this custom component.
# Using the view component creates the layout for the tabs
# Tab 1
- type: component.view
options:
style:
border:
bottom:
style: solid
flex:
direction: row
grow: 1
justifyContent: center
margin:
vertical: medium
children:
- type: component.view
when: [email protected] != null
options:
style:
flex:
direction: row
grow: [email protected] = true ? 1:0
gap: minimal
padding:
left: [email protected] = "center" ? "medium":"none"
right: [email protected] = "center" ? "medium":"large"
children:
- type: component.view
options:
style:
gap: medium
children:
- type: component.view
options:
style:
alignItems: center
flex:
direction: row
gap: minimal
justifyContent: center
# Using the text component to configure the tab text
children:
- type: component.text
options:
emphasis: [email protected] = @ctx.inputs.tabValue1 ? "":"medium"
value: [email protected]
weight: bold
- type: component.view
options:
children: []
style:
background:
color:
[email protected] = @ctx.inputs.tabValue1 ?
"element":"transparent"
flex:
grow: 1
height: 2
- type: component.view
when: [email protected] = true
options:
style:
flex:
grow: 1
children:
- type: component.view
options:
children: []
style:
background:
color: negative
height: 6
radius: large
width: 6
# Configure the onPress event to show the content in tab 1 when it is pressed.
onPress:
type: action.set-state
options:
state: [email protected]
value: [email protected]
# Tab 2
# Using the view component creates the layout for the tabs
- type: component.view
when: [email protected] != null
options:
style:
flex:
direction: row
gap: minimal
padding:
left: [email protected] = "center" ? "medium":"none"
right: [email protected] = "center" ? "medium":"large"
children:
- type: component.view
options:
style:
gap: medium
children:
- type: component.view
options:
style:
alignItems: center
flex:
direction: row
gap: minimal
justifyContent: center
children:
- type: component.text
options:
emphasis: [email protected] = @ctx.inputs.tabValue2 ? "":"medium"
value: [email protected]
weight: bold
- type: component.view
options:
children: []
style:
background:
color:
[email protected] = @ctx.inputs.tabValue2 ?
"element":"transparent"
flex:
grow: 1
height: 2
- type: component.view
when: [email protected] = true
options:
style:
flex:
grow: 1
children:
- type: component.view
options:
children: []
style:
background:
color: negative
height: 6
radius: large
width: 6
# Configure the onPress event to show the content in tab 2 when it
# is pressed.
onPress:
type: action.set-state
options:
state: [email protected]
value: [email protected]
# Tab 3
# Using the view component creates the layout for the tabs
- type: component.view
when: [email protected] != null
options:
style:
flex:
direction: row
gap: minimal
padding:
left: [email protected] = "center" ? "medium":"none"
right: [email protected] = "center" ? "medium":"large"
children:
- type: component.view
options:
style:
gap: medium
children:
- type: component.view
options:
style:
alignItems: center
flex:
direction: row
gap: minimal
justifyContent: center
children:
- type: component.text
options:
emphasis: [email protected] = @ctx.inputs.tabValue3 ? "":"medium"
value: [email protected]
weight: bold
- type: component.view
options:
children: []
style:
background:
color:
[email protected] = @ctx.inputs.tabValue3 ?
"element":"transparent"
flex:
grow: 1
height: 2
- type: component.view
when: [email protected] = true
options:
style:
flex:
grow: 1
children:
- type: component.view
options:
children: []
style:
background:
color: negative
height: 6
radius: large
width: 6
# Configure the onPress event to show the content in tab 3 when
# it is pressed.
onPress:
options:
state: [email protected]
value: [email protected]
type: action.set-state
# Tab 4
# Using the view component creates the layout for the tabs
- type: component.view
when: [email protected] != null
options:
style:
flex:
direction: row
gap: minimal
padding:
left: [email protected] = "center" ? "medium":"none"
right: [email protected] = "center" ? "medium":"large"
children:
- type: component.view
options:
style:
gap: medium
children:
- type: component.view
options:
style:
alignItems: center
flex:
direction: row
gap: minimal
justifyContent: center
children:
- type: component.text
options:
emphasis: [email protected] = @ctx.inputs.tabValue4 ? "":"medium"
value: [email protected]
weight: bold
- type: component.view
options:
children: []
style:
background:
color:
[email protected] = @ctx.inputs.tabValue4 ?
"element":"transparent"
flex:
grow: 1
height: 2
- type: component.view
when: [email protected] = true
options:
style:
flex:
grow: 1
children:
- type: component.view
options:
children: []
style:
background:
color: negative
height: 6
radius: large
width: 6
# Configure the onPress event to show the content in tab 4 when
# it is pressed.
onPress:
type: action.set-state
options:
state: [email protected]
value: [email protected]Outputs
Examples and code snippets

See also
Last updated
Was this helpful?