Skip to content

ScriptWidget is an iOS/macOS app that we can create widgets for iOS/macOS using JSX label style in JavaScript.

License

Notifications You must be signed in to change notification settings

everettjf/ScriptWidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

43 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ScriptWidget ๐ŸŽจ

GitHub Stars GitHub Forks License Platform Version

Create native widgets for iOS & macOS using JavaScript and JSX

English | ไธญๆ–‡

โœจ Build iOS/macOS widgets without Swift. Just JavaScript, JSX, and creativity.


๐ŸŽฏ What is ScriptWidget?

ScriptWidget is a powerful widget development platform that lets you create native iOS and macOS widgets using JavaScript and JSX-like syntax. No Swift required!

Think of it as "React Native for Widgets" - but simpler and more flexible.

ScriptWidget Demo


โœจ Features

Feature Description
๐Ÿ–ฅ๏ธ Cross-Platform One codebase for iOS and macOS widgets
๐ŸŽจ JSX Support Declarative UI with JavaScript XML syntax
โšก Native Performance Compiled to native Swift/SwiftUI
๐Ÿ”ง Rich APIs Access device sensors, data sources, and more
๐Ÿ“ฑ Interactive Widgets Tap, swipe, and interact with widgets
๐ŸŽจ Custom Styling Full control over appearance
๐Ÿ“ฆ Template Gallery Pre-built templates to get started
๐Ÿ”„ Live Preview See changes instantly in Xcode

๐Ÿš€ Quick Start

1. Download

# Clone the repository
git clone https://github.com/everettjf/ScriptWidget.git
cd ScriptWidget

2. Open in Xcode

open ScriptWidget/ScriptWidget.xcodeproj

3. Run & Explore

  1. Select your target (iOS Simulator or macOS)
  2. Press Cmd + R to build and run
  3. Explore the example widgets in Examples/

๐Ÿ“ Project Structure

ScriptWidget/
โ”œโ”€โ”€ ScriptWidget/          # Main app source
โ”‚   โ”œโ”€โ”€ App/               # App entry point
โ”‚   โ”œโ”€โ”€ Script/            # JavaScript runtime
โ”‚   โ”œโ”€โ”€ Views/             # SwiftUI views
โ”‚   โ””โ”€โ”€ Resources/         # Assets and templates
โ”œโ”€โ”€ Examples/              # Example widgets
โ”‚   โ”œโ”€โ”€ HelloWorld/        # Simple widget
โ”‚   โ”œโ”€โ”€ Weather/           # Weather widget
โ”‚   โ”œโ”€โ”€ Calendar/          # Calendar widget
โ”‚   โ””โ”€โ”€ ...                # More examples
โ”œโ”€โ”€ Templates/             # Widget templates
โ”œโ”€โ”€ Docs/                  # Documentation
โ””โ”€โ”€ README.md

๐Ÿ’ป Example Widgets

Hello World

// A simple widget
function render() {
  return (
    <widget type="medium">
      <text style={{ fontSize: 24, color: '#333' }}>
        Hello, ScriptWidget! ๐Ÿ‘‹
      </text>
    </widget>
  );
}

Weather Widget

function WeatherWidget({ location }) {
  const [weather] = useWeather(location);
  
  return (
    <widget type="large">
      <view style={{ padding: 16 }}>
        <text style={{ fontSize: 32 }}>
          {weather.temperature}ยฐC
        </text>
        <text style={{ fontSize: 16 }}>
          {weather.condition}
        </text>
      </view>
    </widget>
  );
}

Todo List

function TodoList({ todos }) {
  return (
    <widget type="medium">
      <list data={todos} render={(item) => (
        <row>
          <checkbox checked={item.done} />
          <text>{item.title}</text>
        </row>
      )} />
    </widget>
  );
}

๐Ÿ› ๏ธ Development

Prerequisites

  • Xcode 14+ (for iOS 16+ / macOS 13+)
  • macOS 13+ (Ventura or later)
  • iOS 16+ (for iOS widgets)

Build from Source

# Clone and setup
git clone https://github.com/everettjf/ScriptWidget.git
cd ScriptWidget

# Open in Xcode
open ScriptWidget/ScriptWidget.xcodeproj

# Build and run (Cmd + R)

Create Your Own Widget

# 1. Duplicate an example
cp -r Examples/HelloWorld Examples/MyWidget

# 2. Edit the JavaScript file
cd Examples/MyWidget
vim script.js  # Write your widget code

# 3. Run and preview in the app

๐Ÿ“š Documentation

Core Concepts

  • Widget Types - small, medium, large, accessory
  • Components - text, image, list, grid, etc.
  • Styling - CSS-like inline styles
  • Data Sources - weather, calendar, reminders, etc.
  • Interactions - tap, swipe, long press

APIs

API Description
useWeather() Get weather data
useCalendar() Access calendar events
useReminders() Fetch reminder lists
useLocation() Get device location
useHealth() HealthKit data
useNetwork() Network requests

๐ŸŽจ Gallery

Widget Gallery

Sample widgets created with ScriptWidget


๐Ÿ“ฑ Platforms

Platform Support Notes
iOS โœ… Full iOS 16+ (iPhone, iPad)
macOS โœ… Full macOS 13+ (Mac)
watchOS ๐Ÿ”„ Planned Future release
visionOS ๐Ÿ”„ Planned Future release

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Ways to Contribute

  • ๐Ÿ› Report bugs
  • ๐Ÿ’ก Suggest features
  • ๐Ÿ”ง Submit pull requests
  • ๐Ÿ“ Write documentation
  • ๐ŸŽจ Share your widgets

๐Ÿ“œ License

ScriptWidget is released under the MIT License.


๐Ÿ™ Acknowledgements

Built with:

Inspired by:


๐Ÿ“ˆ Star History

Star History Chart


๐Ÿ“ž Support

GitHub Issues GitHub Discussions Discord

ๆœ‰้—ฎ้ข˜๏ผŸๅŽป Issues ๆ้—ฎ๏ผ


Made with โค๏ธ by Everett

Project Link: https://github.com/everettjf/ScriptWidget

About

ScriptWidget is an iOS/macOS app that we can create widgets for iOS/macOS using JSX label style in JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published