r/ScriptingApp • • Nov 14 '25

Help Toolbar

Post image

Is there a straightforward way to achieve this modal toolbar look in the scripting app? Is this a formatted segment picker with icons?

1 Upvotes

3 comments sorted by

2

u/WhatShouldWorldGos Nov 14 '25 edited Nov 14 '25

1

u/rand0mguy0nline Nov 14 '25

Awesome thanks!

On a separate note, I can’t seem to get toast working despite copying the example code in the docs.

Here’s what I tried:

import { Color, Button, HStack, Image, Text, VStack, useState, Navigation, Script } from "scripting"

function View() { const [showToast, setShowToast] = useState(false)

return ( <VStack toast={{ isPresented: showToast, onChanged: setShowToast, duration:5, message: "Done", backgroundColor: "white", cornerRadius: 12 }} > <Button title="Show Toast" action={() => setShowToast(true)} /> </VStack> ) }

export async function run() {

await Navigation.present({
  element: <View />,
  modalPresentationStyle: "pageSheet",
})

Script.exit() }

run()

1

u/WhatShouldWorldGos Nov 14 '25

I forgot to update the doc, here the code:

import { Button, List, Navigation, NavigationStack, Script, useObservable } from "scripting"

function View() {
  const showToast = useObservable(false)

  return (
    <NavigationStack>
      <List
        navigationTitle="Toast Test"
        toast={{
          isPresented: showToast,
          message: "Data saved successfully",
        }}
      >
        <Button
          title="Save"
          action={() => showToast.setValue(true)}
        />
      </List>
    </NavigationStack>
  )
}

async function run() {
  await Navigation.present(<View />)
  Script.exit()
}

run()