nsdotjs
    Preparing search index...

    Function addTopBarButton

    • Adds a button to the top bar of the NationStates interface, detecting the correct theme and position.

      The top bar is the horizontal bar at the very top of the page (inside div#banner). Buttons can be anchored to the left or right of the central spacer element.

      Parameters

      • text: string

        The text label for the button.

      • iconClass: Icon

        The CSS class for the button's icon (e.g., "globe", "radar").

      • onClick: () => void

        A function to be called when the button is clicked.

      • position: TopBarButtonPosition = "right"

        Where to place the button in the top bar: "left" or "right".

      Returns null | HTMLDivElement

      The created button element (HTMLDivElement) or null if a required container element is not found.