Skip to content

Tab

One side of a Tabs. Its label is what the segmented control shows.

Use it for: Only directly inside a Tabs. Put anything inside it, including lists.

  • CategoryLayout
  • ChildrenAny number
  • DataNone
  • ActionNone
Prop Required Accepts What it does
label Yes text, up to 200 characters The text on this tab’s segment.

Every component also accepts id (required, unique on its screen), and the optional preset and style described in Style options. Every component except Screen accepts when, described in Data-driven look.

From the Northline Builders example project:

{
"id": "tab-overview",
"type": "Tab",
"props": {
"label": "Overview"
},
"preset": "group",
"children": [
{
"id": "project-overview",
"type": "Record",
"props": {
"emptyText": "This project is no longer available."
},
"children": [
{
"id": "overview-cards",
"type": "Stack",
"props": {},
"children": [
{
"id": "where",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "where-icon",
"type": "Icon",
"props": {
"name": "location",
"label": "Address",
"size": "sm"
},
"style": {
"color": "$color.muted"
}
},
{
"id": "where-words",
"type": "Stack",
"props": {},
"preset": "grow",
"children": [
{
"id": "address",
"type": "Text",
"props": {},
"preset": "body",
"bindings": {
"value": {
"model": "overview",
"field": "address"
}
}
},
{
"id": "city",
"type": "Text",
"props": {},
"preset": "note",
"bindings": {
"value": {
"model": "overview",
"field": "city"
}
}
}
]
},
{
"id": "copy-address",
"type": "Button",
"props": {
"label": "Copy",
"variant": "plain"
},
"action": {
"type": "contact",
"method": "copy",
"value": {
"source": "field",
"model": "overview",
"field": "address"
}
}
}
]
},
{
"id": "site-map",
"type": "Map",
"props": {
"address": "site-address",
"latitude": "latitude",
"longitude": "longitude",
"directions": true,
"height": "sm"
},
"when": {
"model": "overview",
"field": "site-address",
"is": {
"source": "test",
"test": "not-empty"
}
}
},
{
"id": "late",
"type": "Card",
"props": {},
"preset": "alert",
"children": [
{
"id": "late-line",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "late-icon",
"type": "Icon",
"props": {
"name": "warning",
"label": "Overdue"
},
"style": {
"color": "$color.primary"
}
},
{
"id": "late-words",
"type": "Stack",
"props": {},
"preset": "grow",
"children": [
{
"id": "late-title",
"type": "Text",
"props": {
"text": "Project overdue"
},
"preset": "label"
},
{
"id": "late-days",
"type": "Row",
"props": {},
"children": [
{
"id": "late-count",
"type": "Text",
"props": {
"format": {
"style": "number",
"decimals": 0
}
},
"preset": "note",
"bindings": {
"value": {
"model": "overview",
"field": "days-overdue"
}
}
},
{
"id": "late-unit",
"type": "Text",
"props": {
"text": "days past the due date"
},
"preset": "note"
}
],
"style": {
"gap": "$spacing.xs"
}
}
]
}
]
}
],
"when": {
"model": "overview",
"field": "days-overdue",
"is": {
"source": "literal",
"value": 0,
"compare": "gt"
}
}
},
{
"id": "budget",
"type": "Card",
"props": {},
"preset": "panel",
"children": [
{
"id": "budget-eyebrow",
"type": "Text",
"props": {
"text": "Budget"
},
"preset": "eyebrow"
},
{
"id": "budget-line",
"type": "Row",
"props": {},
"children": [
{
"id": "budget-ring",
"type": "ProgressRing",
"props": {
"label": "Budget used",
"size": "md",
"caption": "used"
},
"bindings": {
"value": {
"model": "overview",
"field": "percent-used"
}
}
},
{
"id": "budget-figures",
"type": "Stack",
"props": {},
"preset": "grow",
"children": [
{
"id": "spent-label",
"type": "Text",
"props": {
"text": "Spent"
},
"preset": "note"
},
{
"id": "spent",
"type": "Text",
"props": {
"format": {
"style": "currency",
"currency": "USD",
"decimals": 0
}
},
"preset": "figure",
"bindings": {
"value": {
"model": "overview",
"field": "spent"
}
}
},
{
"id": "budget-label",
"type": "Text",
"props": {
"text": "Budget"
},
"preset": "note"
},
{
"id": "budget-total",
"type": "Text",
"props": {
"format": {
"style": "currency",
"currency": "USD",
"decimals": 0
}
},
"preset": "label",
"bindings": {
"value": {
"model": "overview",
"field": "budget"
}
}
}
]
}
],
"style": {
"gap": "$spacing.lg",
"align": "center"
}
}
]
},
{
"id": "schedule",
"type": "Card",
"props": {},
"preset": "panel",
"children": [
{
"id": "schedule-eyebrow",
"type": "Text",
"props": {
"text": "Schedule"
},
"preset": "eyebrow"
},
{
"id": "schedule-top",
"type": "Row",
"props": {},
"preset": "between",
"children": [
{
"id": "schedule-label",
"type": "Text",
"props": {
"text": "Progress"
},
"preset": "note"
},
{
"id": "schedule-percent",
"type": "Text",
"props": {
"format": {
"style": "percent"
}
},
"preset": "label",
"bindings": {
"value": {
"model": "overview",
"field": "progress"
}
}
}
]
},
{
"id": "schedule-bar",
"type": "ProgressBar",
"props": {
"label": "Schedule progress"
},
"bindings": {
"value": {
"model": "overview",
"field": "progress"
}
}
},
{
"id": "dates",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "start",
"type": "Stack",
"props": {},
"preset": "grow",
"children": [
{
"id": "start-label",
"type": "Text",
"props": {
"text": "Start"
},
"preset": "note"
},
{
"id": "start-date",
"type": "Text",
"props": {
"format": {
"style": "date"
}
},
"preset": "label",
"bindings": {
"value": {
"model": "overview",
"field": "start-date"
}
}
}
]
},
{
"id": "due",
"type": "Stack",
"props": {},
"preset": "grow",
"children": [
{
"id": "due-label",
"type": "Text",
"props": {
"text": "Due"
},
"preset": "note"
},
{
"id": "due-date",
"type": "Text",
"props": {
"format": {
"style": "date"
}
},
"preset": "label",
"bindings": {
"value": {
"model": "overview",
"field": "due-date"
}
}
}
]
}
]
}
]
},
{
"id": "overview-actions",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "open-team",
"type": "Button",
"props": {
"label": "Team",
"icon": "people",
"variant": "tinted"
},
"action": {
"type": "navigate",
"routeId": "team",
"parameters": {
"project-id": {
"source": "field",
"model": "overview",
"field": "id"
}
}
}
},
{
"id": "open-edit",
"type": "Button",
"props": {
"label": "Edit project",
"icon": "edit",
"variant": "outline"
},
"action": {
"type": "navigate",
"routeId": "edit-project",
"parameters": {
"id": {
"source": "field",
"model": "overview",
"field": "id"
}
}
}
}
]
},
{
"id": "delete-project",
"type": "Button",
"props": {
"label": "Delete project",
"variant": "plain",
"icon": "trash"
},
"style": {
"color": "$color.error"
},
"action": {
"type": "operation",
"operationId": "delete-project",
"parameters": {
"id": {
"source": "field",
"model": "overview",
"field": "id"
}
},
"confirm": {
"title": "Delete this project?",
"message": "Only a project with no logs, contacts, documents or expenses can be deleted. This can’t be undone.",
"label": "Delete project",
"destructive": true
},
"after": "back"
}
}
],
"style": {
"gap": "$spacing.md"
}
}
],
"bindings": {
"record": {
"operationId": "get-overview",
"parameters": {
"id": {
"source": "route",
"parameter": "id"
}
}
}
}
},
{
"id": "key-contacts-block",
"type": "Stack",
"props": {},
"preset": "group",
"children": [
{
"id": "key-contacts-title",
"type": "Text",
"props": {
"text": "Key contacts"
},
"preset": "title"
},
{
"id": "key-contacts",
"type": "RecordList",
"props": {
"pageSize": 2,
"emptyText": "No contacts yet. Add the people on this job under Team.",
"separator": "none"
},
"children": [
{
"id": "key",
"type": "Card",
"props": {},
"preset": "panel",
"children": [
{
"id": "key-top",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "key-icon",
"type": "Icon",
"props": {
"name": "person",
"label": "Contact",
"size": "sm",
"tile": "circle"
},
"style": {
"backgroundColor": "$color.raised",
"color": "$color.primary"
}
},
{
"id": "key-who",
"type": "Stack",
"props": {},
"preset": "grow",
"children": [
{
"id": "key-name",
"type": "Text",
"props": {},
"preset": "label",
"bindings": {
"value": {
"model": "contact-card",
"field": "name"
}
}
},
{
"id": "key-role",
"type": "Text",
"props": {},
"preset": "note",
"bindings": {
"value": {
"model": "contact-card",
"field": "role"
}
}
},
{
"id": "key-company",
"type": "Text",
"props": {},
"preset": "note",
"bindings": {
"value": {
"model": "contact-card",
"field": "company"
}
}
}
]
},
{
"id": "key-edit",
"type": "Button",
"props": {
"label": "Edit",
"icon": "edit",
"variant": "plain"
},
"action": {
"type": "navigate",
"routeId": "edit-contact",
"parameters": {
"id": {
"source": "field",
"model": "contact-card",
"field": "id"
}
}
}
}
]
},
{
"id": "key-phone-block",
"type": "Stack",
"props": {},
"preset": "tight",
"children": [
{
"id": "key-phone",
"type": "Text",
"props": {},
"preset": "body",
"bindings": {
"value": {
"model": "contact-card",
"field": "phone"
}
}
},
{
"id": "key-phone-actions",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "key-call",
"type": "Button",
"props": {
"label": "Call",
"icon": "phone",
"variant": "tinted"
},
"action": {
"type": "contact",
"method": "call",
"value": {
"source": "field",
"model": "contact-card",
"field": "phone"
}
}
},
{
"id": "key-text",
"type": "Button",
"props": {
"label": "Text",
"icon": "message",
"variant": "tinted"
},
"action": {
"type": "contact",
"method": "text",
"value": {
"source": "field",
"model": "contact-card",
"field": "phone"
}
}
},
{
"id": "key-copy",
"type": "Button",
"props": {
"label": "Copy",
"variant": "plain"
},
"action": {
"type": "contact",
"method": "copy",
"value": {
"source": "field",
"model": "contact-card",
"field": "phone"
}
}
}
]
}
],
"when": {
"model": "contact-card",
"field": "phone",
"is": {
"source": "test",
"test": "not-empty"
}
}
},
{
"id": "key-email-block",
"type": "Stack",
"props": {},
"preset": "tight",
"children": [
{
"id": "key-email",
"type": "Text",
"props": {},
"preset": "body",
"bindings": {
"value": {
"model": "contact-card",
"field": "email"
}
}
},
{
"id": "key-email-actions",
"type": "Row",
"props": {},
"preset": "line",
"children": [
{
"id": "key-mail",
"type": "Button",
"props": {
"label": "Email",
"icon": "mail",
"variant": "tinted"
},
"action": {
"type": "contact",
"method": "email",
"value": {
"source": "field",
"model": "contact-card",
"field": "email"
}
}
},
{
"id": "key-copy-email",
"type": "Button",
"props": {
"label": "Copy",
"variant": "plain"
},
"action": {
"type": "contact",
"method": "copy",
"value": {
"source": "field",
"model": "contact-card",
"field": "email"
}
}
}
]
}
],
"when": {
"model": "contact-card",
"field": "email",
"is": {
"source": "test",
"test": "not-empty"
}
}
}
]
}
],
"bindings": {
"items": {
"operationId": "list-key-contacts",
"parameters": {
"project-id": {
"source": "route",
"parameter": "id"
}
},
"pagination": {
"offset": 0,
"limit": 2
}
}
}
}
]
}
]
}