Skip to content

ListWidget

Widget showing a list of elements.

A widget showing a list of elements. Pass the widget to Script.setWidget() display it on your Home Screen.

Be aware that the widget will refresh periodically and the rate at which the widget refreshes is largely determined by the operating system.

Also note that there are memory limitations when running a script in a widget. When using too much memory the widget will crash and not render correctly.

Whether to use an accessory widget background.

addAccessoryWidgetBackground: bool

Enable to add an adaptive background that provides a standard appearance based on the widget’s environment. Defaults to false.

This is only available starting from iOS 16.

Background color of the widget.

backgroundColor: Color

Defaults to a solid color in widgets placed on the Home Screen and a transparent color placed on the Lock Screen.

Background gradient.

backgroundGradient: LinearGradient

Background image.

backgroundImage: Image

Background style of the widget.

backgroundStyle: string

Set to "transparent" to reveal the wallpaper on the Home Screen. Requires iOS or iPadOS 27.2 or newer. iOS may apply its own outline or glass effect depending on the Home Screen appearance.

Defaults to "default", which uses the configured background color, image and gradient. The transparent style replaces those backgrounds on supported Home Screen widgets.

Earliest date to refresh the widget.

refreshAfterDate: Date

The property indicates when the widget can be refreshed again. The widget will not be refreshed before the date have been reached. It is not guaranteed that the widget will refresh at exactly the specified date.

The refresh rate of a widget is partly up to iOS/iPadOS. For example, a widget may not refresh if the device is low on battery or the user is rarely looking at the widget.

When the property is null the default refresh interval is used. Defaults to null.

Spacing between elements.

spacing: number

Specifies the spacing between elements in the widget. You can also use the addSpacer() function on the widget to add spacing between elements. Defaults to 0.

URL to open.

url: string

The URL will be opened when the widget is tapped. This will override any behavior defined in the configuration of the widget. E.g. if the widget is configured to run the script when interacting with the widget but a URL is set the URL will take precedence.

Constructs a new list widget.

new ListWidget()

A widget showing a list of elements. Pass the widget to Script.setWidget() to display it on your Home Screen.

Add date to the widget.

addDate(date: Date): WidgetDate

Adds a date element to the widget. Use the properties on the returned element to style the date.

date Date

WidgetDate

Date element.

Add image to the widget.

addImage(image: Image): WidgetImage

Adds an image element to the widget. Use the properties on the returned element to style the image.

image Image

WidgetImage

Image element.

Add spacer.

addSpacer(length: number): WidgetSpacer

Adds a spacer to the widget. This can be used to offset the content vertically in the widget.

length number

Length of the spacer. Pass null to create a spacer with a flexible length.

WidgetSpacer

Spacer element.

Add stack.

addStack(): WidgetStack

Adds a stack to the widget. Stacks layout elements horizontally by default.

WidgetStack

Stack element.

Add a progress indicator to the widget.

addProgress(value: number, options: dictionary?): WidgetStack

Adds a progress indicator with a value from 0 to 100. Values outside that range are clamped. Use the returned stack to size the indicator or add content centered on top of it.

value number

Progress from 0 to 100.

options dictionary?

Optional dictionary with style (“circular” or “linear”), progressColor, trackColor, and thickness in points. The default style is circular. Thickness sets the ring stroke or the initial height of a linear bar.

WidgetStack

A stack sized to 40 by 40 points for a ring or 120 points wide for a bar.

Add a button that runs a widget action.

addButton(title: string, options: {[key: string]: string})

Tapping the button runs the configured script in the widget and reloads the widget. Read args.widgetAction.id to handle the action. Interactive controls require iOS or iPadOS 17 or later and a widget family that supports them.

title string

The label shown on the control.

options {[key: string]: string}

A dictionary with a non-empty string id.

Add a button that refreshes the widget.

addRefreshButton(title: string)

Tapping the button reloads the widget and runs its normal render. The render receives no widget action. Interactive controls require iOS or iPadOS 17 or later and a widget family that supports them.

