Skip to content

SettingsButton

Implements Telegram Mini Apps Settings Button.

Initialization

To initialize the component, use the initSettingsButton function:

typescript
import { initSettingsButton } from '@telegram-apps/sdk';

const [settingsButton] = initSettingsButton();

Showing and Hiding

To show and hide the SettingsButton, it is required to use show() and hide() methods. These methods update the button's isVisible property:

typescript
settingsButton.show();
console.log(settingsButton.isVisible); // true  

settingsButton.hide();
console.log(settingsButton.isVisible); // false

Events

List of events, which could be tracked:

EventListenerTriggered when
click() => voidSettings Button was clicked
change() => voidSomething in component changed
change:isVisible(value: boolean) => voidisVisible property changed

Methods Support

List of methods, which could be used in support checks: show and hide

Released under the MIT License.