Toggle

1. Notion original

2. Notion API

Partial output of src/routes/[slug]/notion-export.js
{
  "object": "block",
  …
  "type": "toggle",
  "toggle": {
    "text": [
      {
        "type": "text",
        "text": {
          "content": "Open saysme!",
          "link": null
        },
        "annotations": {
          "bold": false,
          "italic": false,
          "strikethrough": false,
          "underline": false,
          "code": false,
          "color": "default"
        },
        "plain_text": "Open saysme!",
        "href": null
      }
    ]
  },
  "blocks": [
    {
      "object": "block",
      "id": "eabfbb8b-b876-4110-ac73-4001d0c9d543",
      "created_time": "2022-01-26T09:23:00.000Z",
      "last_edited_time": "2022-01-26T09:23:00.000Z",
      "has_children": false,
      "archived": false,
      "type": "image",
      "image": {
        "caption": [],
        "type": "external",
        "external": {
          "url": "https://static.wikia.nocookie.net/disney/images/a/ae/Profile_-_Magica_De_Spell.jpg/revision/latest/scale-to-width-down/371?cb=20091223024521"
        }
      }
    }
  ]
}
  javascript

3. Svelte output

Partial output of src/routes/[slug].svelte
<Toggle>
  Open saysme!
  <span slot="children"
    ><Image url="/assets/components/toggle/eabfbb8b-b876-4110-ac73-4001d0c9d543.jpg" />
  </span>
</Toggle>
  html

4. Example rendering

Rendered byToggle.svelte
Open saysme!
 
Fancy horizontal divider

🏠 Browse the docs ⚘

High-level Discussion

Turn-intoable Block Components

Toggle Headings (not yet implemented)

Layout-only Components

Page-level Components

Annotation Components

bold → <strong>

italic → <em>

strikethrough → <s>

Other Components