Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions examples/official-site/content/components/big_number.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
icon: chart-area
since: 0.28.0
category: display-data
summary: Highlight a metric with a trend or progress indicator.
top:
- class
- name: columns
type: INTEGER
description: The number of columns to display the big numbers in (default is one column per item).
- id
- name: wrap
type: BOOLEAN
description: Wrap long titles and descriptions onto multiple lines. By default, they are truncated with
an ellipsis.
row:
- name: change_percent
type: INTEGER
description: The percentage change in value (e.g., 7 for 7% increase, -8 for 8% decrease).
- class
- name: color
type: COLOR
description: The color of the card background and its main value.
- name: description
type: TEXT
description: A description or additional context for the big number.
- name: dropdown_item
type: JSON
description: A list of JSON objects containing links. e.g. {"label":"This week", "link":"?days=7"}
- id
- name: progress_color
type: TEXT
description: The color of the progress bar (e.g., "primary", "success", "danger").
- name: progress_percent
type: INTEGER
description: The value of the progress (0-100).
- name: title
type: TEXT
description: The title or label for the big number.
- name: title_link
type: TEXT
description: A link for the Big Number title. If set, the entire title becomes clickable.
- name: title_link_new_tab
type: BOOLEAN
description: If true, the title link will open in a new tab/window.
- name: unit
type: TEXT
description: The unit of measurement for the value.
- name: value
type: TEXT
required: true
description: The main value to be displayed prominently.
- name: value_link
type: TEXT
description: A link for the Big Number value. If set, the entire value becomes clickable.
- name: value_link_new_tab
type: BOOLEAN
description: If true, the value link will open in a new tab/window.
---

A component to display key metrics or statistics with optional description, change indicator, and progress bar. Useful in dashboards.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
55 changes: 55 additions & 0 deletions examples/official-site/content/components/datagrid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
icon: grid-dots
category: display-data
summary: Lay out labeled values in a compact grid.
top:
- class
- name: description
type: TEXT
description: A short paragraph displayed below the title.
- name: description_md
type: TEXT
description: A short paragraph displayed below the title - formatted using markdown.
- name: icon
type: ICON
description: Name of an icon to display on the left side of the title.
- id
- name: image_url
type: URL
description: URL of an image to display on the left side of the title.
- name: title
type: TEXT
description: Text header at the top of the data grid.
row:
- name: active
type: BOOLEAN
description: Whether this item in the grid is considered "active". Active items are displayed more prominently.
- name: color
type: COLOR
description: If set to a color name, the value will be displayed in a pill of that color.
- name: description
type: TEXT
description: Value to display below the name.
- name: footer
type: TEXT
description: Muted text to display below the value.
- name: icon
type: ICON
description: An icon name (from tabler-icons.io) to display on the left side of the value.
- id
- name: image_url
type: URL
description: URL of a small image (such as an avatar) to display on the left side of the value.
- name: link
type: URL
description: A target URL to which the user should be taken when they click on the value.
- name: title
type: TEXT
required: true
description: Name of the piece of information.
- name: tooltip
type: TEXT
description: A tooltip to display when the user passes their mouse over the value.
---

Display small pieces of information in a clear and readable way. Each item has a name and is associated with a value.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
73 changes: 73 additions & 0 deletions examples/official-site/content/components/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
icon: list
category: display-data
summary: Present rows as a vertical list with optional links and icons.
top:
- class
- name: compact
type: BOOLEAN
description: Whether to display the list in a more compact format, allowing more items to be displayed
on the screen.
- name: empty_description
type: TEXT
description: Description to display if the list is empty.
- name: empty_description_md
type: TEXT
description: Description to display if the list is empty, in Markdown format.
- name: empty_link
type: URL
description: URL to which the user should be taken if they click on the empty list.
- name: empty_title
type: TEXT
description: Title text to display if the list is empty.
- id
- name: title
type: TEXT
description: Text header at the top of the list.
- name: wrap
type: BOOLEAN
description: Wrap list items onto multiple lines if they are too long
row:
- name: active
type: BOOLEAN
description: Whether this item in the list is considered "active". Active items are displayed more prominently.
- class
- name: color
type: COLOR
description: The name of a color, to be displayed as a dot near the list item contents.
- name: delete_link
type: URL
description: A page that will be loaded when the user clicks on the delete button for this specific item.
The link will be submitted as a POST request.
- name: description
type: TEXT
description: A description of the list item, displayed as greyed-out text.
- name: description_md
type: TEXT
description: A description of the list item, displayed as greyed-out text, in Markdown format, allowing
you to use rich text formatting, including `**bold**` and `*italic*` text.
- name: edit_link
type: URL
description: A URL to which the user should be taken when they click on the "edit" icon. Does not show
the icon when omitted.
- name: icon
type: ICON
description: Name of an icon to display on the left side of the item.
- id
- name: image_url
type: URL
description: The URL of a small image to display on the left side of the item.
- name: link
type: URL
description: An URL to which the user should be taken when they click on the list item.
- name: title
type: TEXT
required: true
description: Name of the list item, displayed prominently.
- name: view_link
type: URL
description: A URL to which the user should be taken when they click on the "view" icon. Does not show
the icon when omitted.
---

A vertical list of items. Each item can be clickable and link to another page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
rows:
- component: list
compact: true
title: SQLPage lists are...
- title: Beautiful
- title: Useful
- title: Versatile
---

A basic compact list
Original file line number Diff line number Diff line change
@@ -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
---

The empty state appears when the query after `select 'list' as component` returns no rows. `empty_link` makes that state clickable.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Loading
Loading