Write a plugin
of your own.
A plugin is a React component, a manifest and the permissions it asks for. It draws with modo-ui, the island's own components, so it looks native from the first line. It can add a scope to the launcher too: results, their actions and a preview. The CLI scaffolds, builds and packs it into a .notchplugin; while you work, the runtime's dev server reloads the island on every save.
Start here
import { Button } from '@justanarthur/modo-ui'
import { definePlugin, usePlugin } from '@just-notch/sdk'
function Hello() {
return <p className="text-subtitle px-4 py-2">Hello from My Plugin</p>
}
function Widget() {
const { activity } = usePlugin()
return (
<Button
variant="secondary"
size="compact"
onClick={() => activity.flash({ priority: 'alert', view: Hello })}
>
Say hello
</Button>
)
}
export default definePlugin({
widget: { title: 'My Plugin', view: Widget },
})