title string

The label shown on the control.

Add a toggle that runs a widget action.

addToggle(title: string, isOn: boolean, options: {[key: string]: string})

Read args.widgetAction.isOn to get the requested state. Save the state before the script finishes and read it when rendering the widget again. Interactive controls require iOS or iPadOS 17 or later and a widget family that supports them.

title string

The label shown on the control.

isOn boolean

The current saved state of the toggle.

options {[key: string]: string}

A dictionary with a non-empty string id.

Add text to the widget.

addText(text: string): WidgetText

Adds a text element to the widget. Use the properties on the returned element to style the text.

text string

WidgetText

Text element.

Presents a preview of the widget.

presentAccessoryCircular(): Promise

The widget is presented in its circular accessory size that suitable to be displayed above the clock on the Lock Screen.

The preview is an estimated representation of the widget and is not accurate. Widgets placed on the Lock Screen change appearance based on the wallpaper and tint color of the Lock Screen, and as such, they cannot be previewed accurately in Scriptable.

Widgets on the Lock Screen are updated periodically so while working on your widget you may want to preview it in the app.

The circular accessory widget is available on iPhones running iOS 16 and newer.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a preview of the widget.

presentAccessoryInline(): Promise

The widget is presented in its accessory inline size that suitable to be displayed above the clock on the Lock Screen.

The preview is an estimated representation of the widget and is not accurate. Widgets placed on the Lock Screen change appearance based on the wallpaper and tint color of the Lock Screen, and as such, they cannot be previewed accurately in Scriptable.

Widgets on the Lock Screen are updated periodically so while working on your widget you may want to preview it in the app.

The accessory inline widget is available on iPhones running iOS 16 and newer and can display a single image and a single text. Any additional elements will be filtered away during presentation.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a preview of the widget.

presentAccessoryRectangular(): Promise

The widget is presented in its rectangular accessory size that suitable to be displayed above the clock on the Lock Screen.

The preview is an estimated representation of the widget and is not accurate. Widgets placed on the Lock Screen change appearance based on the wallpaper and tint color of the Lock Screen, and as such, they cannot be previewed accurately in Scriptable.

Widgets on the Lock Screen are updated periodically so while working on your widget you may want to preview it in the app.

The rectangular accessory widget is available on iPhones running iOS 16 and newer.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a preview of the widget.

presentExtraLarge(): Promise

The widget is presented in its extra large size.

Widgets on the Home Screen are updated periodically so while working on your widget you may want to preview it in the app.

The extra large widget is available on iPads running iOS 15 and newer.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a portrait extra large widget preview.

presentExtraLargePortrait(): Promise

This preview is available on iOS 27 and newer when the device and display setting have a measured size.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a preview of the widget.

presentLarge(): Promise

The widget is presented in its large size.

Widgets on the Home Screen are updated periodically so while working on your widget you may want to preview it in the app.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a preview of the widget.

presentMedium(): Promise

The widget is presented in its medium size.

Widgets on the Home Screen are updated periodically so while working on your widget you may want to preview it in the app.

Promise

Promise that is fulfilled when the preview is dismissed.

Presents a preview of the widget.

presentSmall(): Promise

The widget is presented in its small size.

Widgets on the Home Screen are updated periodically so while working on your widget you may want to preview it in the app.

Promise

Promise that is fulfilled when the preview is dismissed.

setPadding(top, leading, bottom, trailing)

Section titled “setPadding(top, leading, bottom, trailing)”

Set padding.

setPadding(top: number, leading: number, bottom: number, trailing: number)

Sets the padding on each side of the widget.

top number

Padding on the top edge.

leading number

Padding on the leading edge.

bottom number

Padding on the bottom edge.

trailing number

Padding on the trailing edge.

Use the default padding.

useDefaultPadding()

Configure the widget to use the default padding. Any padding previously defined with setPadding() will be discarded.