Notion Helper - v1.3.29
    Preparing search index...

    Function createBlock

    • Creates a toggle block.

      Parameters

      • options: string | Object | string[]

        A string, an array of strings, or an options object representing the toggle content.

        • string
        • Object
          • rich_text

            The content as a string, an array of strings, or an array of rich text objects.

          • children

            An array of child block objects.

          • color

            Color for the toggle text.

        • string[]

      Returns Object

      A toggle block object compatible with Notion's API.

      // Use with a string
      const simpleToggle = block.toggle.createBlock("Simple toggle");

      // Use with options object
      const complexToggle = block.toggle.createBlock({
      rich_text: "Complex toggle",
      color: "blue",
      children: [
      // Child blocks would go here
      ]
      });