Craft Widgets with Code

Create stunning iOS and iPad widgets using JavaScript and JSX. Unleash your creativity with JSWidget.

jswidget.jsx
const widget_size = $getenv("widget-size");
const widget_param = $getenv("widget-param");

const beijingDate = new Date().toLocaleString("zh-CN", { timeZone: "Asia/Shanghai" }).toLocaleString();
const sanJoseDate = new Date().toLocaleString("zh-CN", { timeZone: "America/Los_Angeles" }).toLocaleString();
const newYorkDate = new Date().toLocaleString("zh-CN", { timeZone: "America/New_York" }).toLocaleString();
const sydneyDate = new Date().toLocaleString("zh-CN", { timeZone: "Australia/Sydney" }).toLocaleString();

$render(
    <hstack frame="max">
        <vstack alignment="leading">
            <text font="title3" color="blue" font="custom,Unispace,14">Beijing:</text>
            <text font="title3" color="green" font="custom,Unispace,14">San Jose:</text>
            <text font="title3" color="orange" font="custom,Unispace,14">New York:</text>
            <text font="title3" color="secondary" font="custom,Unispace,14">Sydney:</text>
        </vstack>
        <vstack alignment="leading">
            <text font="title3" color="red" font="custom,Unispace,14">{beijingDate}</text>
            <text font="title3" color="yellow" font="custom,Unispace,14">{sanJoseDate}</text>
            <text font="title3" color="purple" font="custom,Unispace,14">{newYorkDate}</text>
            <text font="title3" color="gray" font="custom,Unispace,14">{sydneyDate}</text>
        </vstack>
    </hstack>
);

Powerful Features

JSX Style Coding

Write widgets using familiar JSX syntax, making development intuitive and efficient.

JavaScript Powered

Leverage the full power of JavaScript to create dynamic and interactive widgets.

SwiftUI Integration

Built on SwiftUI for high performance and native look and feel on iOS and iPadOS.

Join Our Community

Connect with developers, get support, and showcase your creations.