Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {contentView, TextView, Stack} from 'tabris';
contentView.append(
lorem
ipsum dolor
sit amet
consectetur
).find(TextView).set({font: '48px', textColor: 'white'});
import {contentView, device, TextView} from 'tabris';
contentView.append();
device.onOrientationChanged(renderDeviceProperties);
renderDeviceProperties();
function renderDeviceProperties() {
$(TextView).only().text =
<$>
<b>Platform:</b> {device.platform}<br>
<b>Version:</b> {device.version}<br>
<b>Model:</b> {device.model}<br>
<b>Vendor:</b> {device.vendor}<br>
<b>Name:</b> {device.name}<br>
<b>Language:</b> {device.language}<br>
<b>Orientation:</b> {device.orientation}<br>
<b>Screen:</b> {device.screenWidth} x {device.screenHeight}<br>
<b>Scale:</b> {device.scaleFactor}<br>
import {AlertDialog, Button, Stack, TextInput, TextView, contentView} from 'tabris';
contentView.append(
<button>Simple dialog</button>
<button>Dialog with multiple buttons</button>
<button>Self-closing dialog</button>
<button>Dialog with text fields</button>
);
const textView = $().only(TextView);
async function showSimpleDialog() {
await AlertDialog.open('Comment saved').onClose.promise();
textView.text = 'Dialog closed';
}
import {TextView, CollectionView, contentView} from 'tabris';
const items = createItems();
contentView.append(
new TextView({padding: 12})}
updateCell={(cell, index) => cell.text = items[index]}/>
);
function createItems() {
const text = (
<$>
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab
illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et
import {Button, TextView, TextInput, contentView, Stack} from 'tabris';
contentView.append(
<button>
</button><button>
</button><button>
</button><button>
</button><button>
);
const keyField = $('#key').only(TextInput);
const valueField = $('#value').only(TextInput);
const output = $('#output').only(TextView);
</button>
import {CheckBox, contentView, Stack, TextView} from 'tabris';
contentView.append(
Normal Text <b>bold</b> <i>italic</i><br>
<big>big</big><br>
<small>small</small><br>
<strong>strong</strong><br>
<ins>inserted</ins><br>
<del>deleted</del>
$(TextView).only().markupEnabled = e.checked}/>
);
import {contentView, TextView, StackLayout, ScrollView} from 'tabris';
contentView.append(
lorem
ipsum dolor
sit amet
).find(TextView).set({font: '48px', textColor: 'white'});
import {CheckBox, Composite, contentView, ImageView, Slider, Stack, TextView} from 'tabris';
contentView.append(
zoomLevelSlider.selection = ev.zoomLevel * 10}/>
setZoomEnabled(ev.value)}/>
setZoomLevel(ev.value / 10)}/>
setMinZoomLevel(ev.value / 10)}/>
setMaxZoomLevel(ev.value / 10)}/>
);
import {Composite, contentView} from 'tabris';
contentView.append(
<$>
);
import {Button, contentView} from 'tabris';
let count = 0;
contentView.append(
<button>Button</button>
);
function countUp() {
$(Button).set({text: `Pressed ${++count} times`});
}