diff --git a/examples/official-site/content/components/alert/examples/01-basic.md b/examples/official-site/content/components/alert/examples/01-basic.md
new file mode 100644
index 000000000..980732ae5
--- /dev/null
+++ b/examples/official-site/content/components/alert/examples/01-basic.md
@@ -0,0 +1,8 @@
+---
+rows:
+ - component: alert
+ title: Attention
+ description: This is an important message.
+---
+
+A basic alert message
diff --git a/examples/official-site/content/components/alert/examples/02-notifications.md b/examples/official-site/content/components/alert/examples/02-notifications.md
new file mode 100644
index 000000000..177d145f7
--- /dev/null
+++ b/examples/official-site/content/components/alert/examples/02-notifications.md
@@ -0,0 +1,20 @@
+---
+rows:
+ - component: alert
+ title: Success
+ description: Item successfully added to your cart.
+ icon: check
+ color: green
+ - component: alert
+ title: Warning
+ description: Your cart is almost full.
+ icon: alert-triangle
+ color: yellow
+ - component: alert
+ title: Error
+ description: Your cart is full.
+ icon: alert-circle
+ color: red
+---
+
+A list of notifications
diff --git a/examples/official-site/content/components/alert/examples/03-multiple-links.md b/examples/official-site/content/components/alert/examples/03-multiple-links.md
new file mode 100644
index 000000000..76635214e
--- /dev/null
+++ b/examples/official-site/content/components/alert/examples/03-multiple-links.md
@@ -0,0 +1,16 @@
+---
+rows:
+ - component: alert
+ title: Your dashboard is ready!
+ icon: analyze
+ color: teal
+ dismissible: true
+ description: Your public web dashboard was successfully created.
+ - link: dashboard.sql
+ title: View your dashboard
+ - link: index.sql
+ title: Back to home
+ color: secondary
+---
+
+A full-featured notification message with multiple links
diff --git a/examples/official-site/content/components/alert/examples/04-danger.md b/examples/official-site/content/components/alert/examples/04-danger.md
new file mode 100644
index 000000000..631efda20
--- /dev/null
+++ b/examples/official-site/content/components/alert/examples/04-danger.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: alert
+ title: Alert
+ icon: alert-circle
+ color: red
+ important: true
+ dismissible: true
+ description: SQLPage is entirely free and open source.
+ link: https://github.com/sqlpage/SQLPage
+ link_text: See source code
+---
+
+An important danger alert message with an icon and color
diff --git a/examples/official-site/content/components/alert/examples/05-markdown.md b/examples/official-site/content/components/alert/examples/05-markdown.md
new file mode 100644
index 000000000..b91bd0460
--- /dev/null
+++ b/examples/official-site/content/components/alert/examples/05-markdown.md
@@ -0,0 +1,10 @@
+---
+rows:
+ - component: alert
+ title: Free and open source
+ icon: free-rights
+ color: info
+ description_md: '*SQLPage* is entirely free and open source. You can **contribute** to it on [GitHub](https://github.com/sqlpage/SQLPage).'
+---
+
+An alert message with a Markdown-formatted description
diff --git a/examples/official-site/content/components/authentication/examples/01-http-basic.md b/examples/official-site/content/components/authentication/examples/01-http-basic.md
new file mode 100644
index 000000000..a12270a0e
--- /dev/null
+++ b/examples/official-site/content/components/authentication/examples/01-http-basic.md
@@ -0,0 +1,106 @@
+### Usage with HTTP basic authentication
+
+The most basic usage of the authentication component is with the
+[`sqlpage.basic_auth_username()`](functions.sql?function=basic_auth_username#function) and
+[`sqlpage.basic_auth_password()`](functions.sql?function=basic_auth_password#function) functions.
+The component will check if the provided password matches the stored [password hash](/examples/hash_password.sql),
+and if not, it will prompt the user to enter a password in a browser popup:
+
+```sql
+SELECT 'authentication' AS component,
+ '$argon2i$v=19$m=8,t=1,p=1$YWFhYWFhYWE$oKBq5E8XFTHO2w' AS password_hash, -- this is a hash of the password 'password'
+ sqlpage.basic_auth_password() AS password; -- this is the password that the user entered in the browser popup
+```
+
+You can [generate a password hash using the `hash_password` function](/examples/hash_password.sql).
+
+If you want to have multiple users with different passwords,
+you could store them with their password hashes in the database,
+or just hardcode them use a `CASE` statement:
+
+```sql
+SELECT 'authentication' AS component,
+ case sqlpage.basic_auth_username()
+ when 'admin'
+ then '$argon2i$v=19$m=8,t=1,p=1$YWFhYWFhYWE$oKBq5E8XFTHO2w' -- the password is 'password'
+ when 'user'
+ then '$argon2i$v=19$m=8,t=1,p=1$YWFhYWFhYWE$qsrWdjgl96ooYw' -- the password is 'user'
+ end AS password_hash, -- this is a hash of the password 'password'
+ sqlpage.basic_auth_password() AS password; -- this is the password that the user entered in the browser popup
+```
+
+Try this example online: [SQL Basic Auth](/examples/authentication/basic_auth.sql).
+
+### Advanced user session management
+
+*Basic auth* is the simplest way to password-protect a page,
+but it is not very flexible nor user-friendly,
+because the browser will show an unstyled popup asking for the username and password.
+
+For more advanced authentication, you can store user information and user sessions in your database.
+You can then use the [`form`](/component.sql?component=form#component) component to create a custom login form.
+When the user submits the form, you check if the password is correct using the `authentication` component.
+You then store a unique string of numbers and letters (a session token) both in the user's browser
+using the [`cookie`](/component.sql?component=cookie#component) component and in your database.
+Then, in all the pages that require authentication, you check if the cookie is present and matches the session token in your database.
+
+You can check if the user has sent the correct password in a form, and if not, redirect them to a login page.
+
+Create a login form in a file called `login.sql` that uses the [login component](?component=login):
+
+```sql
+select 'login' as component;
+```
+
+And then, in `create_session_token.sql` :
+
+```sql
+SELECT 'authentication' AS component,
+ 'login.sql' AS link,
+ '$argon2id$v=19$m=16,t=2,p=1$TERTd0lIcUpraWFTcmRQYw$+bjtag7Xjb6p1dsuYOkngw' AS password_hash, -- generated using sqlpage.hash_password
+ :password AS password; -- this is the password that the user sent through our form
+
+-- The code after this point is only executed if the user has sent the correct password
+
+```
+
+and in `login.sql` :
+
+```sql
+SELECT 'form' AS component, 'Login' AS title, 'my_protected_page.sql' AS action;
+SELECT 'password' AS type, 'password' AS name, 'Password' AS label;
+```
+
+### Advanced: usage with a session token
+
+Calling the `authentication` component is expensive.
+The password hashing algorithm is designed to be slow, so that it is difficult to brute-force the password,
+even if an attacker gets access to the database.
+
+If you want to avoid calling the `authentication` component on every page, you can use a session token.
+A session token is a random string that is generated when the user logs in, and stored in the database.
+It has a limited lifetime, and is stored in a cookie in the user's browser.
+When the user visits a page, the session token is sent to the server, and the server checks if it is valid.
+
+```sql
+SELECT 'authentication' AS component,
+ 'login.sql' AS link,
+ (SELECT password_hash FROM user WHERE username = :username) AS password_hash,
+ :password AS password;
+
+-- The code after this point is only executed if the user has sent the correct password
+
+-- Generate a random session token
+INSERT INTO session (id, username)
+VALUES (sqlpage.random_string(32), :username)
+RETURNING
+ 'cookie' AS component,
+ 'session_token' AS name,
+ id AS value;
+```
+
+### Single sign-on with OIDC (OpenID Connect)
+
+If you don't want to manage your own user database,
+you can [use OpenID Connect and OAuth2](/sso) to authenticate users.
+This allows users to log in with their Google, Microsoft, or internal company account.
diff --git a/examples/official-site/content/components/big_number/examples/01-change-and-progress.md b/examples/official-site/content/components/big_number/examples/01-change-and-progress.md
new file mode 100644
index 000000000..e0b4cf8fe
--- /dev/null
+++ b/examples/official-site/content/components/big_number/examples/01-change-and-progress.md
@@ -0,0 +1,22 @@
+---
+rows:
+ - component: big_number
+ - title: Sales
+ value: 75
+ unit: '%'
+ title_link: '#sales_dashboard'
+ title_link_new_tab: true
+ value_link: '#sales_details'
+ value_link_new_tab: false
+ description: Conversion rate
+ change_percent: 9
+ progress_percent: 75
+ progress_color: blue
+ - title: Revenue
+ value: 4,300
+ unit: $
+ description: Year on year
+ change_percent: -8
+---
+
+Big numbers with change indicators and progress bars
diff --git a/examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md b/examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md
new file mode 100644
index 000000000..662d83696
--- /dev/null
+++ b/examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md
@@ -0,0 +1,32 @@
+---
+rows:
+ - component: big_number
+ columns: 3
+ id: colorfull_dashboard
+ - title: Users
+ value: 1,234
+ color: red
+ title_link: '#users'
+ title_link_new_tab: false
+ value_link: '#users_details'
+ value_link_new_tab: true
+ - title: Orders
+ value: 56
+ color: green
+ title_link: '#orders'
+ title_link_new_tab: true
+ - title: Revenue
+ value: 9,876
+ unit: €
+ color: blue
+ change_percent: -7
+ dropdown_item:
+ - label: This week
+ link: ?days=7&component=big_number#colorfull_dashboard
+ - label: This month
+ link: ?days=30&component=big_number#colorfull_dashboard
+ - label: This quarter
+ link: ?days=90&component=big_number#colorfull_dashboard
+---
+
+Big numbers with dropdowns and customized layout
diff --git a/examples/official-site/content/components/breadcrumb/examples/01-basic.md b/examples/official-site/content/components/breadcrumb/examples/01-basic.md
new file mode 100644
index 000000000..4de79d141
--- /dev/null
+++ b/examples/official-site/content/components/breadcrumb/examples/01-basic.md
@@ -0,0 +1,12 @@
+---
+rows:
+ - component: breadcrumb
+ - title: Home
+ link: /
+ - title: Components
+ link: /documentation.sql
+ - title: Breadcrumb
+ link: ?component=breadcrumb
+---
+
+Basic usage of the breadcrumb component
diff --git a/examples/official-site/content/components/breadcrumb/examples/02-selected-page.md b/examples/official-site/content/components/breadcrumb/examples/02-selected-page.md
new file mode 100644
index 000000000..5a87fe176
--- /dev/null
+++ b/examples/official-site/content/components/breadcrumb/examples/02-selected-page.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: breadcrumb
+ - title: Home
+ link: /
+ active: true
+ - title: Articles
+ link: /blog.sql
+ description: Stay informed with the latest news
+ - title: JSON in SQL
+ link: /blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide
+ description: Learn advanced json functions for MySQL, SQLite, PostgreSQL, and SQL Server
+---
+
+Description of a link and selection of the current page.
diff --git a/examples/official-site/content/components/button/examples/01-basic.md b/examples/official-site/content/components/button/examples/01-basic.md
new file mode 100644
index 000000000..25baa56fb
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/01-basic.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: button
+ - link: /documentation.sql
+ title: Enabled
+ - link: '#'
+ title: Disabled
+ disabled: true
+---
+
+A basic button with a link
diff --git a/examples/official-site/content/components/button/examples/02-shape-and-color.md b/examples/official-site/content/components/button/examples/02-shape-and-color.md
new file mode 100644
index 000000000..b8e1891cb
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/02-shape-and-color.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: button
+ size: sm
+ shape: pill
+ - title: Purple
+ outline: purple
+ - title: Orange
+ outline: orange
+ - title: Red
+ outline: red
+---
+
+A button with a custom shape, size, and outline color
diff --git a/examples/official-site/content/components/button/examples/03-centered.md b/examples/official-site/content/components/button/examples/03-centered.md
new file mode 100644
index 000000000..f6f832792
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/03-centered.md
@@ -0,0 +1,25 @@
+---
+rows:
+ - component: button
+ justify: center
+ - link: '#'
+ color: light
+ title: Light
+ - link: '#'
+ color: success
+ title: Success
+ - link: '#'
+ color: info
+ title: Info
+ - link: '#'
+ color: dark
+ title: Dark
+ - link: '#'
+ color: warning
+ title: Warning
+ - link: '#'
+ color: danger
+ title: Narrow
+---
+
+A list of buttons aligned in the center
diff --git a/examples/official-site/content/components/button/examples/04-narrow.md b/examples/official-site/content/components/button/examples/04-narrow.md
new file mode 100644
index 000000000..0fadda248
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/04-narrow.md
@@ -0,0 +1,46 @@
+---
+rows:
+ - component: button
+ - link: '#'
+ narrow: true
+ icon: edit
+ color: primary
+ tooltip: Edit
+ - link: '#'
+ narrow: true
+ icon: trash
+ color: danger
+ tooltip: Delete
+ - link: '#'
+ narrow: true
+ icon: corner-down-right
+ color: info
+ tooltip: Preview
+ - link: '#'
+ narrow: true
+ icon: download
+ color: success
+ tooltip: Download
+ - link: '#'
+ narrow: true
+ icon: upload
+ color: warning
+ tooltip: Upload
+ - link: '#'
+ narrow: true
+ icon: info-circle
+ color: cyan
+ tooltip: Info
+ - link: '#'
+ narrow: true
+ icon: help-circle
+ color: purple
+ tooltip: Help
+ - link: '#'
+ narrow: true
+ icon: settings
+ color: indigo
+ tooltip: Settings
+---
+
+Icon buttons using the narrow property
diff --git a/examples/official-site/content/components/button/examples/05-icons.md b/examples/official-site/content/components/button/examples/05-icons.md
new file mode 100644
index 000000000..c1c3ce94a
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/05-icons.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: button
+ size: lg
+ - link: '#'
+ outline: azure
+ title: Edit
+ icon: edit
+ - link: '#'
+ outline: danger
+ title: Delete
+ icon: trash
+---
+
+Buttons with icons and different sizes
diff --git a/examples/official-site/content/components/button/examples/06-square.md b/examples/official-site/content/components/button/examples/06-square.md
new file mode 100644
index 000000000..b705ff25f
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/06-square.md
@@ -0,0 +1,20 @@
+---
+rows:
+ - component: button
+ shape: square
+ - link: '#'
+ color: green
+ title: Save
+ icon: device-floppy
+ - link: '#'
+ title: Cancel
+ space_after: true
+ tooltip: This will delete your draft
+ - link: '#'
+ outline: indigo
+ title: Preview
+ icon_after: corner-down-right
+ tooltip: View temporary draft
+---
+
+A row of square buttons with spacing in between
diff --git a/examples/official-site/content/components/button/examples/07-form-actions.md b/examples/official-site/content/components/button/examples/07-form-actions.md
new file mode 100644
index 000000000..c8aee4e7d
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/07-form-actions.md
@@ -0,0 +1,25 @@
+---
+rows:
+ - component: form
+ id: poem
+ validate: ''
+ - type: textarea
+ name: Poem
+ placeholder: Write a poem
+ - component: button
+ - link: ?action=save
+ form: poem
+ color: primary
+ title: Save
+ - link: ?action=preview
+ form: poem
+ outline: yellow
+ title: Preview
+---
+
+Multiple buttons sending the same form to different pages.
+
+We use `'' AS validate` to remove the submit button from inside the form itself,
+and instead use the button component to submit the form to pages with different GET variables.
+
+In the target page, we could then use the GET variable `$action` to determine what to do with the form data.
diff --git a/examples/official-site/content/components/button/examples/08-download.md b/examples/official-site/content/components/button/examples/08-download.md
new file mode 100644
index 000000000..68bdf46c4
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/08-download.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: button
+ - link: /sqlpage_introduction_video.mp4
+ title: Download Video
+ icon: download
+ download: Introduction Video.webm
+ rel: nofollow
+---
+
+A button that downloads a file when clicked, and prevents search engines from following the link.
diff --git a/examples/official-site/content/components/button/examples/09-image.md b/examples/official-site/content/components/button/examples/09-image.md
new file mode 100644
index 000000000..4420566b6
--- /dev/null
+++ b/examples/official-site/content/components/button/examples/09-image.md
@@ -0,0 +1,9 @@
+---
+rows:
+ - component: button
+ - link: https://en.wikipedia.org/wiki/File:Globe.svg
+ title: Open an article
+ image: https://upload.wikimedia.org/wikipedia/commons/f/fa/Globe.svg
+---
+
+A button with an image-based icon.
diff --git a/examples/official-site/content/components/card/examples/01-grid.md b/examples/official-site/content/components/card/examples/01-grid.md
new file mode 100644
index 000000000..eb80da3c6
--- /dev/null
+++ b/examples/official-site/content/components/card/examples/01-grid.md
@@ -0,0 +1,22 @@
+---
+rows:
+ - component: card
+ title: Popular SQLPage features
+ columns: 2
+ - title: Download as spreadsheet
+ link: ?component=csv#component
+ description: Using the CSV component, you can download your data as a spreadsheet.
+ icon: file-plus
+ color: green
+ footer_md: SQLPage can both [read](?component=form#component) and [write](?component=csv#component) **CSV**
+ files.
+ - title: Custom components
+ link: /custom_components.sql
+ description: If you know some HTML, you can create your own components for your application.
+ icon: code
+ color: orange
+ footer_md: You can look at the [source of the official components](https://github.com/sqlpage/SQLPage/tree/main/sqlpage/templates)
+ for inspiration.
+---
+
+A beautiful card grid with bells and whistles, showing examples of SQLPage features.
diff --git a/examples/official-site/content/components/card/examples/02-dashboard.md b/examples/official-site/content/components/card/examples/02-dashboard.md
new file mode 100644
index 000000000..8cca72541
--- /dev/null
+++ b/examples/official-site/content/components/card/examples/02-dashboard.md
@@ -0,0 +1,21 @@
+---
+rows:
+ - component: card
+ columns: 4
+ - description_md: '**152** sales today'
+ active: true
+ icon: currency-euro
+ - description_md: '**13** new users'
+ icon: user-plus
+ color: green
+ - description_md: '**2** complaints'
+ icon: alert-circle
+ color: danger
+ link: ?view_complaints
+ background_color: red-lt
+ - description_md: '**1** pending support request'
+ icon: mail-question
+ color: warning
+---
+
+You can use cards to display a dashboard with quick access to important information. Use [markdown](https://www.markdownguide.org/basic-syntax) to format the text.
diff --git a/examples/official-site/content/components/card/examples/03-image-gallery.md b/examples/official-site/content/components/card/examples/03-image-gallery.md
new file mode 100644
index 000000000..1854ac927
--- /dev/null
+++ b/examples/official-site/content/components/card/examples/03-image-gallery.md
@@ -0,0 +1,30 @@
+---
+rows:
+ - component: card
+ title: My favorite animals in pictures
+ columns: 3
+ - title: Lynx
+ description_md: The **lynx** is a medium-sized **wild cat** native to Northern, Central and Eastern Europe
+ to Central Asia and Siberia, the Tibetan Plateau and the Himalayas.
+ top_image: https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Lynx_lynx_-_05.jpg/330px-Lynx_lynx_-_05.jpg
+ top_image_width: 330
+ top_image_height: 495
+ top_image_lazy: true
+ icon: star
+ - title: Squirrel
+ description_md: The **chipmunk** is a small, striped rodent of the family Sciuridae. Chipmunks are found
+ in North America, with the exception of the Siberian chipmunk which is found primarily in Asia.
+ top_image: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/American_squirrel_eating_nut%2C_13_Jun_2013.JPG/330px-American_squirrel_eating_nut%2C_13_Jun_2013.JPG
+ top_image_width: 330
+ top_image_height: 495
+ top_image_lazy: true
+ - title: Spider
+ description_md: The **jumping spider family** (_Salticidae_) contains more than 600 described genera and
+ about *6000 described species*, making it the largest family of spiders with about 13% of all species.
+ top_image: https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Australian_orb_weaver_spinning_web.jpg/330px-Australian_orb_weaver_spinning_web.jpg
+ top_image_width: 330
+ top_image_height: 495
+ top_image_lazy: true
+---
+
+A gallery of images.
diff --git a/examples/official-site/content/components/card/examples/04-variable-width.md b/examples/official-site/content/components/card/examples/04-variable-width.md
new file mode 100644
index 000000000..348c64adf
--- /dev/null
+++ b/examples/official-site/content/components/card/examples/04-variable-width.md
@@ -0,0 +1,23 @@
+---
+rows:
+ - component: card
+ title: Beautifully colored cards
+ - title: Red card
+ color: red
+ background_color: red-lt
+ description: Penalty! You are out!
+ icon: play-football
+ - title: Blue card
+ color: blue
+ width: 6
+ background_color: blue-lt
+ description: The Blue Card facilitates migration of foreigners to Europe.
+ icon: currency-euro
+ - title: Green card
+ color: green
+ background_color: green-lt
+ description: Welcome to the United States of America !
+ icon: user-dollar
+---
+
+Beautifully colored cards with variable width. The blue card (width 6) takes half the screen, whereas of the red and green cards have the default width of 3
diff --git a/examples/official-site/content/components/card/examples/05-remote-content.md b/examples/official-site/content/components/card/examples/05-remote-content.md
new file mode 100644
index 000000000..831a1b17d
--- /dev/null
+++ b/examples/official-site/content/components/card/examples/05-remote-content.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: card
+ title: Card with embedded remote content
+ columns: 2
+ - title: Embedded Chart
+ embed: /examples/chart.sql?_sqlpage_embed
+ - title: Embedded Video
+ embed: https://www.youtube.com/embed/mXdgmSdaXkg
+ allow: accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share
+ embed_mode: iframe
+ height: '350'
+---
+
+Cards with remote content
diff --git a/examples/official-site/content/components/carousel/examples/01-basic.md b/examples/official-site/content/components/carousel/examples/01-basic.md
new file mode 100644
index 000000000..6417d67fe
--- /dev/null
+++ b/examples/official-site/content/components/carousel/examples/01-basic.md
@@ -0,0 +1,10 @@
+---
+rows:
+ - component: carousel
+ name: cats1
+ title: Famous Database Animals
+ - image: https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Elefantes_africanos_de_sabana_%28Loxodonta_africana%29%2C_Elephant_Sands%2C_Botsuana%2C_2018-07-28%2C_DD_114-117_PAN.jpg/1280px-Elefantes_africanos_de_sabana_%28Loxodonta_africana%29%2C_Elephant_Sands%2C_Botsuana%2C_2018-07-28%2C_DD_114-117_PAN.jpg
+ - image: https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Penguin_Island_panorama_with_ferry_and_dolphins_in_foreground%2C_March_2023_06.jpg/1280px-Penguin_Island_panorama_with_ferry_and_dolphins_in_foreground%2C_March_2023_06.jpg
+---
+
+A basic example of carousel
diff --git a/examples/official-site/content/components/carousel/examples/02-controls.md b/examples/official-site/content/components/carousel/examples/02-controls.md
new file mode 100644
index 000000000..1235f2337
--- /dev/null
+++ b/examples/official-site/content/components/carousel/examples/02-controls.md
@@ -0,0 +1,20 @@
+---
+rows:
+ - component: carousel
+ title: SQL web apps
+ width: 10
+ center: true
+ controls: true
+ auto: true
+ - image: /sqlpage_cover_image.webp
+ title: SQLPage is modern
+ description: Built by engineers who have built so many web applications the old way, they decided they
+ just wouldn't anymore.
+ height: 512
+ - image: /sqlpage_illustration_alien.webp
+ title: SQLPage is easy
+ description: SQLPage connects to your database, then it turns your SQL queries into nice websites.
+ height: 512
+---
+
+An advanced example of carousel with controls
diff --git a/examples/official-site/content/components/chart/examples/01-time-series.md b/examples/official-site/content/components/chart/examples/01-time-series.md
new file mode 100644
index 000000000..38b0dd87b
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/01-time-series.md
@@ -0,0 +1,26 @@
+---
+rows:
+ - component: chart
+ title: Quarterly Revenue
+ type: area
+ color: blue-lt
+ marker: 5
+ time: true
+ - x: '2022-01-01T00:00:00Z'
+ y: 15
+ - x: '2022-04-01T00:00:00Z'
+ y: 46
+ - x: '2022-07-01T00:00:00Z'
+ y: 23
+ - x: '2022-10-01T00:00:00Z'
+ y: 70
+ - x: '2023-01-01T00:00:00Z'
+ y: 35
+ - x: '2023-04-01T00:00:00Z'
+ y: 106
+ - x: '2023-07-01T00:00:00Z'
+ y: 53
+---
+
+An area chart representing a time series, using the top-level property `time`.
+ Ticks on the x axis are adjusted automatically, and ISO datetimes are parsed and displayed in a readable format.
diff --git a/examples/official-site/content/components/chart/examples/02-pie.md b/examples/official-site/content/components/chart/examples/02-pie.md
new file mode 100644
index 000000000..f4c2ba71a
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/02-pie.md
@@ -0,0 +1,13 @@
+---
+rows:
+ - component: chart
+ title: Answers
+ type: pie
+ labels: true
+ - label: 'Yes'
+ value: 65
+ - label: 'No'
+ value: 35
+---
+
+A pie chart.
diff --git a/examples/official-site/content/components/chart/examples/03-bar.md b/examples/official-site/content/components/chart/examples/03-bar.md
new file mode 100644
index 000000000..61dc61ad4
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/03-bar.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: chart
+ type: bar
+ title: Quarterly Results
+ horizontal: true
+ labels: true
+ - label: Tom
+ value: 35
+ - label: Olive
+ value: 15
+---
+
+A basic bar chart
diff --git a/examples/official-site/content/components/chart/examples/04-treemap.md b/examples/official-site/content/components/chart/examples/04-treemap.md
new file mode 100644
index 000000000..558a5822d
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/04-treemap.md
@@ -0,0 +1,27 @@
+---
+rows:
+ - component: chart
+ type: treemap
+ title: Quarterly Results By Region (in k$)
+ labels: true
+ - series: North America
+ label: United States
+ value: 35
+ - series: North America
+ label: Canada
+ value: 15
+ - series: Europe
+ label: France
+ value: 30
+ - series: Europe
+ label: Germany
+ value: 55
+ - series: Asia
+ label: China
+ value: 20
+ - series: Asia
+ label: Japan
+ value: 10
+---
+
+A TreeMap Chart allows you to display hierarchical data in a nested layout. This is useful for visualizing the proportion of each part to the whole.
diff --git a/examples/official-site/content/components/chart/examples/05-multi-series-bar.md b/examples/official-site/content/components/chart/examples/05-multi-series-bar.md
new file mode 100644
index 000000000..90404ed89
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/05-multi-series-bar.md
@@ -0,0 +1,24 @@
+---
+rows:
+ - component: chart
+ title: Expenses
+ type: bar
+ stacked: true
+ toolbar: true
+ show_legend: false
+ ystep: 10
+ - series: Marketing
+ x: 2021
+ value: 35
+ - series: Marketing
+ x: 2022
+ value: 15
+ - series: Human resources
+ x: 2021
+ value: 30
+ - series: Human resources
+ x: 2022
+ value: 55
+---
+
+A bar chart with multiple series.
diff --git a/examples/official-site/content/components/chart/examples/06-stacked-area.md b/examples/official-site/content/components/chart/examples/06-stacked-area.md
new file mode 100644
index 000000000..b84a60c9f
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/06-stacked-area.md
@@ -0,0 +1,39 @@
+---
+rows:
+ - component: chart
+ title: Power draw
+ type: area
+ stacked: true
+ time: true
+ ytitle: watts
+ color:
+ - blue
+ - teal
+ marker: 4
+ - series: CPU
+ x: '2024-03-01T10:00:00Z'
+ value: 45
+ - series: CPU
+ x: '2024-03-01T10:15:00Z'
+ value: 52
+ - series: CPU
+ x: '2024-03-01T10:30:00Z'
+ value: 48
+ - series: CPU
+ x: '2024-03-01T10:45:00Z'
+ value: 44
+ - series: GPU
+ x: '2024-03-01T10:15:00Z'
+ value: 120
+ - series: GPU
+ x: '2024-03-01T10:30:00Z'
+ value: 140
+---
+
+A stacked area chart, showing how each series contributes to a total.
+The `stacked` property also works with the `line` and `bar` chart types.
+
+Series are aligned on their `x` values, and a series that has no value for a given `x` counts as zero there:
+below, the graphics card draws no power outside of the render.
+If a missing value does not mean zero in your data, make all the series share the same `x` values,
+for instance by rounding timestamps to a common interval.
diff --git a/examples/official-site/content/components/chart/examples/07-multi-series-line.md b/examples/official-site/content/components/chart/examples/07-multi-series-line.md
new file mode 100644
index 000000000..dc58f2e45
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/07-multi-series-line.md
@@ -0,0 +1,28 @@
+---
+rows:
+ - component: chart
+ title: Revenue
+ ymin: 0
+ toolbar: true
+ - series: Chicago Store
+ x: 2021
+ value: 35
+ - series: Chicago Store
+ x: 2022
+ value: 15
+ - series: Chicago Store
+ x: 2023
+ value: 45
+ - series: New York Store
+ x: 2021
+ value: 30
+ - series: New York Store
+ x: 2022
+ value: 55
+ - series: New York Store
+ x: 2023
+ value: 19
+---
+
+A line chart with multiple series. One of the most common types of charts, often used to show trends over time.
+Also demonstrates the use of the `toolbar` attribute to allow the user to download the graph as an image or the data as a CSV file.
diff --git a/examples/official-site/content/components/chart/examples/08-scatter.md b/examples/official-site/content/components/chart/examples/08-scatter.md
new file mode 100644
index 000000000..a11d855e8
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/08-scatter.md
@@ -0,0 +1,32 @@
+---
+rows:
+ - component: chart
+ title: Gross domestic product and its growth
+ type: scatter
+ xtitle: Growth Rate
+ ytitle: GDP (Trillions USD)
+ height: 500
+ marker: 8
+ xmin: 0
+ xmax: 10
+ ymin: 0
+ ymax: 25
+ yticks: 5
+ - series: Brazil
+ x: 2.5
+ y: 2
+ - series: China
+ x: 6.5
+ y: 14
+ - series: United States
+ x: 2.3
+ y: 21
+ - series: France
+ x: 1.5
+ y: 3
+ - series: South Africa
+ x: 0.9
+ y: 0.3
+---
+
+A scatter plot with multiple custom options.
diff --git a/examples/official-site/content/components/chart/examples/09-heatmap.md b/examples/official-site/content/components/chart/examples/09-heatmap.md
new file mode 100644
index 000000000..fe309f00d
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/09-heatmap.md
@@ -0,0 +1,51 @@
+---
+rows:
+ - component: chart
+ title: Survey Results
+ type: heatmap
+ ytitle: Database managemet system
+ xtitle: Year
+ color:
+ - purple
+ - purple
+ - purple
+ - series: PostgreSQL
+ x: '2000'
+ y: 48
+ - series: SQLite
+ x: '2000'
+ y: 44
+ - series: MySQL
+ x: '2000'
+ y: 78
+ - series: PostgreSQL
+ x: '2010'
+ y: 65
+ - series: SQLite
+ x: '2010'
+ y: 62
+ - series: MySQL
+ x: '2010'
+ y: 83
+ - series: PostgreSQL
+ x: '2020'
+ y: 73
+ - series: SQLite
+ x: '2020'
+ y: 38
+ - series: MySQL
+ x: '2020'
+ y: 87
+---
+
+## Heatmaps
+
+You can build heatmaps using the `heatmap` top-level property.
+
+The data format follows the [apexcharts heatmap format](https://apexcharts.com/angular-chart-demos/heatmap-charts/basic/),
+where each series is represented as a line in the chart:
+ - The `x` property of each item will be used as the x-axis value.
+ - The `series` property of each item will be used as the y-axis value.
+ - The `y` property of each item will be used as the value to display in the heatmap
+
+The `color` property sets the color of each series separately, in order.
diff --git a/examples/official-site/content/components/chart/examples/10-timeline.md b/examples/official-site/content/components/chart/examples/10-timeline.md
new file mode 100644
index 000000000..ad4ce54f6
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/10-timeline.md
@@ -0,0 +1,31 @@
+---
+rows:
+ - component: chart
+ title: Project Timeline
+ type: rangeBar
+ time: true
+ color:
+ - teal
+ - cyan
+ labels: true
+ xmin: '2021-12-28'
+ xmax: '2022-01-04'
+ - series: Phase 1
+ label: Operations
+ value:
+ - '2021-12-29'
+ - '2022-01-02'
+ link: /examples/chart.sql?phase=1
+ - series: Phase 2
+ label: Operations
+ value:
+ - '2022-01-03'
+ - '2022-01-04'
+ - series: Yearly maintenance
+ label: Maintenance
+ value:
+ - '2022-01-01'
+ - '2022-01-03'
+---
+
+A timeline displaying events with a start and an end date. A data row can include a `link` to open when its bar or tooltip title is clicked.
diff --git a/examples/official-site/content/components/chart/examples/11-single-value-color.md b/examples/official-site/content/components/chart/examples/11-single-value-color.md
new file mode 100644
index 000000000..14149ba21
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/11-single-value-color.md
@@ -0,0 +1,38 @@
+---
+rows:
+ - component: chart
+ title: Accounts expiring soon
+ type: bar
+ horizontal: true
+ labels: true
+ show_legend: false
+ - label: 30 days
+ value: 100
+ color: red
+ - label: 60 days
+ value: 200
+ color: orange
+ - label: 90 days
+ value: 300
+ color: green
+---
+
+## Coloring a single value
+
+A data row can carry its own `color`, to paint the one bar, slice or point it
+plots. Use it when the color says something the axes do not: a threshold
+crossed, a status, the one category the reader should look at first.
+
+```sql
+select 'chart' as component, 'bar' as type, true as horizontal,
+ true as labels, false as show_legend;
+select
+ window_label as label,
+ accounts as value,
+ case when days <= 30 then 'red' when days <= 60 then 'orange' else 'green' end as color
+from expiring_accounts order by days;
+```
+
+A row color takes precedence over the color of its series. On a `line` or an
+`area` chart it paints the marker of the point, so set `marker` for it to show.
+A `heatmap` shades its cells from their own value and ignores it.
diff --git a/examples/official-site/content/components/chart/examples/12-pie-slice-colors.md b/examples/official-site/content/components/chart/examples/12-pie-slice-colors.md
new file mode 100644
index 000000000..8a0dafbfd
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/12-pie-slice-colors.md
@@ -0,0 +1,18 @@
+---
+rows:
+ - component: chart
+ title: Support tickets
+ type: pie
+ labels: true
+ - label: Resolved
+ value: 72
+ color: green
+ - label: In progress
+ value: 21
+ color: yellow
+ - label: Overdue
+ value: 7
+ color: red
+---
+
+A pie chart whose rows choose their own slice colors.
diff --git a/examples/official-site/content/components/chart/examples/13-reference-lines.md b/examples/official-site/content/components/chart/examples/13-reference-lines.md
new file mode 100644
index 000000000..413fd86b4
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/13-reference-lines.md
@@ -0,0 +1,54 @@
+---
+rows:
+ - component: chart
+ title: CPU temperature
+ type: line
+ time: true
+ ytitle: °C
+ ymax: 100
+ color: azure
+ marker: 4
+ - yline: 70
+ label: target
+ color: green
+ - yline: 90
+ yline_end: 100
+ label: throttling
+ color: red
+ - x: '2024-05-01T08:00:00Z'
+ y: 52
+ - x: '2024-05-01T09:00:00Z'
+ y: 58
+ - x: '2024-05-01T10:00:00Z'
+ y: 71
+ - x: '2024-05-01T11:00:00Z'
+ y: 83
+ - x: '2024-05-01T12:00:00Z'
+ y: 94
+ - x: '2024-05-01T13:00:00Z'
+ y: 76
+ - x: '2024-05-01T14:00:00Z'
+ y: 63
+---
+
+## Reference lines
+
+A row with a `yline` is not plotted as a data point, but drawn as a line across
+the whole chart, at that value of the y axis. Use it for the limit that the data
+should be read against: a disk quota, an alarm threshold, a service level
+objective. Add `yline_end` to make it a band instead of a line.
+
+Reference lines are rows, so they come from a query like everything else,
+and a chart can have as many of them as the query returns:
+
+```sql
+select 'chart' as component, 'CPU temperature' as title, true as time, 100 as ymax;
+select celsius as yline, name as label, color as color from thresholds;
+select measured_at as x, celsius as y from readings order by measured_at;
+```
+
+They are drawn as annotations rather than as an extra series, so they are not
+added to the total of a `stacked` chart, and are not filled in an `area` chart.
+
+A line outside of the y axis is not drawn, and does not stretch the axis to fit,
+so set `ymax` when the limit is above the data.
diff --git a/examples/official-site/content/components/chart/examples/14-event-markers.md b/examples/official-site/content/components/chart/examples/14-event-markers.md
new file mode 100644
index 000000000..5b8339440
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/14-event-markers.md
@@ -0,0 +1,49 @@
+---
+rows:
+ - component: chart
+ title: Request latency
+ type: area
+ time: true
+ ytitle: ms
+ color: blue-lt
+ marker: 3
+ - xline: '2024-05-01T10:00:00Z'
+ label: deploy
+ color: green
+ - xline: '2024-05-01T11:30:00Z'
+ xline_end: '2024-05-01T13:00:00Z'
+ label: incident
+ color: red
+ - x: '2024-05-01T08:00:00Z'
+ y: 120
+ - x: '2024-05-01T09:00:00Z'
+ y: 134
+ - x: '2024-05-01T10:00:00Z'
+ y: 128
+ - x: '2024-05-01T11:00:00Z'
+ y: 141
+ - x: '2024-05-01T12:00:00Z'
+ y: 512
+ - x: '2024-05-01T13:00:00Z'
+ y: 470
+ - x: '2024-05-01T14:00:00Z'
+ y: 156
+ - x: '2024-05-01T15:00:00Z'
+ y: 133
+---
+
+## Marking events
+
+`xline` is the counterpart of `yline`: it marks a position on the x axis instead
+of a value on the y axis. On its own it marks a moment, like a deployment.
+With `xline_end`, it covers everything in between, like an incident or a
+maintenance window. A single query can draw a whole log of them:
+
+```sql
+select started_at as xline, ended_at as xline_end, summary as label,
+ case severity when 'outage' then 'red' else 'orange' end as color
+from incidents where started_at > $since;
+```
+
+When `time` is set, an `xline` is a date or a timestamp, written like the `x` of
+a data point. On a chart with text labels on the x axis, it is one of those labels.
diff --git a/examples/official-site/content/components/chart/examples/15-reference-line-axes.md b/examples/official-site/content/components/chart/examples/15-reference-line-axes.md
new file mode 100644
index 000000000..7b54b217e
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/15-reference-line-axes.md
@@ -0,0 +1,42 @@
+---
+rows:
+ - component: chart
+ title: Disk usage
+ type: bar
+ horizontal: true
+ ymax: 100
+ color: azure
+ labels: true
+ - yline: 90
+ label: full
+ color: red
+ - xline: db-1
+ label: watched
+ color: purple
+ - x: backup-1
+ y: 41
+ - x: web-2
+ y: 63
+ - x: db-1
+ y: 88
+ - x: web-1
+ y: 96
+---
+
+## Reference lines follow their axis
+
+A reference belongs to the column it is written in, not to a direction on the
+screen. `yline` always marks a value of `y`, and `xline` a position on `x`,
+whichever way round the chart is drawn. A `horizontal` bar chart runs its y axis
+from left to right, so a `yline` is drawn down the chart and an `xline` picks out
+one of the bars.
+
+```sql
+select 'chart' as component, 'bar' as type, true as horizontal, 100 as ymax;
+select 90 as yline, 'full' as label, 'red' as color;
+select 'db-1' as xline, 'watched' as label, 'purple' as color;
+select host as x, percent_used as y from disks order by percent_used;
+```
+
+A `pie` has no axes and ignores reference lines, and on a `heatmap`, whose y axis
+holds the names of the series, only `xline` has a meaning.
diff --git a/examples/official-site/content/components/chart/examples/16-side-by-side.md b/examples/official-site/content/components/chart/examples/16-side-by-side.md
new file mode 100644
index 000000000..b59fdbe08
--- /dev/null
+++ b/examples/official-site/content/components/chart/examples/16-side-by-side.md
@@ -0,0 +1,17 @@
+---
+rows:
+ - component: card
+ title: A dashboard with multiple graphs on the same line
+ columns: 2
+ - embed: /examples/chart.sql?color=green&n=42&_sqlpage_embed
+ - embed: /examples/chart.sql?_sqlpage_embed
+---
+
+## Multiple charts on the same line
+
+You can create information-dense dashboards by using the [card component](?component=card#component)
+to put multiple charts on the same line.
+
+For this, create one sql file per visualization you want to show,
+and set the `embed` attribute of the [card](?component=card#component) component
+to the path of the file you want to include, followed by `?_sqlpage_embed`.
diff --git a/examples/official-site/content/components/code/examples/01-html-source.md b/examples/official-site/content/components/code/examples/01-html-source.md
new file mode 100644
index 000000000..6ed2e7909
--- /dev/null
+++ b/examples/official-site/content/components/code/examples/01-html-source.md
@@ -0,0 +1,23 @@
+---
+rows:
+ - component: code
+ - title: A HTML5 example
+ language: html
+ description: Here’s the very minimum that an HTML document should contain, assuming it has CSS and JavaScript
+ linked to it.
+ contents: |-
+
+
+
+
+ title
+
+
+
+
+
+
+
+---
+
+Displays a block of HTML code.
diff --git a/examples/official-site/content/components/columns/examples/01-pricing-plans.md b/examples/official-site/content/components/columns/examples/01-pricing-plans.md
new file mode 100644
index 000000000..a13093f93
--- /dev/null
+++ b/examples/official-site/content/components/columns/examples/01-pricing-plans.md
@@ -0,0 +1,52 @@
+---
+rows:
+ - component: columns
+ - title: Start Plan
+ value: €18
+ description: Perfect for testing and small-scale projects
+ item:
+ - 128MB Database
+ - SQLPage hosting
+ - Community support
+ link: https://datapage.app
+ button_text: Start Free Trial
+ small_text: /month
+ - title: Pro Plan
+ value: €40
+ icon: rocket
+ description: For growing projects needing enhanced features
+ item:
+ - icon: database
+ color: blue
+ description: 1GB Database
+ - icon: headset
+ color: green
+ description: Priority Support
+ - icon: world
+ color: purple
+ description: Custom Domain
+ link: https://datapage.app
+ button_text: Start Free Trial
+ button_color: indigo
+ value_color: indigo
+ small_text: /month
+ - title: Enterprise Plan
+ value: €600
+ icon: building-skyscraper
+ description: For large-scale operations with custom needs
+ item:
+ - icon: database-plus
+ description_md: '**Custom Database Scaling**'
+ - icon: shield-lock
+ description_md: '**Enterprise Auth** with Single Sign-On'
+ - icon: headset
+ description_md: '**Monthly** Expert Support time'
+ - icon: file-certificate
+ description_md: '**SLA** with guaranteed uptime'
+ link: mailto:contact@datapage.app
+ button_text: Contact Us
+ small_text: /month
+ target: _blank
+---
+
+Pricing Plans Display
diff --git a/examples/official-site/content/components/columns/examples/02-company-metrics.md b/examples/official-site/content/components/columns/examples/02-company-metrics.md
new file mode 100644
index 000000000..c194d35bb
--- /dev/null
+++ b/examples/official-site/content/components/columns/examples/02-company-metrics.md
@@ -0,0 +1,41 @@
+---
+rows:
+ - component: columns
+ - title: Monthly Active Users
+ value: 10k
+ value_color: blue
+ size: 4
+ description: Total active users this month, showcasing user engagement.
+ item:
+ - icon: target
+ description: 'Target: 12,000'
+ link: '#'
+ button_text: User Activity Overview
+ button_color: info
+ - title: Revenue
+ value: $49k
+ value_color: blue
+ size: 4
+ description: Total revenue generated this month, indicating financial performance.
+ item:
+ - icon: trending-down
+ color: red
+ description: down from $51k last month
+ link: '#'
+ button_text: Financial Dashboard
+ button_color: info
+ - title: Customer Satisfaction
+ value: 94%
+ value_color: blue
+ size: 4
+ description: Percentage of satisfied customers, reflecting service quality.
+ item:
+ - icon: trending-up
+ color: green
+ description: + 2% this month
+ link: '#'
+ button_text: Open Google Ratings
+ button_color: info
+---
+
+Tech Company KPIs Display
diff --git a/examples/official-site/content/components/cookie/examples/01-set-a-cookie.md b/examples/official-site/content/components/cookie/examples/01-set-a-cookie.md
new file mode 100644
index 000000000..054b57adc
--- /dev/null
+++ b/examples/official-site/content/components/cookie/examples/01-set-a-cookie.md
@@ -0,0 +1,15 @@
+Create a cookie named `username` with the value `John Doe`...
+
+```sql
+SELECT 'cookie' as component,
+ 'username' as name,
+ 'John Doe' as value
+ FALSE AS secure; -- You can remove this if the site is served over HTTPS.
+```
+
+and then display the value of the cookie using the [`sqlpage.cookie`](functions.sql?function=cookie) function:
+
+```sql
+SELECT 'text' as component,
+ 'Your name is ' || COALESCE(sqlpage.cookie('username'), 'not known to us');
+```
diff --git a/examples/official-site/content/components/csv/examples/01-download-url.md b/examples/official-site/content/components/csv/examples/01-download-url.md
new file mode 100644
index 000000000..dcc16529e
--- /dev/null
+++ b/examples/official-site/content/components/csv/examples/01-download-url.md
@@ -0,0 +1,21 @@
+---
+rows:
+ - component: button
+ - title: Download my data
+ link: /examples/csv_download.sql
+---
+
+### Header component: creating a CSV download URL
+
+You can create a page that will trigger a download of the CSV file when the user visits it.
+The contents will be streamed efficiently from the database to the browser, without being fully loaded in memory.
+This makes it possible to download even very large files without overloading the database server, the web server, or the client's browser.
+
+#### `csv_download.sql`
+
+```sql
+select 'csv' as component, 'example.csv' as filename;
+SELECT * FROM my_large_table;
+```
+
+#### `index.sql`
diff --git a/examples/official-site/content/components/csv/examples/02-download-button.md b/examples/official-site/content/components/csv/examples/02-download-button.md
new file mode 100644
index 000000000..e0e771c6b
--- /dev/null
+++ b/examples/official-site/content/components/csv/examples/02-download-button.md
@@ -0,0 +1,23 @@
+---
+rows:
+ - component: csv
+ title: Download my data
+ filename: people
+ icon: file-download
+ color: green
+ separator: ;
+ bom: true
+ - Forename: Ophir
+ Surname: Lojkine
+ Pseudonym: lovasoa
+ - Forename: Linus
+ Surname: Torvalds
+ Pseudonym: torvalds
+---
+
+### CSV download button
+
+This will generate a button to download the CSV file.
+The button element itself will embed the entire contents of the CSV file, so it should not be used for large files.
+The file will be entirely loaded in memory on the user's browser, even if the user does not click on the button.
+For smaller files, this is easier and faster to use than creating a separate SQL file to generate the CSV.
diff --git a/examples/official-site/content/components/datagrid/examples/01-sections.md b/examples/official-site/content/components/datagrid/examples/01-sections.md
new file mode 100644
index 000000000..48369e46d
--- /dev/null
+++ b/examples/official-site/content/components/datagrid/examples/01-sections.md
@@ -0,0 +1,12 @@
+---
+rows:
+ - component: datagrid
+ - title: Language
+ description: SQL
+ - title: Creation date
+ description: '1974'
+ - title: Language family
+ description: Query language
+---
+
+Just some sections of information.
diff --git a/examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md b/examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md
new file mode 100644
index 000000000..6024d81a8
--- /dev/null
+++ b/examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md
@@ -0,0 +1,24 @@
+---
+rows:
+ - component: datagrid
+ title: Ophir Lojkine
+ image_url: https://avatars.githubusercontent.com/u/552629
+ description_md: Member since **2021**
+ - title: Pseudo
+ description: lovasoa
+ image_url: https://avatars.githubusercontent.com/u/552629
+ - title: Status
+ description: Active
+ color: green
+ - title: Email Status
+ description: Validated
+ icon: check
+ active: true
+ tooltip: Email address has been validated.
+ - title: Personal page
+ description: ophir.dev
+ link: https://ophir.dev/
+ tooltip: About me
+---
+
+A beautiful data grid with nice colors and icons.
diff --git a/examples/official-site/content/components/datagrid/examples/03-picture.md b/examples/official-site/content/components/datagrid/examples/03-picture.md
new file mode 100644
index 000000000..26d049fa1
--- /dev/null
+++ b/examples/official-site/content/components/datagrid/examples/03-picture.md
@@ -0,0 +1,20 @@
+---
+rows:
+ - component: datagrid
+ title: Website Ideas
+ icon: bulb
+ - title: Search engine
+ link: https://google.com
+ description: Google
+ color: red
+ icon: brand-google
+ footer: Owned by Alphabet Inc.
+ - title: Encyclopedia
+ link: https://wikipedia.org
+ description: Wikipedia
+ color: blue
+ icon: world
+ footer: Owned by the Wikimedia Foundation
+---
+
+Using a picture in the data grid card header.
diff --git a/examples/official-site/content/components/debug/examples/01-component-data.md b/examples/official-site/content/components/debug/examples/01-component-data.md
new file mode 100644
index 000000000..98ece7b12
--- /dev/null
+++ b/examples/official-site/content/components/debug/examples/01-component-data.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: debug
+ my_top_level_property: true
+ - x: y
+ z: 42
+ - a: b
+ c: null
+---
+
+At any time, if you are confused about what data you are passing to a component, just replace the component name with 'debug' to see all the parameters that are passed to it.
diff --git a/examples/official-site/content/components/debug/examples/02-function-result.md b/examples/official-site/content/components/debug/examples/02-function-result.md
new file mode 100644
index 000000000..c8f6a57bc
--- /dev/null
+++ b/examples/official-site/content/components/debug/examples/02-function-result.md
@@ -0,0 +1,5 @@
+Show the result of a SQLPage function:
+
+```sql
+select 'debug' as component, sqlpage.environment_variable('HOME');
+```
diff --git a/examples/official-site/content/components/divider/examples/01-empty.md b/examples/official-site/content/components/divider/examples/01-empty.md
new file mode 100644
index 000000000..c21749819
--- /dev/null
+++ b/examples/official-site/content/components/divider/examples/01-empty.md
@@ -0,0 +1,6 @@
+---
+rows:
+ - component: divider
+---
+
+An empty divider
diff --git a/examples/official-site/content/components/divider/examples/02-centered.md b/examples/official-site/content/components/divider/examples/02-centered.md
new file mode 100644
index 000000000..382c17827
--- /dev/null
+++ b/examples/official-site/content/components/divider/examples/02-centered.md
@@ -0,0 +1,7 @@
+---
+rows:
+ - component: divider
+ contents: Hello
+---
+
+A divider with centered text
diff --git a/examples/official-site/content/components/divider/examples/03-left.md b/examples/official-site/content/components/divider/examples/03-left.md
new file mode 100644
index 000000000..3ffd03b54
--- /dev/null
+++ b/examples/official-site/content/components/divider/examples/03-left.md
@@ -0,0 +1,8 @@
+---
+rows:
+ - component: divider
+ contents: Hello
+ position: left
+---
+
+A divider with text at left
diff --git a/examples/official-site/content/components/divider/examples/04-colored-link.md b/examples/official-site/content/components/divider/examples/04-colored-link.md
new file mode 100644
index 000000000..7e47ed5f8
--- /dev/null
+++ b/examples/official-site/content/components/divider/examples/04-colored-link.md
@@ -0,0 +1,9 @@
+---
+rows:
+ - component: divider
+ contents: SQLPage components
+ link: /documentation.sql
+ color: blue
+---
+
+A divider with blue text and a link
diff --git a/examples/official-site/content/components/divider/examples/05-text-formatting.md b/examples/official-site/content/components/divider/examples/05-text-formatting.md
new file mode 100644
index 000000000..09176aa3d
--- /dev/null
+++ b/examples/official-site/content/components/divider/examples/05-text-formatting.md
@@ -0,0 +1,13 @@
+---
+rows:
+ - component: divider
+ contents: Important notice
+ position: left
+ color: red
+ size: 5
+ bold: true
+ italics: true
+ underline: true
+---
+
+A divider with bold, italic, and underlined text
diff --git a/examples/official-site/content/components/download/examples/01-plain-text.md b/examples/official-site/content/components/download/examples/01-plain-text.md
new file mode 100644
index 000000000..295457da5
--- /dev/null
+++ b/examples/official-site/content/components/download/examples/01-plain-text.md
@@ -0,0 +1,9 @@
+## Simple plain text file
+Download a small text file. The content is URL-encoded (spaces become %20).
+
+```sql
+select
+ 'download' as component,
+ 'data:text/plain,Hello%20SQLPage%20world!' as data_url,
+ 'hello.txt' as filename;
+```
diff --git a/examples/official-site/content/components/download/examples/02-pdf.md b/examples/official-site/content/components/download/examples/02-pdf.md
new file mode 100644
index 000000000..522795d46
--- /dev/null
+++ b/examples/official-site/content/components/download/examples/02-pdf.md
@@ -0,0 +1,11 @@
+## Download a PDF file from the server
+
+Download a PDF file with the proper content type so PDF readers recognize it.
+Uses [`sqlpage.read_file_as_data_url(file_path)`](/functions?function=read_file_as_data_url) to read the file from the server.
+
+```sql
+select
+ 'download' as component,
+ 'report.pdf' as filename,
+ sqlpage.read_file_as_data_url('report.pdf') as data_url;
+```
diff --git a/examples/official-site/content/components/download/examples/03-image-blob.md b/examples/official-site/content/components/download/examples/03-image-blob.md
new file mode 100644
index 000000000..60aebdd87
--- /dev/null
+++ b/examples/official-site/content/components/download/examples/03-image-blob.md
@@ -0,0 +1,32 @@
+## Serve an image stored as a BLOB in the database
+
+### Automatically detect the mime type
+
+If you have a table with a column `content` that contains a BLOB
+(depending on the database, the type may be named `BYTEA`, `BLOB`, `VARBINARY`, or `IMAGE`),
+you can just return its contents directly, and SQLPage will automatically detect the mime type,
+and convert it to a data URL.
+
+```sql
+select
+ 'download' as component,
+ content as data_url
+from document
+where id = $doc_id;
+```
+
+### Customize the mime type
+
+In PostgreSQL, you can use the [encode(bytes, format)](https://www.postgresql.org/docs/current/functions-binarystring.html#FUNCTION-ENCODE) function to encode the file content as Base64,
+and manually create your own data URL.
+
+```sql
+select
+ 'download' as component,
+ 'data:' || doc.mime_type || ';base64,' || encode(doc.content::bytea, 'base64') as data_url
+from document as doc
+where doc.id = $doc_id;
+```
+
+ - In Microsoft SQL Server, you can use the [BASE64_ENCODE(bytes)](https://learn.microsoft.com/en-us/sql/t-sql/functions/base64-encode-transact-sql) function to encode the file content as Base64.
+ - In MySQL and MariaDB, you can use the [TO_BASE64(str)](https://mariadb.com/docs/server/reference/sql-functions/string-functions/to_base64) function.
diff --git a/examples/official-site/content/components/dynamic/examples/01-component-rows.md b/examples/official-site/content/components/dynamic/examples/01-component-rows.md
new file mode 100644
index 000000000..422acb34a
--- /dev/null
+++ b/examples/official-site/content/components/dynamic/examples/01-component-rows.md
@@ -0,0 +1,8 @@
+---
+rows:
+ - component: dynamic
+ properties: '[{"component":"text"}, {"contents":"Hello, I am a dynamic component !", "italics":true}]'
+---
+
+The dynamic component has a single top-level property named `properties`, but it can render any number of other components.
+Let's start with something simple to illustrate the logic. We'll render a `text` component with two row-level properties: `contents` and `italics`.
diff --git a/examples/official-site/content/components/dynamic/examples/02-json-file.md b/examples/official-site/content/components/dynamic/examples/02-json-file.md
new file mode 100644
index 000000000..93ed89c7e
--- /dev/null
+++ b/examples/official-site/content/components/dynamic/examples/02-json-file.md
@@ -0,0 +1,32 @@
+## Static component data stored in `.json` files
+
+You can also store the data for a component in a `.json` file, and load it using the `dynamic` component.
+
+This is particularly useful to create a single [shell](?component=shell#component) defining the site's overall appearance and menus,
+and displaying it on all pages without duplicating its code.
+
+The following will load the data for a `shell` component from a file named `shell.json`,
+using the [`sqlpage.read_file_as_text`](/functions.sql?function=read_file_as_text) function.
+
+```sql
+SELECT 'dynamic' AS component, sqlpage.read_file_as_text('shell.json') AS properties;
+```
+
+and `shell.json` would be placed at the website's root and contain the following:
+
+```json
+{
+ "component": "shell",
+ "title": "SQLPage documentation",
+ "link": "/",
+ "menu_item": [
+ {"link": "index.sql", "title": "Home"},
+ {"title": "Community", "submenu": [
+ {"link": "blog.sql", "title": "Blog"},
+ {"link": "https//github.com/sqlpage/SQLPage/issues", "title": "Issues"},
+ {"link": "https//github.com/sqlpage/SQLPage/discussions", "title": "Discussions"},
+ {"link": "https//github.com/sqlpage/SQLPage", "title": "Github"}
+ ]}
+ ]
+}
+```
diff --git a/examples/official-site/content/components/dynamic/examples/03-include-sql.md b/examples/official-site/content/components/dynamic/examples/03-include-sql.md
new file mode 100644
index 000000000..52ed2af27
--- /dev/null
+++ b/examples/official-site/content/components/dynamic/examples/03-include-sql.md
@@ -0,0 +1,22 @@
+## Including another SQL file
+
+To avoid repeating the same code on multiple pages, you can include another SQL file using the `dynamic` component
+together with the [`sqlpage.run_sql`](/functions.sql?function=run_sql) function.
+
+For instance, the following will include the file `shell.sql` at the top of the page,
+and pass it a `$title` variable to display the page title.
+
+```sql
+SELECT 'dynamic' AS component,
+ sqlpage.run_sql('shell.sql', json_object('title', 'SQLPage documentation')) AS properties;
+```
+
+And `shell.sql` could contain the following:
+
+```sql
+SELECT 'shell' AS component,
+ COALESCE($title, 'Default title') AS title,
+ '/my_icon.png' AS icon,
+ 'products' AS menu_item,
+ 'about' AS menu_item;
+```
diff --git a/examples/official-site/content/components/dynamic/examples/04-shared-shell.md b/examples/official-site/content/components/dynamic/examples/04-shared-shell.md
new file mode 100644
index 000000000..702a152a4
--- /dev/null
+++ b/examples/official-site/content/components/dynamic/examples/04-shared-shell.md
@@ -0,0 +1,29 @@
+## Dynamic shell
+
+On databases without a native JSON type (such as the default SQLite database),
+you can use the `dynamic` component to generate
+json data to pass to components that expect it.
+
+This example generates a menu similar to the [shell example](?component=shell#component), but without using a native JSON type.
+
+```sql
+SELECT 'dynamic' AS component, '
+{
+ "component": "shell",
+ "title": "SQLPage documentation",
+ "link": "/",
+ "menu_item": [
+ {"link": "index.sql", "title": "Home"},
+ {"title": "Community", "submenu": [
+ {"link": "blog.sql", "title": "Blog"},
+ {"link": "https//github.com/sqlpage/SQLPage/issues", "title": "Issues"},
+ {"link": "https//github.com/sqlpage/SQLPage/discussions", "title": "Discussions"},
+ {"link": "https//github.com/sqlpage/SQLPage", "title": "Github"}
+ ]}
+ ]
+}
+' AS properties
+```
+
+[View the result of this query, as well as an example of how to generate a dynamic menu
+based on the database contents](./examples/dynamic_shell.sql).
diff --git a/examples/official-site/content/components/dynamic/examples/05-tables.md b/examples/official-site/content/components/dynamic/examples/05-tables.md
new file mode 100644
index 000000000..5bdc8c87e
--- /dev/null
+++ b/examples/official-site/content/components/dynamic/examples/05-tables.md
@@ -0,0 +1,18 @@
+## Dynamic tables
+
+The `dynamic` component can be used to generate [tables](?component=table#component) with dynamic columns,
+using [your database's JSON functions](/blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide).
+
+For instance, let's say we have a table with three columns: user_id, name, and role.
+We want to create a table where each row is a user, and each column is a role.
+We will return a set of json objects that look like this: `{"name": "Alice", "admin": true, "editor": false, "viewer": true}`
+```sql
+SELECT 'table' AS component;
+SELECT 'dynamic' AS component,
+ json_patch(
+ json_object('name', name),
+ json_object_agg(role, is_admin)
+ ) AS properties
+FROM users
+GROUP BY name;
+```
diff --git a/examples/official-site/content/components/empty_state/examples/01-not-found.md b/examples/official-site/content/components/empty_state/examples/01-not-found.md
new file mode 100644
index 000000000..f1342e3db
--- /dev/null
+++ b/examples/official-site/content/components/empty_state/examples/01-not-found.md
@@ -0,0 +1,16 @@
+---
+rows:
+ - component: empty_state
+ title: No results found
+ header: '404'
+ description: Try adjusting your search or filter to find what you're looking for.
+ link_text: Search again
+ link_icon: search
+ link: '#not-found'
+ id: not-found
+---
+
+This example shows how to create a 404-style "Not Found" empty state with
+ - a prominent header displaying "404",
+ - a helpful description suggesting to adjust search parameters, and
+ - a "Search again" button with a search icon that links back to the search page.
diff --git a/examples/official-site/content/components/empty_state/examples/02-illustration.md b/examples/official-site/content/components/empty_state/examples/02-illustration.md
new file mode 100644
index 000000000..d5836daf0
--- /dev/null
+++ b/examples/official-site/content/components/empty_state/examples/02-illustration.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: empty_state
+ title: A critical problem has occurred
+ icon: mood-wrrr
+ description_md: |-
+ SQLPage can do a lot of things, but this is not one of them.
+
+ Please restart your browser and **cross your fingers**.
+ link_text: Close and restart
+ link_icon: rotate-clockwise
+ link: '#'
+---
+
+It's possible to use an icon or an image to illustrate the problem.
diff --git a/examples/official-site/content/components/facet/examples/01-category-selector.md b/examples/official-site/content/components/facet/examples/01-category-selector.md
new file mode 100644
index 000000000..21a48b4f4
--- /dev/null
+++ b/examples/official-site/content/components/facet/examples/01-category-selector.md
@@ -0,0 +1,22 @@
+---
+rows:
+ - component: table
+ - name: USS Enterprise (NCC-1701)
+ class: Constitution
+ - name: USS Exeter (NCC-1672)
+ class: Galaxy
+ - name: USS Exeter (NCC-1672)
+ class: Constitution
+ - component: facet
+ description: Classes
+ all_link: ?component=facet
+ all_title: All
+ all_active: false
+ - title: Constitution
+ link: ?component=facet&class=Constitution
+ active: true
+ - title: Galaxy
+ link: ?component=facet&class=Galaxy
+---
+
+A category selector with an All link. In an application, the SQL pattern above uses the chosen URL parameter to filter the displayed data.
diff --git a/examples/official-site/content/components/facet/examples/02-compact-dropdown.md b/examples/official-site/content/components/facet/examples/02-compact-dropdown.md
new file mode 100644
index 000000000..4fb8bc6cf
--- /dev/null
+++ b/examples/official-site/content/components/facet/examples/02-compact-dropdown.md
@@ -0,0 +1,25 @@
+---
+rows:
+ - component: table
+ - name: USS Enterprise (NCC-1701)
+ class: Constitution
+ - name: USS Defiant (NCC-1764)
+ class: Constitution
+ - name: USS Exeter (NCC-1672)
+ class: Constitution
+ - component: facet
+ description: Classes
+ all_link: ?component=facet
+ all_title: All
+ all_active: false
+ compact: true
+ dropdown_title: Select a spaceship class
+ selected_facet: Constitution
+ - title: Constitution
+ link: ?component=facet&class=Constitution
+ active: true
+ - title: Galaxy
+ link: ?component=facet&class=Galaxy
+---
+
+Compact mode displays the facet choices in a dropdown.
diff --git a/examples/official-site/content/components/foldable/examples/01-paragraph.md b/examples/official-site/content/components/foldable/examples/01-paragraph.md
new file mode 100644
index 000000000..00f1b1f67
--- /dev/null
+++ b/examples/official-site/content/components/foldable/examples/01-paragraph.md
@@ -0,0 +1,9 @@
+---
+rows:
+ - component: foldable
+ - title: The foldable component
+ description: This is a simple foldable component. It can be used to show and hide content. It is a list
+ of items, each with a title and a description. The description is displayed when the item is expanded.
+---
+
+A single foldable paragraph of text
diff --git a/examples/official-site/content/components/foldable/examples/02-markdown-list.md b/examples/official-site/content/components/foldable/examples/02-markdown-list.md
new file mode 100644
index 000000000..5203e3b5d
--- /dev/null
+++ b/examples/official-site/content/components/foldable/examples/02-markdown-list.md
@@ -0,0 +1,40 @@
+---
+rows:
+ - component: foldable
+ - title: Quick Prototyping
+ description_md: |-
+ Build a functional web app prototype in minutes using just SQL queries:
+
+ - Rapid development
+ - Ideal for MVPs
+ - Great for internal tools
+
+ Learn more about [quick prototyping](/your-first-sql-website/).
+ expanded: true
+ - title: Data Visualization
+ description_md: |-
+ Quickly transform your database into useful insights:
+
+ 1. **Charts**: Line, bar, pie
+ 2. **KPIs**: Appealing visualizations of key metrics
+ 3. **Maps**: Geospatial data
+
+ As simple as:
+
+ ```sql
+ SELECT 'chart' as component;
+ SELECT date as x, revenue as y FROM sales;
+ ```
+ - title: Don't stare, interact!
+ description_md: |-
+ SQLPage is not just a passive *Business Intelligence* tool. With SQLPage, you can act upon user input:
+
+ - *User input collection*: Building a form is just as easy as building a chart.
+ - *Data validation*: Write your own validation rules in SQL.
+ - *Database updates*: `INSERT` and `UPDATE` are first-class citizens.
+ - *File uploads*: Upload `CSV` and other files, store and display them the way you want.
+
+ > Let users interact with your data, not just look at it!
+---
+
+A SQLPage-themed foldable list with Markdown
diff --git a/examples/official-site/content/components/form/examples/01-submit-to-another-page.md b/examples/official-site/content/components/form/examples/01-submit-to-another-page.md
new file mode 100644
index 000000000..7649a1eda
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/01-submit-to-another-page.md
@@ -0,0 +1,25 @@
+---
+rows:
+ - component: form
+ action: create_user.sql
+ - name: username
+---
+
+The best way to manage forms in SQLPage is to create at least two separate files:
+
+ - one that will contain the form itself, and will be loaded when the user visits the page,
+ - one that will handle the form submission, and will redirect to whatever page you want to display after the form has been submitted.
+
+For instance, if you were creating a form to manage a list of users, you could create:
+
+ - a file named `users.sql` that would contain a list of users and a form to create a new user,
+ - a file named `create_user.sql` that would insert the new user in the database, and then redirect to `users.sql`.
+
+`create_user.sql` could contain the following sql statement to [safely](safety.sql) insert the new user in the database:
+
+```sql
+INSERT INTO users(name) VALUES(:username)
+RETURNING 'redirect' AS component, 'users.sql' AS link
+```
+
+When loading the page, the value for `:username` will be `NULL` if no value has been submitted.
diff --git a/examples/official-site/content/components/form/examples/02-registration.md b/examples/official-site/content/components/form/examples/02-registration.md
new file mode 100644
index 000000000..25abab145
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/02-registration.md
@@ -0,0 +1,29 @@
+---
+rows:
+ - component: form
+ title: User
+ validate: Create new user
+ - name: First name
+ placeholder: John
+ - name: Last name
+ required: true
+ description: We need your last name for legal purposes.
+ - name: Resume
+ type: textarea
+ - name: Birth date
+ type: date
+ max: '2010-01-01'
+ value: '1994-04-16'
+ - name: Password
+ type: password
+ pattern: ^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$
+ required: true
+ description_md: '**Password Requirements:** Minimum **8 characters**, at least **one letter** & **one number**.
+ *Tip:* Use a passphrase for better security!'
+ - label: I accept the terms and conditions
+ name: terms
+ type: checkbox
+ required: true
+---
+
+A user registration form, illustrating the use of required fields, and different input types.
diff --git a/examples/official-site/content/components/form/examples/03-input-prefix-and-suffix.md b/examples/official-site/content/components/form/examples/03-input-prefix-and-suffix.md
new file mode 100644
index 000000000..0c020d82e
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/03-input-prefix-and-suffix.md
@@ -0,0 +1,10 @@
+---
+rows:
+ - component: form
+ - name: Your account
+ prefix_icon: mail
+ prefix: 'Email:'
+ suffix: '@mydomain.com'
+---
+
+Create prepended and appended inputs to make your forms easier to use.
diff --git a/examples/official-site/content/components/form/examples/04-groups.md b/examples/official-site/content/components/form/examples/04-groups.md
new file mode 100644
index 000000000..948d35edc
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/04-groups.md
@@ -0,0 +1,16 @@
+---
+rows:
+ - component: form
+ title: Information about the person
+ - type: header
+ label: Identity
+ - name: Name
+ - name: Surname
+ - type: header
+ label: Contact
+ - name: phone
+ label: Phone number
+ - name: Email
+---
+
+With the header type, you can group your input fields based on a theme. For example, you can categorize fields according to a person's identity and their contact information.
diff --git a/examples/official-site/content/components/form/examples/05-switch.md b/examples/official-site/content/components/form/examples/05-switch.md
new file mode 100644
index 000000000..400e4337e
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/05-switch.md
@@ -0,0 +1,19 @@
+---
+rows:
+ - component: form
+ - type: switch
+ label: Dark theme
+ name: dark
+ description: Enable dark theme
+ - type: switch
+ label: A required toggle switch
+ name: my_checkbox
+ required: true
+ checked: true
+ - type: switch
+ label: A disabled toggle switch
+ name: my_field
+ disabled: true
+---
+
+A toggle switch in an HTML form is a user interface element that allows users to switch between two states, typically "on" and "off." It visually resembles a physical switch and is often used for settings or options that can be enabled or disabled.
diff --git a/examples/official-site/content/components/form/examples/06-select.md b/examples/official-site/content/components/form/examples/06-select.md
new file mode 100644
index 000000000..5979e3118
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/06-select.md
@@ -0,0 +1,32 @@
+---
+rows:
+ - component: form
+ action: examples/show_variables.sql
+ - name: Fruit
+ type: select
+ empty_option: Select a fruit...
+ options: '[{"label": "Orange", "value": 0}, {"label": "Apple", "value": 1}, {"label": "Banana", "value":
+ 3}]'
+---
+
+This example illustrates the use of the `select` type.
+In this select input, the various options are hardcoded, but they could also be loaded from a database table,
+[using a function to convert the rows into a json array](/blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide) like
+ - `json_group_array()` in SQLite,
+ - `json_agg()` in Postgres,
+ - `JSON_ARRAYAGG()` in MySQL, or
+ - `FOR JSON PATH` in Microsoft SQL Server.
+
+
+In SQLite, the query would look like
+```sql
+SELECT
+ 'select' as type,
+ 'Select a fruit...' as empty_option,
+ 'cherry' as prefix_icon,
+ json_group_array(json_object(
+ 'label', name,
+ 'value', id
+ )) as options
+FROM fruits
+```
diff --git a/examples/official-site/content/components/form/examples/07-multi-select.md b/examples/official-site/content/components/form/examples/07-multi-select.md
new file mode 100644
index 000000000..d7e75a4c8
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/07-multi-select.md
@@ -0,0 +1,82 @@
+---
+rows:
+ - component: form
+ action: examples/show_variables.sql
+ reset: Reset
+ - name: component
+ type: select
+ value: form
+ options:
+ - label: Form
+ value: form
+ options_source: examples/from_component_options_source.sql?category=component
+ description: Start typing the name of a component like 'map' or 'form'...
+---
+
+### Multi-select
+You can authorize the user to select multiple options by setting the `multiple` property to `true`.
+This creates a more compact (but arguably less user-friendly) alternative to a series of checkboxes.
+In this case, you should add square brackets to the name of the field (e.g. `'my_field[]' as name`).
+The target page will then receive the value as a JSON array of strings, which you can iterate over using
+ - the `json_each` function [in SQLite](https://www.sqlite.org/json1.html) and [Postgres](https://www.postgresql.org/docs/9.3/functions-json.html),
+ - the [`OPENJSON`](https://learn.microsoft.com/fr-fr/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16) function in Microsoft SQL Server.
+ - in MySQL, json manipulation is less straightforward: see [the SQLPage MySQL json example](https://github.com/sqlpage/SQLPage/tree/main/examples/mysql%20json%20handling)
+
+[More information on how to handle JSON in SQL](/blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide).
+
+The target page could then look like this:
+
+```sql
+insert into best_fruits(id) -- INSERT INTO ... SELECT ... runs the SELECT query and inserts the results into the table
+select CAST(value AS integer) as id -- all values are transmitted by the browser as strings
+from json_each($my_field); -- in SQLite, json_each returns a table with a "value" column for each element in the JSON array
+```
+
+### Example multiselect generated from a database table
+
+If you have a table of all possible options (`my_options(id int, label text)`),
+and want to generate a multi-select field from it, you have two options:
+- if the number of options is not too large, you can use the `options` parameter to return them all as a JSON array in the SQL query
+- if the number of options is large (e.g. more than 1000), you can use `options_source` to load options dynamically from a different SQL query as the user types
+
+#### Embedding all options in the SQL query
+
+Let's say you have a table that contains the selected options per user (`my_user_options(user_id int, option_id int)`).
+You can use a query like this to generate the multi-select field:
+
+```sql
+select 'select' as type, true as multiple, json_group_array(json_object(
+ 'label', my_options.label,
+ 'value', my_options.id,
+ 'selected', my_user_options.option_id is not null
+)) as options
+from my_options
+left join my_user_options
+ on my_options.id = my_user_options.option_id
+ and my_user_options.user_id = $user_id
+```
+
+This will generate a json array of objects, each containing the label, value and selected status of each option.
+
+#### Loading options dynamically from a different SQL query with `options_source`
+
+If the `my_options` table has a large number of rows, you can use the `options_source` parameter to load options dynamically from a different SQL query as the user types.
+
+We'll write a second SQL file, `options_source.sql`, that will receive the user's search string as a parameter named `$search`,
+ and return a json array of objects, each containing the label and value of each option.
+
+When both `options` and `options_source` are set, the local `options` are loaded first. Search results from `options_source` are loaded into the same option list; a result with the same `value` updates the existing option. This is useful to set a default preselected value with `options_source`.
+
+`options_source` may already contain query parameters. SQLPage preserves them and adds or replaces the `search` parameter when loading options.
+
+##### `options_source.sql`
+
+```sql
+select 'json' as component;
+
+select id as value, label as label
+from my_options
+where label like $search || '%';
+```
+
+##### `form`
diff --git a/examples/official-site/content/components/form/examples/08-radio.md b/examples/official-site/content/components/form/examples/08-radio.md
new file mode 100644
index 000000000..be9fe906c
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/08-radio.md
@@ -0,0 +1,41 @@
+---
+rows:
+ - component: form
+ method: GET
+ - name: component
+ type: radio
+ value: form
+ description: Read user input in SQL
+ label: Form
+ - name: component
+ type: radio
+ value: map
+ checked: true
+ description: Display a map based on database data
+ label: Map
+ - name: component
+ type: radio
+ value: chart
+ description: Interactive plots of SQL query results
+ label: Chart
+---
+
+This example illustrates the use of the `radio` type.
+The `name` parameter is used to group the radio buttons together.
+The `value` parameter is used to set the value that will be submitted when the user selects the radio button.
+The `label` parameter is used to display a friendly name for the radio button.
+The `description` parameter is used to display a helper text near the radio button.
+
+We could also save all the options in a database table, and then run a simple query like
+
+```sql
+SELECT 'form' AS component;
+SELECT
+ 'radio' as type,
+ 'db' as name,
+ option_name as label,
+ option_id as value
+FROM my_options;
+```
+
+In this example, depending on what the user clicks, the page will be reloaded with a the variable `$component` set to the string "form", "map", or "chart".
diff --git a/examples/official-site/content/components/form/examples/09-refresh-on-change.md b/examples/official-site/content/components/form/examples/09-refresh-on-change.md
new file mode 100644
index 000000000..0de27b1e9
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/09-refresh-on-change.md
@@ -0,0 +1,24 @@
+---
+rows:
+ - component: form
+ auto_submit: true
+ - name: component
+ type: select
+ autocomplete: false
+ options:
+ - label: Form
+ value: form
+ selected: true
+ - label: Map
+ value: map
+ - label: Chart
+ value: chart
+ description: Choose a component to view its documentation. No need to click a button, the page will be
+ reloaded automatically.
+ label: Component
+---
+
+### Dynamically refresh the page when the user changes the form
+
+The form will be automatically submitted when the user changes any of its fields, and the page will be reloaded with the new value.
+The validation button is removed.
diff --git a/examples/official-site/content/components/form/examples/10-hidden-input.md b/examples/official-site/content/components/form/examples/10-hidden-input.md
new file mode 100644
index 000000000..ba4aced2e
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/10-hidden-input.md
@@ -0,0 +1,22 @@
+---
+rows:
+ - component: form
+ validate: Delete
+ validate_color: red
+ - type: hidden
+ name: resource_id
+ value: '1234'
+ - name: confirm
+ label: Please type "sensitive resource" here to confirm the deletion
+ required: true
+---
+
+When you want to include some information in the form data, but not display it to the user, you can use a hidden field.
+
+This can be used to track simple data such as the current user's id,
+or to implement more complex flows, such as a multi-step form,
+where the user is redirected to a different page after each step.
+
+This can also be used to implement [CSRF protection](https://en.wikipedia.org/wiki/Cross-site_request_forgery#Synchronizer_token_pattern),
+if your website has authenticated users that can perform sensitive actions through simple links.
+But note that SQLPage cookies already have the `SameSite=strict` attribute by default, which protects you against CSRF attacks by default in most cases.
diff --git a/examples/official-site/content/components/form/examples/11-custom-submit.md b/examples/official-site/content/components/form/examples/11-custom-submit.md
new file mode 100644
index 000000000..6bfbd9407
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/11-custom-submit.md
@@ -0,0 +1,38 @@
+---
+rows:
+ - component: form
+ title: User
+ validate: Create new user
+ validate_color: green
+ reset: Clear
+ - name: first_name
+ label: First name
+ placeholder: John
+ width: 4
+ - name: middle_name
+ label: Middle name
+ placeholder: Fitzgerald
+ width: 4
+ - name: last_name
+ label: Last name
+ placeholder: Doe
+ width: 4
+ - name: email
+ label: Email
+ placeholder: john.doe@gmail.com
+ width: 12
+ - name: password
+ label: Password
+ type: password
+ width: 6
+ - name: password_confirmation
+ label: Password confirmation
+ type: password
+ width: 6
+ - name: terms
+ label: I accept the terms and conditions
+ type: checkbox
+ required: true
+---
+
+This example illustrates the use of custom validation buttons and half-width fields.
diff --git a/examples/official-site/content/components/form/examples/12-file-upload.md b/examples/official-site/content/components/form/examples/12-file-upload.md
new file mode 100644
index 000000000..798d51eb5
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/12-file-upload.md
@@ -0,0 +1,31 @@
+---
+rows:
+ - component: form
+ enctype: multipart/form-data
+ title: Upload a picture
+ validate: Upload
+ action: examples/handle_picture_upload.sql
+ - name: my_file
+ type: file
+ accept: image/png, image/jpeg
+ label: Picture
+ description: Upload a small picture
+ required: true
+---
+
+## File upload
+
+You can use the `file` type to allow the user to upload a file.
+
+The file will be uploaded to the server, and you will be able to access it using the
+[`sqlpage.uploaded_file_path`](functions.sql?function=uploaded_file_path#function) function.
+
+Here is how you could save the uploaded file to a table in the database:
+
+```sql
+INSERT INTO uploaded_file(name, data)
+VALUES (
+ :filename,
+ sqlpage.read_file_as_data_url(sqlpage.uploaded_file_path('my_file'))
+)
+```
diff --git a/examples/official-site/content/components/form/examples/13-encoding.md b/examples/official-site/content/components/form/examples/13-encoding.md
new file mode 100644
index 000000000..ff0387ace
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/13-encoding.md
@@ -0,0 +1,42 @@
+---
+rows:
+ - component: form
+ method: post
+ enctype: multipart/form-data
+ title: Submit with different encoding types
+ validate: Submit with form encoding type
+ action: examples/handle_enctype.sql
+ - name: data
+ type: text
+ label: Data
+ required: true
+ - name: percent_encoded
+ type: submit
+ label: Submit as
+ width: 4
+ formaction: examples/handle_enctype.sql
+ formenctype: application/x-www-form-urlencoded
+ value: application/x-www-form-urlencoded
+ - name: multipart_form_data
+ type: submit
+ label: Submit as
+ width: 4
+ formaction: examples/handle_enctype.sql
+ formenctype: multipart/form-data
+ value: multipart/form-data
+---
+
+## Form Encoding
+
+You can specify the way form data should be encoded by setting the `enctype`
+top-level property on the form.
+
+You may also specify `formenctype` on `submit` and `image` type inputs.
+This will take precedence over the `enctype` specified on the form and is
+useful in the case there are multiple `submit` buttons on the form.
+For example, an external site may have specific requirements on encoding type.
+
+As a rule of thumb, ``multipart/form-data`` is best when fields may contain
+copious non-ascii characters or for binary data such as an image or a file.
+However, ``application/x-www-form-urlencoded`` creates less overhead when
+many short ascii text values are submitted.
diff --git a/examples/official-site/content/components/form/examples/14-bulk-insert.md b/examples/official-site/content/components/form/examples/14-bulk-insert.md
new file mode 100644
index 000000000..f4f81a02f
--- /dev/null
+++ b/examples/official-site/content/components/form/examples/14-bulk-insert.md
@@ -0,0 +1,61 @@
+---
+rows:
+ - component: form
+ title: CSV import
+ validate: Load data
+ action: examples/handle_csv_upload.sql
+ - name: product_data_input
+ type: file
+ accept: text/csv
+ label: Products
+ description: Upload a CSV with a name, description, and price columns
+ required: true
+---
+
+## Bulk data insertion
+
+You can use the `file` type to allow the user to upload a [CSV](https://en.wikipedia.org/wiki/Comma-separated_values)
+file containing data to insert in a table.
+
+SQLPage can load data from a CSV file and insert it into a database table.
+SQLPage re-uses PostgreSQL's [`COPY` syntax](https://www.postgresql.org/docs/current/sql-copy.html)
+to specify the format of the CSV file, but makes it work with all supported databases.
+
+> When connected to a PostgreSQL database, SQLPage will use the native `COPY` statement,
+> for super fast and efficient on-database CSV parsing.
+> But it will also work transparently with other databases, by
+> parsing the CSV locally and emulating the same behavior with simple `INSERT` statements.
+
+Here is how you could easily copy data from a CSV to a table in the database:
+
+```sql
+copy product(name, description) from 'product_data_input'
+with (header true, delimiter ',', quote '"');
+```
+
+If you want to pre-process the data before inserting it into the final table,
+you can use a temporary table to store the data, and then insert it into the final table:
+
+```sql
+-- temporarily store the data in a table with text columns
+create temporary table if not exists product_tmp(name text, description text, price text);
+delete from product_tmp;
+
+-- copy the data from the CSV file into the temporary table
+copy product_tmp(name, description, price) from 'product_data_input';
+
+-- insert the data into the final table, converting the price column to an integer
+insert into product(name, description, price)
+select name, description, CAST(price AS integer) from product_tmp
+where price is not null and description is not null and length(description) > 10;
+```
+
+This will load the processed CSV into the product table, provided it has the following structure:
+
+```csv
+name,description,price
+"SQLPage","A tool to create websites using SQL",0
+"PostgreSQL","A powerful open-source relational database",0
+"SQLite","A lightweight relational database",0
+"MySQL","A popular open-source relational database",0
+```
diff --git a/examples/official-site/content/components/hero/examples/01-basic.md b/examples/official-site/content/components/hero/examples/01-basic.md
new file mode 100644
index 000000000..2860656e0
--- /dev/null
+++ b/examples/official-site/content/components/hero/examples/01-basic.md
@@ -0,0 +1,8 @@
+---
+rows:
+ - component: hero
+ title: Welcome
+ description: This is a very simple site built with SQLPage.
+---
+
+The simplest possible hero section
diff --git a/examples/official-site/content/components/hero/examples/02-background-image.md b/examples/official-site/content/components/hero/examples/02-background-image.md
new file mode 100644
index 000000000..03ed29373
--- /dev/null
+++ b/examples/official-site/content/components/hero/examples/02-background-image.md
@@ -0,0 +1,26 @@
+---
+rows:
+ - component: hero
+ title: SQLPage
+ description_md: Documentation for the *SQLPage* low-code web application framework.
+ image: https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Lac_de_Zoug.jpg/1280px-Lac_de_Zoug.jpg
+ link: /documentation.sql
+ link_text: Read Documentation !
+ - title: Fast
+ description: Pages load instantly, even on slow mobile networks.
+ icon: car
+ color: red
+ link: /
+ - title: Beautiful
+ description: Uses pre-defined components that look professional.
+ icon: eye
+ color: green
+ link: /
+ - title: Easy
+ description_md: You can teach yourself enough SQL to use [**SQLPage**](https://sql-page.com) in a weekend.
+ icon: sofa
+ color: blue
+ link: /
+---
+
+A hero with a background image.
diff --git a/examples/official-site/content/components/hero/examples/03-video.md b/examples/official-site/content/components/hero/examples/03-video.md
new file mode 100644
index 000000000..ba7083034
--- /dev/null
+++ b/examples/official-site/content/components/hero/examples/03-video.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: hero
+ title: Databases
+ reverse: true
+ description_md: '# “The goal is to turn data into information, and information into insight.”'
+ poster: https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Lac_de_Zoug.jpg/1280px-Lac_de_Zoug.jpg
+ video: /sqlpage_introduction_video.mp4
+---
+
+A hero with a video
diff --git a/examples/official-site/content/components/html/examples/01-html-snippet.md b/examples/official-site/content/components/html/examples/01-html-snippet.md
new file mode 100644
index 000000000..23e4d1be9
--- /dev/null
+++ b/examples/official-site/content/components/html/examples/01-html-snippet.md
@@ -0,0 +1,7 @@
+---
+rows:
+ - component: html
+ html:
This text is safe because it is hardcoded!
+---
+
+Include a simple HTML snippet. In this example, the HTML code is hardcoded in the SQL query, so it is safe. You should never include data that may be manipulated by a user in the HTML content.
diff --git a/examples/official-site/content/components/html/examples/02-multiple-snippets.md b/examples/official-site/content/components/html/examples/02-multiple-snippets.md
new file mode 100644
index 000000000..665dadb70
--- /dev/null
+++ b/examples/official-site/content/components/html/examples/02-multiple-snippets.md
@@ -0,0 +1,12 @@
+---
+rows:
+ - component: html
+ html: '
'
+ - html: '
20%
'
+ - html: '
80%
'
+ - html:
+---
+
+Include multiple html snippets as row-level parameters. Again, be careful what you include in the HTML content. If the data comes from a user, it can be manipulated to include malicious code.
diff --git a/examples/official-site/content/components/html/examples/03-sanitized-text.md b/examples/official-site/content/components/html/examples/03-sanitized-text.md
new file mode 100644
index 000000000..5fb5f835d
--- /dev/null
+++ b/examples/official-site/content/components/html/examples/03-sanitized-text.md
@@ -0,0 +1,9 @@
+---
+rows:
+ - component: html
+ - html: '
The following will be sanitized: '
+ text:
+ post_html: . Phew! That was close!
+---
+
+In order to include user-generated content that should be sanitized, use the `text` property instead of `html`. The `text` property will display the text as-is, without interpreting any HTML tags.
diff --git a/examples/official-site/content/components/http_header/examples/01-cache-control.md b/examples/official-site/content/components/http_header/examples/01-cache-control.md
new file mode 100644
index 000000000..4c10e8f04
--- /dev/null
+++ b/examples/official-site/content/components/http_header/examples/01-cache-control.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: http_header
+ Cache-Control: public, max-age=600, stale-while-revalidate=3600, stale-if-error=86400
+---
+
+Set cache control directives for caching behavior. In this example, the response can be cached by the browser
+ and served from the cache for up to 600 seconds (10 minutes) after it is first requested.
+ During that time, even if the cached response becomes stale (outdated), the browser can still use it (stale-while-revalidate)
+ for up to 3600 seconds (1 hour) while it retrieves a fresh copy from the server in the background.
+ If there is an error while trying to retrieve a fresh copy from the server,
+ the browser can continue to serve the stale response for up to 86400 seconds (24 hours) (stale-if-error) instead of showing an error page.
+ This caching behavior helps improve the performance and responsiveness of the website by reducing the number of requests made to the server
+ and allowing the browser to serve content from its cache when appropriate.
diff --git a/examples/official-site/content/components/http_header/examples/02-redirect.md b/examples/official-site/content/components/http_header/examples/02-redirect.md
new file mode 100644
index 000000000..cb0d1db78
--- /dev/null
+++ b/examples/official-site/content/components/http_header/examples/02-redirect.md
@@ -0,0 +1,8 @@
+---
+rows:
+ - component: http_header
+ Location: /another-page.sql
+---
+
+Redirect the user to another page. In this example, the user is redirected to a file named another-page.sql at the root of the website. The current page will not be displayed at all.
+ This is useful in particular for content creation pages that contain only INSERT statements, because you can redirect the user to the page that lists the content after it has been created.
diff --git a/examples/official-site/content/components/http_header/examples/03-custom-header.md b/examples/official-site/content/components/http_header/examples/03-custom-header.md
new file mode 100644
index 000000000..2b746e83f
--- /dev/null
+++ b/examples/official-site/content/components/http_header/examples/03-custom-header.md
@@ -0,0 +1,7 @@
+---
+rows:
+ - component: http_header
+ X-My-Header: my value
+---
+
+Set a custom non-standard header for the response. In this example, the response will include a custom header named X-My-Header with the value "my value".
diff --git a/examples/official-site/content/components/json/examples/01-array.md b/examples/official-site/content/components/json/examples/01-array.md
new file mode 100644
index 000000000..8510c9305
--- /dev/null
+++ b/examples/official-site/content/components/json/examples/01-array.md
@@ -0,0 +1,30 @@
+## Send query results as a single JSON array: `'array' as type`
+
+The default `array` mode sends the query results as a single JSON array.
+
+If a query returns an error, the array will contain an object with an `error` property.
+
+If multiple queries are executed, all query results will be concatenated into a single array
+of heterogeneous objects.
+
+### SQL
+
+```sql
+select 'json' AS component;
+select * from users;
+```
+
+### Result
+
+```json
+[
+ {"username":"James","userid":1},
+ {"username":"John","userid":2}
+]
+```
+
+Clients can also receive JSON or JSON Lines automatically by requesting the same SQL file with an HTTP `Accept` header such as `application/json` or `application/x-ndjson` when the component is omitted, for example:
+
+```
+curl -H "Accept: application/json" http://localhost:8080/users.sql
+```
diff --git a/examples/official-site/content/components/json/examples/02-jsonlines.md b/examples/official-site/content/components/json/examples/02-jsonlines.md
new file mode 100644
index 000000000..f8e60e649
--- /dev/null
+++ b/examples/official-site/content/components/json/examples/02-jsonlines.md
@@ -0,0 +1,30 @@
+## Send a single JSON object: `'jsonlines' as type`
+
+In `jsonlines` mode, each query result is rendered as a JSON object in a separate line,
+without a top-level array.
+
+If there is a single query result, the response will be a valid JSON object.
+If there are multiple query results, you will need to parse each line of the response as a separate JSON object.
+
+If a query returns an error, the response will be a JSON object with an `error` property.
+
+### SQL
+
+The following SQL creates an API endpoint that takes a `user_id` URL parameter
+and returns a single JSON object containing the user's details, with one json object key per column in the `users` table.
+
+```sql
+select 'json' AS component, 'jsonlines' AS type;
+select * from users where id = $user_id LIMIT 1;
+```
+
+> Note the `LIMIT 1` clause. The `jsonlines` type will send one JSON object per result row,
+> separated only by a single newline character (\n).
+> So if your query returns multiple rows, the result will not be a single valid JSON object,
+> like most JSON parsers expect.
+
+### Result
+
+```json
+{ "username":"James", "userid":1 }
+```
diff --git a/examples/official-site/content/components/json/examples/03-custom-response.md b/examples/official-site/content/components/json/examples/03-custom-response.md
new file mode 100644
index 000000000..53ef56fbf
--- /dev/null
+++ b/examples/official-site/content/components/json/examples/03-custom-response.md
@@ -0,0 +1,42 @@
+## Create a complex API endpoint: the `'contents'` property
+
+You can create an API endpoint that will return a JSON value in any format you want,
+to implement a complex API.
+
+You should use [the json functions provided by your database](/blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide) to form the value you pass to the `contents` property.
+To build a json array out of rows from the database, you can use:
+ - `json_group_array()` in SQLite,
+ - `json_agg()` in Postgres, or
+ - `JSON_ARRAYAGG()` in MySQL.
+ - `FOR JSON PATH` in SQL Server.
+
+
+```sql
+SELECT 'json' AS component,
+ JSON_OBJECT(
+ 'users', (
+ SELECT JSON_GROUP_ARRAY(
+ JSON_OBJECT(
+ 'username', username,
+ 'userid', id
+ )
+ ) FROM users
+ )
+ ) AS contents;
+```
+
+This will return a JSON response that looks like this:
+
+```json
+{
+ "users" : [
+ { "username":"James", "userid":1 }
+ ]
+}
+```
+
+If you want to handle custom API routes, like `POST /api/users/:id`,
+you can use
+ - the [`404.sql` file](/your-first-sql-website/custom_urls.sql) to handle the request despite the URL not matching any file,
+ - the [`request_method` function](/functions.sql?function=request_method#function) to differentiate between GET and POST requests,
+ - and the [`path` function](/functions.sql?function=path#function) to extract the `:id` parameter from the URL.
diff --git a/examples/official-site/content/components/json/examples/04-server-sent-events.md b/examples/official-site/content/components/json/examples/04-server-sent-events.md
new file mode 100644
index 000000000..d2c4c6a4e
--- /dev/null
+++ b/examples/official-site/content/components/json/examples/04-server-sent-events.md
@@ -0,0 +1,25 @@
+## Access query results in real-time with server-sent events: `'sse' as type`
+
+Using server-sent events, you can stream large query results to the client in real-time,
+row by row.
+
+This allows building sophisticated dynamic web applications that will start processing and displaying
+the first rows of data in the browser while the database server is still processing the end of the query.
+
+### SQL
+
+```sql
+select 'json' AS component, 'sse' AS type;
+select * from users;
+```
+
+### JavaScript
+
+```javascript
+const eventSource = new EventSource("users.sql");
+eventSource.onmessage = function (event) {
+ const user = JSON.parse(event.data);
+ console.log(user.username);
+}
+eventSource.onerror = () => eventSource.close(); // do not reconnect after reading all the data
+```
diff --git a/examples/official-site/content/components/list/examples/01-compact.md b/examples/official-site/content/components/list/examples/01-compact.md
new file mode 100644
index 000000000..53df3fc27
--- /dev/null
+++ b/examples/official-site/content/components/list/examples/01-compact.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: list
+ compact: true
+ title: SQLPage lists are...
+ - title: Beautiful
+ - title: Useful
+ - title: Versatile
+---
+
+A basic compact list
diff --git a/examples/official-site/content/components/list/examples/02-empty.md b/examples/official-site/content/components/list/examples/02-empty.md
new file mode 100644
index 000000000..61c192fdd
--- /dev/null
+++ b/examples/official-site/content/components/list/examples/02-empty.md
@@ -0,0 +1,9 @@
+---
+rows:
+ - component: list
+ empty_title: No items yet
+ empty_description: This list is empty. Click here to create a new item !
+ empty_link: documentation.sql
+---
+
+An empty list with a link to add an item
diff --git a/examples/official-site/content/components/list/examples/03-markdown.md b/examples/official-site/content/components/list/examples/03-markdown.md
new file mode 100644
index 000000000..5de310e98
--- /dev/null
+++ b/examples/official-site/content/components/list/examples/03-markdown.md
@@ -0,0 +1,31 @@
+---
+rows:
+ - component: list
+ wrap: true
+ - title: SQL Websites
+ image_url: /favicon.ico
+ description_md: Write SQL, get a website. SQLPage is a **SQL**-based **site** generator for **PostgreSQL**,
+ **MySQL**, **SQLite** and **SQL Server**.
+ link: /
+ - title: SQL Forms
+ image_url: https://upload.wikimedia.org/wikipedia/commons/b/b6/FileStack_retouched.jpg
+ description_md: Easily collect data **from users to your database** using the *form* component. Handle
+ the data in SQL with `INSERT` or `UPDATE` queries.
+ link: ?component=form
+ - title: SQL Maps
+ image_url: https://upload.wikimedia.org/wikipedia/commons/1/15/Vatican_City_map_EN.png
+ description_md: Show database contents on a map using the *map* component. Works well with *PostGIS* and
+ *SpatiaLite*.
+ link: ?component=map
+ - title: Advanced features
+ icon: settings
+ description_md: '[Authenticate users](?component=authentication), [edit data](?component=form), [generate
+ an API](?component=json), [maintain your database schema](/your-first-sql-website/migrations.sql), and
+ more.'
+---
+
+### A list with rich text descriptions
+
+This example illustrates creating a nice list where each item has a title, a description, an image, and a link to another page.
+
+> Be careful, nested links are not supported. If you use the list's `link` property, then your markdown `description_md` should not contain any link.
diff --git a/examples/official-site/content/components/list/examples/04-full-list.md b/examples/official-site/content/components/list/examples/04-full-list.md
new file mode 100644
index 000000000..cdb65986a
--- /dev/null
+++ b/examples/official-site/content/components/list/examples/04-full-list.md
@@ -0,0 +1,29 @@
+---
+rows:
+ - component: list
+ title: Top SQLPage features
+ compact: true
+ - title: Authentication
+ link: ?component=authentication
+ description: Authenticate users with a login form or HTTP basic authentication
+ color: red
+ icon: lock
+ active: true
+ view_link: ?component=authentication#view
+ - title: Editing data
+ link: ?component=form
+ description: SQLPage makes it easy to UPDATE, INSERT and DELETE data in your database tables
+ color: blue
+ icon: database
+ edit_link: ?component=form#edit
+ delete_link: ?component=form#delete
+ - title: API
+ link: ?component=json
+ description: Generate a REST API from a single SQL query to connect with other applications and services
+ color: green
+ icon: plug-connected
+ edit_link: ?component=json#edit
+ delete_link: ?component=json#delete
+---
+
+A beautiful list with bells and whistles.
diff --git a/examples/official-site/content/components/log/examples/01-message.md b/examples/official-site/content/components/log/examples/01-message.md
new file mode 100644
index 000000000..d09da451c
--- /dev/null
+++ b/examples/official-site/content/components/log/examples/01-message.md
@@ -0,0 +1,39 @@
+### Record a simple message
+
+This writes "Hello, World!" to the server logs.
+
+```sql
+SELECT 'log' as component, 'Hello, World!' as message;
+```
+
+Example output:
+
+```text
+[2025-09-13T22:30:14.722Z INFO sqlpage::log from "x.sql" statement 1] Hello, World!
+```
+
+### Set the importance (level)
+
+Choose how important the message is.
+
+```sql
+SELECT 'log' as component, 'error' as level, 'This is an error message' as message;
+```
+
+Example output:
+
+```text
+[2025-09-13T22:30:14.722Z ERROR sqlpage::log from "x.sql" statement 2] This is an error message
+```
+
+### Log dynamic information
+
+Include variables like a username.
+
+```sql
+set username = 'user'
+
+select 'log' as component,
+ '403 - failed for ' || coalesce($username, 'None') as message,
+ 'error' as level;
+```
diff --git a/examples/official-site/content/components/login/examples/01-options.md b/examples/official-site/content/components/login/examples/01-options.md
new file mode 100644
index 000000000..e5711698a
--- /dev/null
+++ b/examples/official-site/content/components/login/examples/01-options.md
@@ -0,0 +1,25 @@
+---
+rows:
+ - component: login
+ action: /examples/show_variables
+ image: ../assets/icon.webp
+ title: Please login to your account
+ username: Username
+ password: Password
+ autofocus: false
+ username_icon: user
+ password_icon: lock
+ forgot_password_text: Forgot your password?
+ forgot_password_link: reset_password.sql
+ remember_me_text: Remember me
+ footer_md: Don't have an account? [Register here](register.sql)
+ validate: Sign in
+---
+
+Using the main options of the login component
+
+When the user clicks the "Sign in" button, the form is submitted to the `/examples/show_variables.sql` page.
+There, you will have access to the variables:
+ - `:username`: the username entered by the user
+ - `:password`: the password entered by the user
+ - `:remember`: the string "on" if the checkbox was checked, or NULL if it was not checked
diff --git a/examples/official-site/content/components/login/examples/02-basic.md b/examples/official-site/content/components/login/examples/02-basic.md
new file mode 100644
index 000000000..8fddbf420
--- /dev/null
+++ b/examples/official-site/content/components/login/examples/02-basic.md
@@ -0,0 +1,9 @@
+---
+rows:
+ - component: login
+ username: Username
+ password: Password
+ autofocus: false
+---
+
+Basic login form
diff --git a/examples/official-site/content/components/map/examples/01-marker.md b/examples/official-site/content/components/map/examples/01-marker.md
new file mode 100644
index 000000000..638f78a30
--- /dev/null
+++ b/examples/official-site/content/components/map/examples/01-marker.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: map
+ - title: New Delhi
+ latitude: 28.6139
+ longitude: 77.209
+---
+
+### Adding a marker to a map
+
+Showing how to place a marker on a map. Useful for basic location displays like showing a single office location, event venue, or point of interest. The marker shows basic hover and click interactions.
diff --git a/examples/official-site/content/components/map/examples/02-geojson-and-tiles.md b/examples/official-site/content/components/map/examples/02-geojson-and-tiles.md
new file mode 100644
index 000000000..37c985320
--- /dev/null
+++ b/examples/official-site/content/components/map/examples/02-geojson-and-tiles.md
@@ -0,0 +1,27 @@
+---
+rows:
+ - component: map
+ zoom: 5
+ max_zoom: 8
+ height: 600
+ latitude: -25
+ longitude: 28
+ tile_source: https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png
+ attribution: ''
+ - icon: peace
+ size: 20
+ link: https://en.wikipedia.org/wiki/Nelson_Mandela
+ geojson: '{"type":"Feature", "properties": { "title":"Mvezo, Birth Place of Nelson Mandela" }, "geometry":
+ { "type":"Point", "coordinates": [28.49, -31.96] }}'
+---
+
+### Advanced map customization using GeoJSON and custom map tiles
+
+This example demonstrates using topographic map tiles, custom marker styling,
+and clickable markers that link to external content - perfect for educational or tourism applications.
+
+It uses [GeoJSON](https://en.wikipedia.org/wiki/GeoJSON) to display polygons and lines.
+
+ - You can generate GeoJSON data from PostGIS geometries using the [`ST_AsGeoJSON`](https://postgis.net/docs/ST_AsGeoJSON.html) function.
+ - In spatialite, you can use the [`AsGeoJSON`](https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.1.0.html#p3misc) function.
+ - In MySQL, you can use the [`ST_AsGeoJSON()`](https://dev.mysql.com/doc/refman/8.0/en/spatial-geojson-functions.html#function_st-asgeojson) function.
diff --git a/examples/official-site/content/components/map/examples/03-rich-links.md b/examples/official-site/content/components/map/examples/03-rich-links.md
new file mode 100644
index 000000000..f7e7e1a50
--- /dev/null
+++ b/examples/official-site/content/components/map/examples/03-rich-links.md
@@ -0,0 +1,40 @@
+---
+rows:
+ - component: map
+ title: Paris
+ zoom: 13
+ latitude: 48.85
+ longitude: 2.34
+ tile_source: https://api.maptiler.com/maps/streets-v2/{z}/{x}/{y}.png?key=RwoF6Y3gcKx4OBMbvqOY
+ - title: Notre Dame
+ icon: building-castle
+ color: indigo
+ latitude: 48.853
+ longitude: 2.3498
+ description_md: A beautiful cathedral.
+ link: https://en.wikipedia.org/wiki/Notre-Dame_de_Paris
+ - title: Eiffel Tower
+ icon: tower
+ color: red
+ latitude: 48.8584
+ longitude: 2.2945
+ description_md: A tall tower. [Wikipedia](https://en.wikipedia.org/wiki/Eiffel_Tower)
+ - title: Tower to Cathedral
+ geojson:
+ type: LineString
+ coordinates:
+ - - 2.2945
+ - 48.8584
+ - - 2.3498
+ - 48.853
+ color: teal
+ description: A nice 45 minutes walk.
+---
+
+### Maps with links and rich descriptions
+
+Demonstrates how to create an engaging map with custom icons, colors, rich descriptions with markdown support, and connecting points with lines.
+Perfect for visualizing multi-dimensional relationships between points on a map, like routes between locations.
+
+Note that the map tile source is set to a MapTiler map. The API key included in the URL in this demo will not work on your own website.
+You should get your own API key at [MapTiler](https://www.maptiler.com/cloud/).
diff --git a/examples/official-site/content/components/map/examples/04-geometric-visualizations.md b/examples/official-site/content/components/map/examples/04-geometric-visualizations.md
new file mode 100644
index 000000000..b19f39b10
--- /dev/null
+++ b/examples/official-site/content/components/map/examples/04-geometric-visualizations.md
@@ -0,0 +1,41 @@
+---
+rows:
+ - component: map
+ tile_source: false
+ - title: MySQL
+ color: red
+ description: This literal red square is defined as a GeoJSON polygon. Each (x,y) coordinate is a JSON array.
+ geojson:
+ type: Polygon
+ coordinates:
+ - - - 0
+ - 0
+ - - 0
+ - 4
+ - - 4
+ - 4
+ - - 4
+ - 0
+ - - 0
+ - 0
+ - title: SQLite
+ color: blue
+ description: This 2D shape was generated by a SQL query.
+ geojson:
+ type: Polygon
+ coordinates:
+ - - - 5
+ - 0
+ - - 9
+ - 0
+ - - 7
+ - 4
+ - - 5
+ - 0
+---
+
+### Abstract geometric visualizations
+
+Example showing how to create abstract geometric visualizations without a base map.
+Useful for displaying spatial data that doesn't need geographic context, like floor plans, seating charts,
+or abstract 2D data visualizations.
diff --git a/examples/official-site/content/components/modal/examples/01-text.md b/examples/official-site/content/components/modal/examples/01-text.md
new file mode 100644
index 000000000..ef4092e6c
--- /dev/null
+++ b/examples/official-site/content/components/modal/examples/01-text.md
@@ -0,0 +1,13 @@
+---
+rows:
+ - component: modal
+ id: my_modal
+ title: A modal box
+ close: Close
+ - contents: I'm a modal window, and I allow you to display additional information or help for the user.
+ - component: button
+ - title: Open a simple modal
+ link: '#my_modal'
+---
+
+This example shows how to create a modal box that displays a paragraph of text. The modal window is opened with the help of a button.
diff --git a/examples/official-site/content/components/modal/examples/02-form.md b/examples/official-site/content/components/modal/examples/02-form.md
new file mode 100644
index 000000000..318c060c7
--- /dev/null
+++ b/examples/official-site/content/components/modal/examples/02-form.md
@@ -0,0 +1,13 @@
+---
+rows:
+ - component: modal
+ id: my_embed_form_modal
+ title: Embeded form content
+ large: true
+ embed: /examples/form.sql?_sqlpage_embed
+ - component: button
+ - title: Open a modal with a form
+ link: '#my_embed_form_modal'
+---
+
+Example of modal form content
diff --git a/examples/official-site/content/components/modal/examples/03-chart.md b/examples/official-site/content/components/modal/examples/03-chart.md
new file mode 100644
index 000000000..2185f46f1
--- /dev/null
+++ b/examples/official-site/content/components/modal/examples/03-chart.md
@@ -0,0 +1,19 @@
+---
+rows:
+ - component: modal
+ id: my_embed_chart_modal
+ title: Embeded chart content
+ close: Close
+ embed: /examples/chart.sql?_sqlpage_embed
+ - component: datagrid
+ - title: Chart
+ color: blue
+ description: Revenue
+ link: '#my_embed_chart_modal'
+ - title: Form
+ color: green
+ description: Fill info
+ link: '#my_embed_form_modal'
+---
+
+A popup modal that contains a chart generated by a separate SQL file. The modal is triggered by links inside a datagrid.
diff --git a/examples/official-site/content/components/modal/examples/04-video.md b/examples/official-site/content/components/modal/examples/04-video.md
new file mode 100644
index 000000000..c73372895
--- /dev/null
+++ b/examples/official-site/content/components/modal/examples/04-video.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: modal
+ id: my_embed_video_modal
+ title: Embeded video content
+ close: Close
+ embed: https://www.youtube.com/embed/mXdgmSdaXkg
+ allow: accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share
+ embed_mode: iframe
+ height: '350'
+ - component: text
+ contents_md: Open a [modal with a video](#my_embed_video_modal)
+---
+
+Example of modal video content
diff --git a/examples/official-site/content/components/pagination/examples/01-page-numbers.md b/examples/official-site/content/components/pagination/examples/01-page-numbers.md
new file mode 100644
index 000000000..aed328b9a
--- /dev/null
+++ b/examples/official-site/content/components/pagination/examples/01-page-numbers.md
@@ -0,0 +1,13 @@
+---
+rows:
+ - component: pagination
+ - contents: 1
+ link: ?component=pagination&page=1
+ active: true
+ - contents: 2
+ link: ?component=pagination&page=2
+ - contents: 3
+ link: ?component=pagination&page=3
+---
+
+This is an extremely simple example of a pagination component that displays only the page numbers, with the first page being the current page.
diff --git a/examples/official-site/content/components/pagination/examples/02-outline.md b/examples/official-site/content/components/pagination/examples/02-outline.md
new file mode 100644
index 000000000..dd10f95f0
--- /dev/null
+++ b/examples/official-site/content/components/pagination/examples/02-outline.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: pagination
+ outline: true
+ - contents: 1
+ link: ?component=pagination&page=1
+ active: true
+ - contents: 2
+ link: ?component=pagination&page=2
+ - contents: 3
+ link: ?component=pagination&page=3
+---
+
+The ouline style adds a rectangular border to each navigation link.
diff --git a/examples/official-site/content/components/pagination/examples/03-circle.md b/examples/official-site/content/components/pagination/examples/03-circle.md
new file mode 100644
index 000000000..832f214b0
--- /dev/null
+++ b/examples/official-site/content/components/pagination/examples/03-circle.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: pagination
+ circle: true
+ - contents: 1
+ link: ?component=pagination&page=1
+ active: true
+ - contents: 2
+ link: ?component=pagination&page=2
+ - contents: 3
+ link: ?component=pagination&page=3
+---
+
+The circle style adds a circular border to each navigation link.
diff --git a/examples/official-site/content/components/pagination/examples/04-disabled-links.md b/examples/official-site/content/components/pagination/examples/04-disabled-links.md
new file mode 100644
index 000000000..1b2237f66
--- /dev/null
+++ b/examples/official-site/content/components/pagination/examples/04-disabled-links.md
@@ -0,0 +1,19 @@
+---
+rows:
+ - component: pagination
+ first_link: ?component=pagination
+ first_disabled: true
+ previous_link: ?component=pagination
+ previous_disabled: true
+ next_link: '#?page=2'
+ last_link: '#?page=3'
+ - contents: 1
+ link: ?component=pagination&page=1
+ active: true
+ - contents: 2
+ link: ?component=pagination&page=2
+ - contents: 3
+ link: ?component=pagination&page=3
+---
+
+The following example implements navigation links that can be enabled or disabled as needed. Since a navigation link does not appear if no link is assigned to it, you must always assign a link to display it as disabled.
diff --git a/examples/official-site/content/components/pagination/examples/05-text-links.md b/examples/official-site/content/components/pagination/examples/05-text-links.md
new file mode 100644
index 000000000..fd77de6ae
--- /dev/null
+++ b/examples/official-site/content/components/pagination/examples/05-text-links.md
@@ -0,0 +1,23 @@
+---
+rows:
+ - component: pagination
+ first_title: First
+ last_title: Last
+ previous_title: Previous
+ next_title: Next
+ first_link: ?component=pagination
+ first_disabled: true
+ previous_link: ?component=pagination
+ previous_disabled: true
+ next_link: '#?page=2'
+ last_link: '#?page=3'
+ - contents: 1
+ link: ?component=pagination&page=1
+ active: true
+ - contents: 2
+ link: ?component=pagination&page=2
+ - contents: 3
+ link: ?component=pagination&page=3
+---
+
+Instead of using icons, you can apply text to the navigation links.
diff --git a/examples/official-site/content/components/pagination/examples/06-offset.md b/examples/official-site/content/components/pagination/examples/06-offset.md
new file mode 100644
index 000000000..cbb6e3d82
--- /dev/null
+++ b/examples/official-site/content/components/pagination/examples/06-offset.md
@@ -0,0 +1,26 @@
+---
+rows:
+ - component: pagination
+ first_link: '#?page=1'
+ previous_link: '#?page=3'
+ next_link: '#?page=4'
+ last_link: '#?page=99'
+ - contents: 1
+ link: ?component=pagination&page=1
+ - contents: 2
+ link: ?component=pagination&page=2
+ - contents: 3
+ link: ?component=pagination&page=3
+ - contents: 4
+ link: ?component=pagination&page=4
+ active: true
+ - contents: 5
+ link: ?component=pagination&page=5
+ - contents: 6
+ link: ?component=pagination&page=6
+ - offset: true
+ - contents: 99
+ link: ?component=pagination&page=99
+---
+
+If you have a large number of pages to display, you can use an offset to represent a group of pages.
diff --git a/examples/official-site/content/components/redirect/examples/01-require-login.md b/examples/official-site/content/components/redirect/examples/01-require-login.md
new file mode 100644
index 000000000..70a84f3ea
--- /dev/null
+++ b/examples/official-site/content/components/redirect/examples/01-require-login.md
@@ -0,0 +1,6 @@
+Redirect a user to the login page if they are not logged in:
+
+```sql
+SELECT 'redirect' AS component, 'login.sql' AS link
+WHERE NOT EXISTS (SELECT 1 FROM login_session WHERE id = sqlpage.cookie('session_id'));
+```
diff --git a/examples/official-site/content/components/rss/examples/01-news-channel.md b/examples/official-site/content/components/rss/examples/01-news-channel.md
new file mode 100644
index 000000000..0e0c8d291
--- /dev/null
+++ b/examples/official-site/content/components/rss/examples/01-news-channel.md
@@ -0,0 +1,31 @@
+### An RSS channel about SQLPage latest news.
+
+```sql
+select 'http_header' as component, 'application/rss+xml' as content_type;
+select 'shell-empty' as component;
+select
+ 'rss' as component,
+ 'SQLPage blog' as title,
+ 'https://sql-page.com/blog.sql' as link,
+ 'latest news about SQLpage' as description,
+ 'en' as language,
+ 'Technology' as category,
+ FALSE as explicit,
+ 'https://sql-page.com/favicon.ico' as image_url,
+ 'Ophir Lojkine' as author,
+ 'https://github.com/sponsors/lovasoa' as funding_url,
+ 'episodic' as type;
+select
+ 'Hello everyone !' as title,
+ 'https://sql-page.com/blog.sql?post=Come%20see%20me%20build%20twitter%20live%20on%20stage%20in%20Prague' as link,
+ 'If some of you european SQLPagers are around Prague this december, I will be giving a talk about SQLPage at pgconf.eu on December 14th.' as description,
+ 'http://127.0.0.1:8080/sqlpage_introduction_video.mp4' as enclosure_url,
+ 123456789 as enclosure_length,
+ 'video/mp4' as enclosure_type,
+ '2023-12-04' as date;
+```
+
+Once you have your rss feed ready, you can submit it to podcast directories like
+[Apple Podcasts](https://podcastsconnect.apple.com/my-podcasts),
+[Spotify](https://podcasters.spotify.com/),
+[Google Podcasts](https://podcastsmanager.google.com/)...
diff --git a/examples/official-site/content/components/shell/examples/01-dark-navigation.md b/examples/official-site/content/components/shell/examples/01-dark-navigation.md
new file mode 100644
index 000000000..baf8f93fb
--- /dev/null
+++ b/examples/official-site/content/components/shell/examples/01-dark-navigation.md
@@ -0,0 +1,99 @@
+---
+rows:
+ - component: shell
+ title: 'SQLPage: SQL websites'
+ navbar_title: SQLPage
+ link: /
+ menu_item:
+ - title: About
+ submenu:
+ - link: /safety.sql
+ title: Security
+ icon: lock
+ - link: /performance.sql
+ title: Performance
+ icon: bolt
+ - link: //github.com/sqlpage/SQLPage/blob/main/LICENSE.txt
+ title: License
+ icon: file-text
+ - link: /blog.sql
+ title: Articles
+ icon: book
+ - title: Examples
+ submenu:
+ - link: /examples/tabs/
+ title: Tabs
+ icon: layout-navbar
+ - link: /examples/layouts.sql
+ title: Layouts
+ icon: layout
+ - link: /examples/multistep-form
+ title: Forms
+ icon: edit
+ - link: /examples/handle_picture_upload.sql
+ title: File uploads
+ icon: upload
+ - link: /examples/authentication/
+ title: Password protection
+ icon: password-user
+ - link: //github.com/sqlpage/SQLPage/blob/main/examples/
+ title: All examples & demos
+ icon: code
+ - title: Community
+ submenu:
+ - link: /blog.sql
+ title: Blog
+ icon: book
+ - link: //github.com/sqlpage/SQLPage/issues
+ title: Report a bug
+ icon: bug
+ - link: //github.com/sqlpage/SQLPage/discussions
+ title: Discussions
+ icon: message
+ - link: //github.com/sqlpage/SQLPage
+ title: Github
+ icon: brand-github
+ - title: Documentation
+ submenu:
+ - link: /your-first-sql-website
+ title: Getting started
+ icon: book
+ - link: /components.sql
+ title: All Components
+ icon: list-details
+ - link: /functions.sql
+ title: SQLPage Functions
+ icon: math-function
+ - link: /extensions-to-sql
+ title: Extensions to SQL
+ icon: cube-plus
+ - link: /custom_components.sql
+ title: Custom Components
+ icon: puzzle
+ - link: https://sql-page.com/configuration
+ title: Configuration
+ icon: settings
+ - title: Search
+ link: /search
+ layout: boxed
+ language: en-US
+ description: Go from SQL queries to web applications in an instant.
+ preview_image: https://sql-page.com/sqlpage_social_preview.webp
+ theme: dark
+ font_size: 19
+ image: /assets/icon.webp
+ favicon: /favicon.ico
+ javascript_module: /assets/highlightjs-launch.js
+ css: /assets/highlightjs-and-tabler-theme.css
+ footer: '[Built with SQLPage](https://github.com/sqlpage/SQLPage/tree/main/examples/official-site)'
+---
+
+This example configures a dark shell with menus linking to pages on this site.
+
+Each `menu_item` object defines a link or a dropdown. The "Community" menu links to the blog, issue tracker, discussions, and source code.
+
+The object form can be used directly only on database engines that have a native JSON type.
+On other engines (such as SQLite), you can use the [`dynamic`](?component=dynamic#component) component to generate the same result.
+
+
+You see the [page layouts demo](./examples/layouts.sql) for a live example of the different layouts.
diff --git a/examples/official-site/content/components/shell/examples/02-active-menu.md b/examples/official-site/content/components/shell/examples/02-active-menu.md
new file mode 100644
index 000000000..9da9f86b7
--- /dev/null
+++ b/examples/official-site/content/components/shell/examples/02-active-menu.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: shell
+ title: 'SQLPage: SQL websites'
+ icon: database
+ link: /
+ menu_item:
+ - title: Home
+ active: true
+ - title: About
+---
+
+This example shows how to set menu items as active in the navigation, so that they are highlighted in the nav bar.
+
+In this example you can see that two menu items are created, "Home" and "About" and the "Home" tab is marked as active.
diff --git a/examples/official-site/content/components/shell/examples/03-shared-shell.md b/examples/official-site/content/components/shell/examples/03-shared-shell.md
new file mode 100644
index 000000000..a7a3b1358
--- /dev/null
+++ b/examples/official-site/content/components/shell/examples/03-shared-shell.md
@@ -0,0 +1,107 @@
+### Sharing the shell between multiple pages
+
+It is common to want to share the same shell between multiple pages.
+
+#### Static menu
+
+If your menu is completely static (it does not depend on the database content),
+you can use the [`dynamic`](?component=dynamic#component) component together with the
+[`sqlpage.read_file_as_text`](functions.sql?function=read_file_as_text#function) function to load the shell from
+a json file.
+
+```sql
+SELECT 'dynamic' AS component, sqlpage.read_file_as_text('shell.json') AS properties;
+```
+
+and in `shell.json`:
+
+```json
+{
+ "component": "shell",
+ "title": "SQL + JSON = <3",
+ "link": "/",
+ "menu_item": [
+ {"link": "index.sql", "title": "Home"},
+ {"title": "Community", "submenu": [
+ {"link": "/blog.sql", "title": "Blog"},
+ {"link": "//github.com/sqlpage/SQLPage", "title": "Github"}
+ ]}
+ ]
+}
+```
+
+#### Dynamic menu
+
+If your menu depends on the database content, or on special `sqlpage` functions,
+you can use the `dynamic` component,
+but this time with the [`sqlpage.run_sql`](functions.sql?function=run_sql#function)
+function to generate the menu from the database.
+
+```sql
+SELECT 'dynamic' AS component, sqlpage.run_sql('shell.sql') AS properties;
+```
+
+and in `shell.sql`:
+
+```sql
+SELECT 'shell' AS component, 'run_sql is cool' as title,
+ json_group_array(json_object(
+ 'link', link,
+ 'title', title
+ )) as menu_item
+FROM my_menu_items
+```
+
+(check your database documentation for the exact syntax of the `json_group_array` function).
+
+Another case when dynamic menus are useful is when you want to show some
+menu items only in certain conditions.
+
+For instance, you could show an "Admin panel" menu item only to users with the "admin" role,
+a "Profile" menu item only to authenticated users,
+and a "Login" menu item only to unauthenticated users:
+
+```sql
+set role = (
+ SELECT role FROM users
+ INNER JOIN sessions ON users.id = sessions.user_id
+ WHERE sessions.session_id = sqlpage.cookie('session_id')
+); -- Read more about how to handle user sessions in the "authentication" component documentation
+
+SELECT
+ 'shell' AS component,
+ 'My authenticated website' AS title,
+
+ -- Add an admin panel link if the user is an admin
+ CASE WHEN $role = 'admin' THEN '{"link": "admin.sql", "title": "Admin panel"}' END AS menu_item,
+
+ -- Add a profile page if the user is authenticated
+ CASE WHEN $role IS NOT NULL THEN '{"link": "profile.sql", "title": "My profile"}' END AS menu_item,
+
+ -- Add a login link if the user is not authenticated
+ CASE WHEN $role IS NULL THEN 'login' END AS menu_item
+;
+```
+
+More about how to handle user sessions in the [authentication component documentation](?component=authentication#component).
+
+### Menu with icons
+
+The "icon" attribute may be specified for items in the top menu and submenus to display an icon
+before the title (or instead). Similarly, the "image" attribute defines a file-based icon. For
+image-based icons, the "size" attribute may be specified at the top level of menu_item only to
+reduce the size of image-based icons. The following snippet provides an example, which is also
+available [here](examples/menu_icon.sql).
+
+```sql
+SELECT
+ 'shell' AS component,
+ 'SQLPage' AS title,
+ 'database' AS icon,
+ '/' AS link,
+ TRUE AS fixed_top_menu,
+ '{"title":"About","icon": "settings","submenu":[{"link":"/safety.sql","title":"Security","icon": "logout"},{"link":"/performance.sql","title":"Performance"}]}' AS menu_item,
+ '{"title":"Examples","image": "https://upload.wikimedia.org/wikipedia/en/6/6b/Terrestrial_globe.svg","submenu":[{"link":"/examples/tabs/","title":"Tabs","image": "https://upload.wikimedia.org/wikipedia/en/6/6b/Terrestrial_globe.svg"},{"link":"/examples/layouts.sql","title":"Layouts"}]}' AS menu_item,
+ '{"title":"Examples","size":"sm","image": "https://upload.wikimedia.org/wikipedia/en/6/6b/Terrestrial_globe.svg","submenu":[{"link":"/examples/tabs/","title":"Tabs","image": "https://upload.wikimedia.org/wikipedia/en/6/6b/Terrestrial_globe.svg"},{"link":"/examples/layouts.sql","title":"Layouts"}]}' AS menu_item,
+ 'Official [SQLPage](https://sql-page.com) documentation' as footer;
+```
diff --git a/examples/official-site/content/components/shell/examples/04-custom-response.md b/examples/official-site/content/components/shell/examples/04-custom-response.md
new file mode 100644
index 000000000..2027c4c16
--- /dev/null
+++ b/examples/official-site/content/components/shell/examples/04-custom-response.md
@@ -0,0 +1,27 @@
+---
+rows:
+ - component: http_header
+ Content-Type: application/xml
+ - component: shell-empty
+ contents: |-
+
+
+ 42
+ john.doe
+
+---
+
+### Returning custom HTML, XML, plain text, or other formats
+
+Use `shell-empty` to opt out of SQLPage's component system and return raw data directly.
+
+By default, SQLPage wraps all your content in a complete HTML page with navigation and styling.
+The `shell-empty` component tells SQLPage to skip this HTML wrapper and return only the raw content you specify.
+
+Use it to create endpoints that return things like
+ - XML (for JSON, use the [json](?component=json) component)
+ - plain text or markdown content (for instance for consumption by LLMs)
+ - a custom data format you need
+
+When using `shell-empty`, you should use the [http_header](component.sql?component=http%5Fheader) component first
+to set the correct [content type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) (like `application/json` or `application/xml`).
diff --git a/examples/official-site/content/components/shell/examples/05-custom-html.md b/examples/official-site/content/components/shell/examples/05-custom-html.md
new file mode 100644
index 000000000..0ade399d2
--- /dev/null
+++ b/examples/official-site/content/components/shell/examples/05-custom-html.md
@@ -0,0 +1,24 @@
+---
+rows:
+ - component: shell-empty
+ html: |-
+
+
+
+ My page
+
+
+
My page
+
+
+---
+
+### Generate your own HTML
+If you generate your own HTML from a SQL query, you can also use the `shell-empty` component to include it in a page.
+This is useful when you want to generate a snippet of HTML that can be dynamically included in a larger page.
+Make sure you know what you are doing, and be careful to escape the HTML properly,
+as you are stepping out of the safe SQLPage framework and into the wild world of HTML.
+
+In this scenario, you can use the `html` property, which serves as an alias for the `contents` property.
+This property improves code readability by clearly indicating that you are generating HTML.
+Since SQLPage returns HTML by default, there is no need to specify the content type in the HTTP header.
diff --git a/examples/official-site/content/components/status_bar/examples/01-query-workspace.md b/examples/official-site/content/components/status_bar/examples/01-query-workspace.md
new file mode 100644
index 000000000..c414aa8e7
--- /dev/null
+++ b/examples/official-site/content/components/status_bar/examples/01-query-workspace.md
@@ -0,0 +1,16 @@
+---
+rows:
+ - component: status_bar
+ label: Query status
+ fixed: false
+ - title: Connected
+ icon: database
+ color: green
+ tooltip: Connected to the reporting database
+ - title: 24 rows
+ - title: SQL functions
+ icon: book
+ link: /functions.sql
+---
+
+A query workspace shows the database connection, row count, and a link to the function reference. Omit `fixed` to pin this bar to the bottom of the screen.
diff --git a/examples/official-site/content/components/status_code/examples/01-not-found.md b/examples/official-site/content/components/status_code/examples/01-not-found.md
new file mode 100644
index 000000000..81fae347e
--- /dev/null
+++ b/examples/official-site/content/components/status_code/examples/01-not-found.md
@@ -0,0 +1,6 @@
+Set the HTTP status code to 404, indicating that the requested resource was not found.
+Useful in combination with [`404.sql` files](/your-first-sql-website/custom_urls.sql):
+
+```sql
+SELECT 'status_code' as component, 404 as status;
+```
diff --git a/examples/official-site/content/components/steps/examples/01-checkout.md b/examples/official-site/content/components/steps/examples/01-checkout.md
new file mode 100644
index 000000000..454d71979
--- /dev/null
+++ b/examples/official-site/content/components/steps/examples/01-checkout.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: steps
+ - title: Shopping
+ - title: Store pickup
+ - title: Payment
+ active: true
+ - title: Review & Order
+---
+
+Online store checkout steps.
diff --git a/examples/official-site/content/components/steps/examples/02-progress-indicator.md b/examples/official-site/content/components/steps/examples/02-progress-indicator.md
new file mode 100644
index 000000000..e448c2a2c
--- /dev/null
+++ b/examples/official-site/content/components/steps/examples/02-progress-indicator.md
@@ -0,0 +1,27 @@
+---
+rows:
+ - component: steps
+ counter: true
+ color: purple
+ - title: Registration form
+ icon: forms
+ link: https://github.com/sqlpage/SQLPage
+ description: Initial account data creation.
+ - title: Email confirmation
+ icon: mail
+ link: https://sql-page.com
+ description: Confirm your email by clicking on a link in a validation email.
+ - title: ID verification
+ description: Checking personal information
+ icon: user
+ link: '#'
+ - title: Final account approval
+ description: ophir.dev
+ link: https://ophir.dev/
+ icon: eye-check
+ active: true
+ - title: Account creation
+ icon: check
+---
+
+A progress indicator with custom color, auto-generated step numbers, icons, and description tooltips.
diff --git a/examples/official-site/content/components/tab/examples/01-basic.md b/examples/official-site/content/components/tab/examples/01-basic.md
new file mode 100644
index 000000000..9e9a48615
--- /dev/null
+++ b/examples/official-site/content/components/tab/examples/01-basic.md
@@ -0,0 +1,34 @@
+---
+rows:
+ - component: tab
+ - title: This tab does not exist
+ active: true
+ link: ?component=tab&tab=tab_1
+ - title: I am not a true tab
+ link: ?component=tab&tab=tab_2
+ - title: Do not click here
+ link: ?component=tab&tab=tab_3
+---
+
+This example shows a very basic set of three tabs. The first tab is active. You could use this at the top of a page for easy navigation.
+
+To implement contents that change based on the active tab, use the `tab` parameter in the page query string.
+For example, if the page is `/my-page.sql`, then the first tab will have a link of `/my-page.sql?tab=My+First+tab`.
+
+You could then for instance display contents coming from the database based on the value of the `tab` parameter.
+For instance: `SELECT 'text' AS component, contents_md FROM my_page_contents WHERE tab = $tab`.
+Or you could write different queries for different tabs and use the `$tab` parameter with a static value in a where clause to switch between tabs:
+
+```sql
+select 'tab' as component;
+select 'Projects' as title, $tab = 'Projects' as active;
+select 'Tasks' as title, $tab = 'Tasks' as active;
+
+select 'table' as component;
+
+select * from my_projects where $tab = 'Projects';
+select * from my_tasks where $tab = 'Tasks';
+```
+
+Note that the example below is completely static, and does not use the `tab` parameter to actually switch between tabs.
+View the [dynamic tabs example](/examples/tabs/).
diff --git a/examples/official-site/content/components/tab/examples/02-centered-icons.md b/examples/official-site/content/components/tab/examples/02-centered-icons.md
new file mode 100644
index 000000000..6e3c3b83b
--- /dev/null
+++ b/examples/official-site/content/components/tab/examples/02-centered-icons.md
@@ -0,0 +1,18 @@
+---
+rows:
+ - component: tab
+ center: true
+ - title: Hero
+ link: ?component=hero#component
+ icon: home
+ description: The hero component is a full-width banner with a title and an image.
+ - title: Tab
+ link: ?component=tab#component
+ icon: user
+ color: purple
+ - title: Card
+ link: ?component=card#component
+ icon: credit-card
+---
+
+This example shows a more sophisticated set of tabs. The tabs are centered, the active tab has a different color, and all the tabs have a custom link and icon.
diff --git a/examples/official-site/content/components/table/examples/01-basic.md b/examples/official-site/content/components/table/examples/01-basic.md
new file mode 100644
index 000000000..f510ed56f
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/01-basic.md
@@ -0,0 +1,10 @@
+---
+rows:
+ - component: table
+ - a: 1
+ b: 2
+ - a: 3
+ b: 4
+---
+
+The most basic table.
diff --git a/examples/official-site/content/components/table/examples/02-filtering-and-sorting.md b/examples/official-site/content/components/table/examples/02-filtering-and-sorting.md
new file mode 100644
index 000000000..55ddc3b74
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/02-filtering-and-sorting.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: table
+ sort: true
+ search: true
+ search_placeholder: Filter by name
+ - First Name: Ophir
+ Last Name: Lojkine
+ Pseudonym: lovasoa
+ - First Name: Linus
+ Last Name: Torvalds
+ Pseudonym: torvalds
+---
+
+A table of users with filtering and sorting.
diff --git a/examples/official-site/content/components/table/examples/03-markdown-links.md b/examples/official-site/content/components/table/examples/03-markdown-links.md
new file mode 100644
index 000000000..440668108
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/03-markdown-links.md
@@ -0,0 +1,16 @@
+---
+rows:
+ - component: table
+ markdown: Name
+ icon: icon
+ search: true
+ - icon: table
+ name: '[Table](?component=table)'
+ description: Displays SQL results as a searchable table.
+ _sqlpage_color: red
+ - icon: timeline
+ name: '[Chart](?component=chart)'
+ description: Show graphs based on numeric data.
+---
+
+A table that uses markdown to display links
diff --git a/examples/official-site/content/components/table/examples/04-totals-footer.md b/examples/official-site/content/components/table/examples/04-totals-footer.md
new file mode 100644
index 000000000..21c8f7fc9
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/04-totals-footer.md
@@ -0,0 +1,17 @@
+---
+rows:
+ - component: table
+ sort: true
+ - Person: Rudolph Lingens
+ Height: 190
+ - Person: Jane Doe
+ Height: 150
+ - Person: John Doe
+ Height: 200
+ - _sqlpage_footer: true
+ _sqlpage_color: green
+ Person: Average
+ Height: 180
+---
+
+A sortable table with a colored footer showing the average value of its entries.
diff --git a/examples/official-site/content/components/table/examples/05-sorting.md b/examples/official-site/content/components/table/examples/05-sorting.md
new file mode 100644
index 000000000..655db0105
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/05-sorting.md
@@ -0,0 +1,34 @@
+---
+rows:
+ - component: table
+ sort: true
+ align_right:
+ - Price
+ - Amount in stock
+ align_center:
+ - part_no
+ raw_numbers:
+ - id
+ currency: USD
+ money:
+ - Price
+ - id: 31456
+ part_no: SQL-TABLE-856-G
+ Price: 12
+ Amount in stock: 5
+ - id: 996
+ part_no: SQL-FORMS-86-M
+ Price: 1
+ Amount in stock: 1234
+ - id: 131456
+ part_no: SQL-CARDS-56-K
+ Price: 127
+ Amount in stock: 98
+---
+
+A table with column sorting. Sorting sorts numbers in numeric order, and strings in alphabetical order.
+
+Numbers can be displayed
+ - as raw digits without formatting using the `raw_numbers` property,
+ - as currency using the `money` property to define columns that contain monetary values and `currency` to define the currency,
+ - as numbers with a fixed maximum number of decimal digits using the `number_format_digits` property.
diff --git a/examples/official-site/content/components/table/examples/06-presentation.md b/examples/official-site/content/components/table/examples/06-presentation.md
new file mode 100644
index 000000000..1b9aa5687
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/06-presentation.md
@@ -0,0 +1,29 @@
+---
+rows:
+ - component: table
+ hover: true
+ striped_rows: true
+ description: Some Star Trek Starfleet starships
+ small: true
+ initial_search_value: NCC-
+ - name: USS Enterprise
+ registry: NCC-1701-C
+ class: Ambassador
+ - name: USS Archer
+ registry: NCC-44278
+ class: Archer
+ - name: USS Endeavour
+ registry: NCC-06
+ class: Columbia
+ - name: USS Constellation
+ registry: NCC-1974
+ class: Constellation
+ - name: USS Dakota
+ registry: NCC-63892
+ class: Akira
+ - name: USS Defiant
+ registry: IX-74205
+ class: Defiant
+---
+
+A table with some presentation options
diff --git a/examples/official-site/content/components/table/examples/07-empty.md b/examples/official-site/content/components/table/examples/07-empty.md
new file mode 100644
index 000000000..03e34cdb0
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/07-empty.md
@@ -0,0 +1,7 @@
+---
+rows:
+ - component: table
+ empty_description: Nothing to see here at the moment.
+---
+
+An empty table with a friendly message
diff --git a/examples/official-site/content/components/table/examples/08-frozen-columns.md b/examples/official-site/content/components/table/examples/08-frozen-columns.md
new file mode 100644
index 000000000..1f38590bb
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/08-frozen-columns.md
@@ -0,0 +1,47 @@
+---
+rows:
+ - component: table
+ freeze_columns: true
+ freeze_headers: true
+ - feature: SQL Execution
+ description: Fully compatible with existing databases SQL dialects, executes any SQL query.
+ benefits: Short learning curve, easy to use, interoperable with existing tools.
+ - feature: Data Visualization
+ description: 'Automatic visualizations of query results: graphs, plots, pie charts, heatmaps, etc.'
+ benefits: Quickly analyze data trends, attractive and easy to understand, no external visualization tools
+ or languages to learn.
+ - feature: User Authentication
+ description: Supports user sessions, from basic auth to single sign-on.
+ benefits: Secure, enforces access control policies, and provides a customizable security layer.
+ - feature: APIs
+ description: Allows building JSON REST APIs and integrating with external APIs.
+ benefits: Enables automation and integration with other platforms, facilitates data exchange.
+ - feature: Files
+ description: File uploads, downloads and processing. Supports local filesystem and database storage.
+ benefits: Convenient file management, secure data handling, flexible storage options, integrates with existing
+ systems.
+ - feature: Maps
+ description: Supports GeoJSON and is compatible with GIS data for map visualization.
+ benefits: Geospatial data representation, integrates with geographic information systems.
+ - feature: Custom Components
+ description: Build advanced features using HTML, JavaScript, and CSS.
+ benefits: Tailor-made user experiences, easy to implement custom UI requirements.
+ - feature: Forms
+ description: Insert and update data in databases based on user input.
+ benefits: Simplified data input and management, efficient user interactions with databases.
+ - feature: DB Compatibility
+ description: Works with MySQL, PostgreSQL, SQLite, Microsoft SQL Server and compatible databases.
+ benefits: Broad compatibility with popular database systems, ensures seamless integration.
+ - feature: Security
+ description: 'Built-in protection against common web vulnerabilities: no SQL injection, no XSS.'
+ benefits: Passes audits and security reviews, reduces the risk of data breaches.
+ - feature: Performance
+ description: Designed for performance, with a focus on efficient data processing and minimal overhead.
+ benefits: Quickly processes large datasets, handles high volumes of requests, and minimizes server load.
+ - _sqlpage_footer: true
+ feature: Summary
+ description: Summarizes the features of the product.
+ benefits: Provides a quick overview of the product's features and benefits.
+---
+
+A large table with many rows and columns, with frozen columns on the left and headers on top. This allows users to browse large datasets without loosing track of their position.
diff --git a/examples/official-site/content/components/table/examples/09-dynamic-columns.md b/examples/official-site/content/components/table/examples/09-dynamic-columns.md
new file mode 100644
index 000000000..5e686f67a
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/09-dynamic-columns.md
@@ -0,0 +1,47 @@
+#### Dynamic column names in a table
+
+In all the previous examples, the column names were hardcoded in the SQL query.
+This makes it very easy to quickly visualize the results of a query as a table,
+but it can be limiting if you want to include columns that are not known in advance.
+In situations when the number and names of the columns depend on the data, or on variables,
+you can use the `dynamic` component to generate the table columns dynamically.
+
+For that, you will need to return JSON objects from your SQL query, where the keys are the column names,
+and the values are the cell contents.
+
+Databases [offer utilities to generate JSON objects from query results](/blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide)
+ - In PostgreSQL, you can use the [`json_build_object`](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING)
+function for a fixed number of columns, or [`json_object_agg`](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE) for a dynamic number of columns.
+ - In SQLite, you can use the [`json_object`](https://www.sqlite.org/json1.html) function for a fixed number of columns,
+or the `json_group_object` function for a dynamic number of columns.
+ - In MySQL, you can use the [`JSON_OBJECT`](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-object) function for a fixed number of columns,
+or the [`JSON_OBJECTAGG`](https://dev.mysql.com/doc/refman/8.4/en/aggregate-functions.html#function_json-objectagg) function for a dynamic number of columns.
+ - In Microsoft SQL Server, you can use the [`FOR JSON PATH`](https://docs.microsoft.com/en-us/sql/relational-databases/json/format-query-results-as-json-with-for-json-sql-server?view=sql-server-ver15) clause.
+
+For instance, let's say we have a table with three columns: store, item, and quantity_sold.
+We want to create a pivot table where each row is a store, and each column is an item.
+We will return a set of json objects that look like this: `{"store":"Madrid", "Item1": 42, "Item2": 7, "Item3": 0}`
+
+```sql
+SELECT 'table' AS component;
+with filled_data as (
+ select
+ stores.store, items.item,
+ (select coalesce(sum(quantity_sold), 0) from store_sales where store=stores.store and item=items.item) as quantity
+ from (select distinct store from store_sales) as stores
+ cross join (select distinct item from store_sales) as items
+ order by stores.store, items.item
+)
+SELECT
+ 'dynamic' AS component,
+ JSON_PATCH( -- SQLite-specific, refer to your database documentation for the equivalent JSON functions
+ JSON_OBJECT('store', store),
+ JSON_GROUP_OBJECT(item, quantity)
+ ) AS properties
+FROM
+ filled_data
+GROUP BY
+ store;
+```
+
+This will generate a table with the stores in the first column, and the items in the following columns, with the quantity sold in each store for each item.
diff --git a/examples/official-site/content/components/table/examples/10-action-buttons.md b/examples/official-site/content/components/table/examples/10-action-buttons.md
new file mode 100644
index 000000000..e876665d5
--- /dev/null
+++ b/examples/official-site/content/components/table/examples/10-action-buttons.md
@@ -0,0 +1,88 @@
+---
+rows:
+ - component: table
+ edit_url: /examples/show_variables.sql?action=edit&update_id={id}
+ delete_url: /examples/show_variables.sql?action=delete&delete_id={id}
+ custom_actions:
+ name: history
+ tooltip: View Standard History
+ link: /examples/show_variables.sql?action=history&standard_id={id}
+ icon: history
+ - name: CalStd
+ vendor: PharmaCo
+ Product: P1234
+ lot number: T23523
+ status: Available
+ expires on: '2026-10-13'
+ _sqlpage_id: 32
+ _sqlpage_actions:
+ - name: View PDF
+ tooltip: View Presentation
+ link: https://sql-page.com/pgconf/2024-sqlpage-badass.pdf
+ icon: file-type-pdf
+ - name: Action
+ tooltip: Set In Use
+ link: /examples/show_variables.sql?action=set_in_use&standard_id=32
+ icon: caret-right
+ - name: CalStd
+ vendor: PharmaCo
+ Product: P1234
+ lot number: T2352
+ status: In Use
+ expires on: '2026-10-14'
+ _sqlpage_id: 33
+ _sqlpage_actions:
+ - name: View PDF
+ tooltip: View Presentation
+ link: https://sql-page.com/pgconf/2024-sqlpage-badass.pdf
+ icon: file-type-pdf
+ - name: Action
+ tooltip: Retire Standard
+ link: /examples/show_variables.sql?action=retire&standard_id=33
+ icon: test-pipe-off
+ - name: CalStd
+ vendor: PharmaCo
+ Product: P1234
+ lot number: A123
+ status: Discarded
+ expires on: '2026-09-30'
+ _sqlpage_id: 31
+ _sqlpage_actions:
+ - name: View PDF
+ tooltip: View Presentation
+ link: https://sql-page.com/pgconf/2024-sqlpage-badass.pdf
+ icon: file-type-pdf
+ - name: Action
+---
+
+## Using Action Buttons in a table.
+
+### Preset Actions: `edit_url` & `delete_url`
+Since edit and delete are common actions, the `table` component has dedicated `edit_url` and `delete_url` properties to add buttons for these actions.
+The value of these properties should be a URL, containing the `{id}` placeholder that will be replaced by the value of the `_sqlpage_id` property for that row.
+
+### Column with fixed action buttons
+
+You may want to add custom action buttons to your table rows, for instance to view details, download a file, or perform a custom operation.
+For this, the `table` component has a `custom_actions` top-level property that lets you define a column of buttons, each button defined by a name, an icon, a link, and an optional tooltip.
+
+### Column with variable action buttons
+
+The `table` component also supports the row level `_sqlpage_actions` column in your data table.
+This is helpful if you want a more complex logic, for instance to disable a button on some rows, or to change the link or icon based on the row data.
+
+> WARNING!
+> If the number of array items in `_sqlpage_actions` is not consistent across all rows, the table may not render correctly.
+> You can leave blank spaces by including an object with only the `name` property.
+
+The table has a column of buttons, each button defined by the `custom_actions` column at the table level, and by the `_sqlpage_actions` property at the row level.
+
+### `custom_actions` & `_sqlpage_actions` JSON properties.
+
+Each button is defined by the following properties:
+* `name`: sets the column header and the tooltip if no tooltip is provided,
+* `tooltip`: text to display when hovering over the button,
+* `link`: the URL to navigate to when the button is clicked, possibly containing the `{id}` placeholder that will be replaced by the value of the `_sqlpage_id` property for that row,
+* `icon`: the tabler icon name or image link to display on the button
+
+### Example using all of the above
diff --git a/examples/official-site/content/components/text/examples/01-paragraph.md b/examples/official-site/content/components/text/examples/01-paragraph.md
new file mode 100644
index 000000000..8c26f7bf7
--- /dev/null
+++ b/examples/official-site/content/components/text/examples/01-paragraph.md
@@ -0,0 +1,7 @@
+---
+rows:
+ - component: text
+ contents: Hello, world ! <3
+---
+
+Rendering a simple text paragraph.
diff --git a/examples/official-site/content/components/text/examples/02-markdown.md b/examples/official-site/content/components/text/examples/02-markdown.md
new file mode 100644
index 000000000..e9c3cb708
--- /dev/null
+++ b/examples/official-site/content/components/text/examples/02-markdown.md
@@ -0,0 +1,52 @@
+---
+rows:
+ - component: text
+ article: true
+ contents_md: |+
+
+ # Markdown in SQLPage
+
+ ## Simple formatting
+
+ SQLPage supports only plain text as column values, but markdown allows easily adding **bold**, *italics*, [external links](https://github.com/sqlpage/SQLPage), [links to other pages](/index.sql) and [intra-page links](#my-paragraph).
+
+ ## Lists
+ ### Unordered lists
+ * SQLPage is easy
+ * SQLPage is fun
+ * SQLPage is free
+
+ ### Ordered lists
+ 1. SQLPage is fast
+ 2. SQLPage is safe
+ 3. SQLPage is open-source
+
+ ## Code
+ ```sql
+ SELECT 'list' AS component;
+ SELECT name as title FROM users;
+ ```
+
+ ## Tables
+
+ | SQLPage component | Description | Documentation link |
+ | --- | --- | --- |
+ | text | A paragraph of text. | [Documentation](https://sql-page.com/documentation.sql?component=text) |
+ | list | A list of items. | [Documentation](https://sql-page.com/documentation.sql?component=list) |
+ | steps | A progress indicator. | [Documentation](https://sql-page.com/documentation.sql?component=steps) |
+ | form | A series of input fields. | [Documentation](https://sql-page.com/documentation.sql?component=form) |
+
+ ## Quotes
+ > Fantastic.
+ >
+ > — [HackerNews User](https://news.ycombinator.com/item?id=36194473#36209061) about SQLPage
+
+ ## Images
+ 
+
+ ## Horizontal rules
+ ---
+
+---
+
+Rendering rich text using markdown
diff --git a/examples/official-site/content/components/text/examples/03-rich-text.md b/examples/official-site/content/components/text/examples/03-rich-text.md
new file mode 100644
index 000000000..30fb497fe
--- /dev/null
+++ b/examples/official-site/content/components/text/examples/03-rich-text.md
@@ -0,0 +1,14 @@
+---
+rows:
+ - component: text
+ title: About SQL
+ - contents: SQL
+ bold: true
+ italics: true
+ - contents: ' is a domain-specific language used in programming and designed for managing data held in a '
+ - contents: relational database management system
+ link: https://en.wikipedia.org/wiki/Relational_database
+ - contents: . It is particularly useful in handling structured data.
+---
+
+Rendering a paragraph with links and styling.
diff --git a/examples/official-site/content/components/text/examples/04-section-link.md b/examples/official-site/content/components/text/examples/04-section-link.md
new file mode 100644
index 000000000..968029b74
--- /dev/null
+++ b/examples/official-site/content/components/text/examples/04-section-link.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: text
+ contents_md: This is a link to the [next paragraph](#my-paragraph). You can open this link in a new tab
+ and the page will scroll to the paragraph on load.
+ - component: text
+ id: my-paragraph
+ contents_md: This **is** the next paragraph.
+---
+
+An intra-page link to a section of the page.
diff --git a/examples/official-site/content/components/timeline/examples/01-basic.md b/examples/official-site/content/components/timeline/examples/01-basic.md
new file mode 100644
index 000000000..91d2c899a
--- /dev/null
+++ b/examples/official-site/content/components/timeline/examples/01-basic.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: timeline
+ simple: true
+ - title: New message from Elon Musk
+ date: '13:00'
+ - title: Jeff Bezos assigned task "work more" to you.
+ date: yesterday, 16:35
+---
+
+A basic timeline with just names and dates.
diff --git a/examples/official-site/content/components/timeline/examples/02-rich-items.md b/examples/official-site/content/components/timeline/examples/02-rich-items.md
new file mode 100644
index 000000000..0548505af
--- /dev/null
+++ b/examples/official-site/content/components/timeline/examples/02-rich-items.md
@@ -0,0 +1,18 @@
+---
+rows:
+ - component: timeline
+ - title: v0.13.0 was just released !
+ link: https://github.com/sqlpage/SQLPage/releases/
+ date: '2023-10-16'
+ icon: brand-github
+ color: green
+ description_md: This version introduces the `timeline` component.
+ - title: They are talking about us...
+ description_md: '[This article](https://www.postgresql.org/about/news/announcing-sqlpage-build-dynamic-web-applications-in-sql-2672/)
+ on the official PostgreSQL website mentions SQLPage.'
+ date: '2023-07-12'
+ icon: database
+ color: blue
+---
+
+A full-fledged timeline with icons, colors, and rich text descriptions.
diff --git a/examples/official-site/content/components/title/examples/01-levels.md b/examples/official-site/content/components/title/examples/01-levels.md
new file mode 100644
index 000000000..8161c6827
--- /dev/null
+++ b/examples/official-site/content/components/title/examples/01-levels.md
@@ -0,0 +1,13 @@
+---
+rows:
+ - component: title
+ contents: Level 1
+ - component: title
+ contents: Level 2
+ level: 2
+ - component: title
+ contents: Level 3
+ level: 3
+---
+
+Displays several titles with different levels.
diff --git a/examples/official-site/content/components/title/examples/02-centered.md b/examples/official-site/content/components/title/examples/02-centered.md
new file mode 100644
index 000000000..77497f3d6
--- /dev/null
+++ b/examples/official-site/content/components/title/examples/02-centered.md
@@ -0,0 +1,8 @@
+---
+rows:
+ - component: title
+ contents: Level 1
+ center: true
+---
+
+Displays a centered title.
diff --git a/examples/official-site/content/components/toast/examples/01-automatic.md b/examples/official-site/content/components/toast/examples/01-automatic.md
new file mode 100644
index 000000000..2f8d5a163
--- /dev/null
+++ b/examples/official-site/content/components/toast/examples/01-automatic.md
@@ -0,0 +1,11 @@
+---
+rows:
+ - component: toast
+ id: toast-auto
+ title: This is a SQLPage toast
+ description: This toast will open automatically when the page loads.
+ icon: check
+ color: green
+---
+
+A toast that opens when the page loads and disappears automatically after the default 5000 milliseconds.
diff --git a/examples/official-site/content/components/toast/examples/02-manual-dismissal.md b/examples/official-site/content/components/toast/examples/02-manual-dismissal.md
new file mode 100644
index 000000000..d9ae49a2b
--- /dev/null
+++ b/examples/official-site/content/components/toast/examples/02-manual-dismissal.md
@@ -0,0 +1,27 @@
+---
+rows:
+ - component: toast
+ id: toast-dismissible
+ trigger: persistent-error
+ title: Could not save
+ description: Review the highlighted fields and try again.
+ icon: alert-triangle
+ color: black
+ duration: 0
+ dismissible: true
+ - component: toast
+ id: toast-nondismissible
+ trigger: persistent-status
+ title: Connection unavailable
+ description: This persistent notification has no manual close control.
+ duration: 0
+ dismissible: false
+ - component: button
+ - title: Show dismissible error
+ link: '#persistent-error'
+ color: red
+ - title: Show non-dismissible status
+ link: '#persistent-status'
+---
+
+A persistent error notification that disables automatic dismissal and requires the user to activate its close button.
diff --git a/examples/official-site/content/components/toast/examples/03-markdown.md b/examples/official-site/content/components/toast/examples/03-markdown.md
new file mode 100644
index 000000000..a1853a575
--- /dev/null
+++ b/examples/official-site/content/components/toast/examples/03-markdown.md
@@ -0,0 +1,22 @@
+---
+rows:
+ - component: toast
+ id: toast-markdown
+ trigger: rich-notifications
+ title: Release available
+ description: This fallback stays escaped
+ description_md: Version **2.0** is ready. [Read the notes](https://example.com/releases).
+ color: blue
+ duration: 0
+ - component: toast
+ id: toast-plain
+ trigger: rich-notifications
+ description: Plain text stays escaped
+ color: white
+ duration: 0
+ - component: button
+ - title: Show rich notifications
+ link: '#rich-notifications'
+---
+
+A persistent rich Markdown notification. Markdown takes precedence over plain text and renders emphasis and a link as HTML, while plain-text content remains escaped.
diff --git a/examples/official-site/content/components/toast/examples/04-queue.md b/examples/official-site/content/components/toast/examples/04-queue.md
new file mode 100644
index 000000000..fb766ce5c
--- /dev/null
+++ b/examples/official-site/content/components/toast/examples/04-queue.md
@@ -0,0 +1,26 @@
+---
+rows:
+ - component: toast
+ id: toast-stack-one
+ trigger: queued notifications
+ title: Import started
+ description: Preparing records.
+ duration: 0
+ - component: toast
+ id: toast-stack-two
+ trigger: queued notifications
+ title: Import running
+ description: Processing records.
+ duration: 0
+ - component: toast
+ id: toast-short
+ trigger: queued notifications
+ title: Temporary update
+ description: This message closes shortly.
+ duration: 2000
+ - component: button
+ - title: Show queued notifications
+ link: '#queued notifications'
+---
+
+Several persistent queued notifications. Toasts with the same position share a container and stack instead of overlapping.
diff --git a/examples/official-site/content/components/toast/examples/05-placement.md b/examples/official-site/content/components/toast/examples/05-placement.md
new file mode 100644
index 000000000..9452db113
--- /dev/null
+++ b/examples/official-site/content/components/toast/examples/05-placement.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: toast
+ id: toast-bottom-center
+ trigger: bottom-notification
+ title: Download ready
+ description: Your export is ready.
+ position: bottom-center
+ duration: 0
+ - component: button
+ - title: Show bottom notification
+ link: '#bottom-notification'
+---
+
+A notification placed at the bottom center of the screen instead of the default top end.
diff --git a/examples/official-site/content/components/tracking/examples/01-server-status.md b/examples/official-site/content/components/tracking/examples/01-server-status.md
new file mode 100644
index 000000000..7edc7ddf4
--- /dev/null
+++ b/examples/official-site/content/components/tracking/examples/01-server-status.md
@@ -0,0 +1,15 @@
+---
+rows:
+ - component: tracking
+ title: Servers status
+ - title: No data
+ - title: No data
+ - title: No data
+ - title: No data
+ - title: No data
+ - title: No data
+ - title: No data
+ - title: No data
+---
+
+A basic example of servers tracking component
diff --git a/examples/official-site/content/components/tracking/examples/02-server-status-history.md b/examples/official-site/content/components/tracking/examples/02-server-status-history.md
new file mode 100644
index 000000000..808f7c8b9
--- /dev/null
+++ b/examples/official-site/content/components/tracking/examples/02-server-status-history.md
@@ -0,0 +1,26 @@
+---
+rows:
+ - component: tracking
+ title: Servers status
+ information: 60% are running
+ description_md: Status of all **currently running servers**
+ placement: top
+ width: 4
+ - color: success
+ title: operational
+ - color: success
+ title: operational
+ - color: success
+ title: operational
+ - color: danger
+ title: Downtime
+ - title: No data
+ - color: success
+ title: operational
+ - color: warning
+ title: Big load
+ - color: success
+ title: operational
+---
+
+An example of servers tracking component