Teleforge API Reference - v0.1.0
    Preparing search index...

    Function TgButton

    • Renders a theme-aware button that matches Telegram Mini App colors and supports loading, disabled, and variant states.

      Parameters

      Returns DetailedReactHTMLElement<
          {
              disabled: boolean;
              onClick: (() => void)
              | undefined;
              style:
                  | {
                      fontSize: "16px";
                      padding: "14px 20px";
                      alignItems: "center";
                      backgroundColor: string;
                      border: string;
                      borderRadius: string;
                      color: string;
                      cursor: "not-allowed"
                      | "pointer";
                      display: "inline-flex";
                      fontWeight: number;
                      gap: string;
                      justifyContent: "center";
                      opacity: number;
                      transition: "opacity 160ms ease, transform 160ms ease";
                  }
                  | {
                      fontSize: "15px";
                      padding: "12px 16px";
                      alignItems: "center";
                      backgroundColor: string;
                      border: string;
                      borderRadius: string;
                      color: string;
                      cursor: "not-allowed"
                      | "pointer";
                      display: "inline-flex";
                      fontWeight: number;
                      gap: string;
                      justifyContent: "center";
                      opacity: number;
                      transition: "opacity 160ms ease, transform 160ms ease";
                  }
                  | {
                      fontSize: "13px";
                      padding: "9px 12px";
                      alignItems: "center";
                      backgroundColor: string;
                      border: string;
                      borderRadius: string;
                      color: string;
                      cursor: "not-allowed"
                      | "pointer";
                      display: "inline-flex";
                      fontWeight: number;
                      gap: string;
                      justifyContent: "center";
                      opacity: number;
                      transition: "opacity 160ms ease, transform 160ms ease";
                  };
              type: string;
          },
          HTMLElement,
      >