Get started
Accounts
Apps
Users
Relationships
Dialogs (Messages)
Tracks (MuseBase)
Photos
Posts
Comments
Safety
Other
Yurba CDN (cdn.yurba.one)
Yurba Desktop API
Yurba Component Language
Tab: { ... }
Tab {
Method render {
contentObject: YurbaComponentLanguage
},
Method open,
Method close,
Method onEvent {
name: String,
event: String,
callback: Function
}
}
const btn = app.createButton("tab")
btn.setTooltip("Open Tab")
btn.on("click", () => {
const tab = app.Tab
tab.open()
})
const myTabContent = '
<TabHeader>
<TabTitle>My tab title</TabTitle>
<TabDescription>My tab description</TabDescription>
</TabHeader>
'
app.define("tabContent", myTabContent) // Globalizing content
const btn = app.createButton("tab")
btn.setTooltip("Open Tab")
btn.on("click", () => {
const tab = app.Tab
tab.render(app.global.tabContent) // We call our content from app.define()
tab.open()
})
const myTabContent = '
<TabHeader>
<TabTitle>My tab title</TabTitle>
<TabDescription>My tab description</TabDescription>
</TabHeader>
<Row pos="bottom-left">
<Button event="closeBtn">Close Tab</Button>
<Button event="visitBtn">Visit Docs</Button>
</Row>
'
app.define("tabContent", myTabContent) // Globalizing content
const btn = app.createButton("tab")
btn.setTooltip("Open Tab")
btn.on("click", () => {
const tab = app.Tab
tab.render(app.global.tabContent) // We call our content from app.define()
tab.open()
// Event handlers
tab.onEvent("closeBtn", "click", () => {
$this.close()
})
tab.onEvent("visitBtn", "click", () => {
app.openUrl("https://docs.yurba.one")
})
})