Open and Close Programmatically

BeaconBar can be invoked by CMD+K or Ctrl+K by default for MacOS and Windows respectively. You can configure the invoke shortcuts as per your choice too, just open beacon bar in the beacon dashboard and search for 'Shortcuts'.

Sometimes you may want to invoke/close beacon bar directly without the user input/action for which you can invoke it programmatically.

If you want to programmatically control BeaconBar's visibility, you can use the following methods.

Opening BeaconBar

Calling Beacon.open() will trigger the display of the BeaconBar component, making it visible to users.

import { Beacon } from '@beacon.li/bar';

Beacon.open();

Closing BeaconBar

Conversely, if you want to programmatically close the BeaconBar, you can use this code:

import { Beacon } from '@beacon.li/bar';

Beacon.close();

Using Beacon.close() will hide or close the BeaconBar component from the user interface.

Last updated