# Manual loading

If you want to manually/conditionally load a Widget (or Survey) you still need to call `Frill('container')` as early as possible.

### **Disable auto loading**

You can control/disable automatic loading of Widgets & Surveys when you call the `container` command with the `autoLoad` option.

```js
window.Frill('container', {
  key: 'YOUR_SCRIPT_KEY',
  // Pass false to disable automatic Widget and Survey loading
  autoLoad: false, // Also accepts: 'widgets' or 'surveys'
});
```

The `autoLoad` option accepts:

* `boolean` - If `false` then nothing will not be loaded
* `"widgets"` - Only Widgets will automatically load
* `"surveys"` - Only Surveys will automatically load

{% hint style="info" %}
Remember, you can conditionally show a Widget, or Survey, by configuring URL and audience targeting rules (user segmentation) in the settings page. There is also a "None" Launcher option which leaves it up to you to [open & close](https://developers.frill.co/frill-script/widgets/controlling-the-widget) the Widget.
{% endhint %}

When you're ready to show the Widget, call the `widget` command with the Widget Key.

```typescript
const widget = await window.Frill('widget', {
  key: 'YOUR_WIDGET_KEY', // <-- Add Widget key here
  callbacks: {
    onReady(widget) {
      // Optional callback if you prefer this syntax
      console.log(widget);
    },
  },
});
```

{% hint style="warning" %}
Using the `widget` command to load a Widget will ignore all targeting rules (e.g. URL matching and segmentation).
{% endhint %}
