Skip to content

Commit 2b42e21

Browse files
committed
Move list, datagrid, and big-number references to Markdown
1 parent f0ed27d commit 2b42e21

16 files changed

Lines changed: 379 additions & 163 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
icon: chart-area
3+
since: 0.28.0
4+
category: display-data
5+
summary: Highlight a metric with a trend or progress indicator.
6+
top:
7+
- class
8+
- name: columns
9+
type: INTEGER
10+
description: The number of columns to display the big numbers in (default is one column per item).
11+
- id
12+
- name: wrap
13+
type: BOOLEAN
14+
description: Wrap long titles and descriptions onto multiple lines. By default, they are truncated with
15+
an ellipsis.
16+
row:
17+
- name: change_percent
18+
type: INTEGER
19+
description: The percentage change in value (e.g., 7 for 7% increase, -8 for 8% decrease).
20+
- class
21+
- name: color
22+
type: COLOR
23+
description: The color of the card background and its main value.
24+
- name: description
25+
type: TEXT
26+
description: A description or additional context for the big number.
27+
- name: dropdown_item
28+
type: JSON
29+
description: A list of JSON objects containing links. e.g. {"label":"This week", "link":"?days=7"}
30+
- id
31+
- name: progress_color
32+
type: TEXT
33+
description: The color of the progress bar (e.g., "primary", "success", "danger").
34+
- name: progress_percent
35+
type: INTEGER
36+
description: The value of the progress (0-100).
37+
- name: title
38+
type: TEXT
39+
description: The title or label for the big number.
40+
- name: title_link
41+
type: TEXT
42+
description: A link for the Big Number title. If set, the entire title becomes clickable.
43+
- name: title_link_new_tab
44+
type: BOOLEAN
45+
description: If true, the title link will open in a new tab/window.
46+
- name: unit
47+
type: TEXT
48+
description: The unit of measurement for the value.
49+
- name: value
50+
type: TEXT
51+
required: true
52+
description: The main value to be displayed prominently.
53+
- name: value_link
54+
type: TEXT
55+
description: A link for the Big Number value. If set, the entire value becomes clickable.
56+
- name: value_link_new_tab
57+
type: BOOLEAN
58+
description: If true, the value link will open in a new tab/window.
59+
---
60+
61+
A component to display key metrics or statistics with optional description, change indicator, and progress bar. Useful in dashboards.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
rows:
3+
- component: big_number
4+
- title: Sales
5+
value: 75
6+
unit: '%'
7+
title_link: '#sales_dashboard'
8+
title_link_new_tab: true
9+
value_link: '#sales_details'
10+
value_link_new_tab: false
11+
description: Conversion rate
12+
change_percent: 9
13+
progress_percent: 75
14+
progress_color: blue
15+
- title: Revenue
16+
value: 4,300
17+
unit: $
18+
description: Year on year
19+
change_percent: -8
20+
---
21+
22+
Big numbers with change indicators and progress bars
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
rows:
3+
- component: big_number
4+
columns: 3
5+
id: colorfull_dashboard
6+
- title: Users
7+
value: 1,234
8+
color: red
9+
title_link: '#users'
10+
title_link_new_tab: false
11+
value_link: '#users_details'
12+
value_link_new_tab: true
13+
- title: Orders
14+
value: 56
15+
color: green
16+
title_link: '#orders'
17+
title_link_new_tab: true
18+
- title: Revenue
19+
value: 9,876
20+
unit: €
21+
color: blue
22+
change_percent: -7
23+
dropdown_item:
24+
- label: This week
25+
link: ?days=7&component=big_number#colorfull_dashboard
26+
- label: This month
27+
link: ?days=30&component=big_number#colorfull_dashboard
28+
- label: This quarter
29+
link: ?days=90&component=big_number#colorfull_dashboard
30+
---
31+
32+
Big numbers with dropdowns and customized layout
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
icon: grid-dots
3+
category: display-data
4+
summary: Lay out labeled values in a compact grid.
5+
top:
6+
- class
7+
- name: description
8+
type: TEXT
9+
description: A short paragraph displayed below the title.
10+
- name: description_md
11+
type: TEXT
12+
description: A short paragraph displayed below the title - formatted using markdown.
13+
- name: icon
14+
type: ICON
15+
description: Name of an icon to display on the left side of the title.
16+
- id
17+
- name: image_url
18+
type: URL
19+
description: URL of an image to display on the left side of the title.
20+
- name: title
21+
type: TEXT
22+
description: Text header at the top of the data grid.
23+
row:
24+
- name: active
25+
type: BOOLEAN
26+
description: Whether this item in the grid is considered "active". Active items are displayed more prominently.
27+
- name: color
28+
type: COLOR
29+
description: If set to a color name, the value will be displayed in a pill of that color.
30+
- name: description
31+
type: TEXT
32+
description: Value to display below the name.
33+
- name: footer
34+
type: TEXT
35+
description: Muted text to display below the value.
36+
- name: icon
37+
type: ICON
38+
description: An icon name (from tabler-icons.io) to display on the left side of the value.
39+
- id
40+
- name: image_url
41+
type: URL
42+
description: URL of a small image (such as an avatar) to display on the left side of the value.
43+
- name: link
44+
type: URL
45+
description: A target URL to which the user should be taken when they click on the value.
46+
- name: title
47+
type: TEXT
48+
required: true
49+
description: Name of the piece of information.
50+
- name: tooltip
51+
type: TEXT
52+
description: A tooltip to display when the user passes their mouse over the value.
53+
---
54+
55+
Display small pieces of information in a clear and readable way. Each item has a name and is associated with a value.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
rows:
3+
- component: datagrid
4+
- title: Language
5+
description: SQL
6+
- title: Creation date
7+
description: '1974'
8+
- title: Language family
9+
description: Query language
10+
---
11+
12+
Just some sections of information.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
rows:
3+
- component: datagrid
4+
title: Ophir Lojkine
5+
image_url: https://avatars.githubusercontent.com/u/552629
6+
description_md: Member since **2021**
7+
- title: Pseudo
8+
description: lovasoa
9+
image_url: https://avatars.githubusercontent.com/u/552629
10+
- title: Status
11+
description: Active
12+
color: green
13+
- title: Email Status
14+
description: Validated
15+
icon: check
16+
active: true
17+
tooltip: Email address has been validated.
18+
- title: Personal page
19+
description: ophir.dev
20+
link: https://ophir.dev/
21+
tooltip: About me
22+
---
23+
24+
A beautiful data grid with nice colors and icons.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
rows:
3+
- component: datagrid
4+
title: Website Ideas
5+
icon: bulb
6+
- title: Search engine
7+
link: https://google.com
8+
description: Google
9+
color: red
10+
icon: brand-google
11+
footer: Owned by Alphabet Inc.
12+
- title: Encyclopedia
13+
link: https://wikipedia.org
14+
description: Wikipedia
15+
color: blue
16+
icon: world
17+
footer: Owned by the Wikimedia Foundation
18+
---
19+
20+
Using a picture in the data grid card header.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
icon: list
3+
category: display-data
4+
summary: Present rows as a vertical list with optional links and icons.
5+
top:
6+
- class
7+
- name: compact
8+
type: BOOLEAN
9+
description: Whether to display the list in a more compact format, allowing more items to be displayed
10+
on the screen.
11+
- name: empty_description
12+
type: TEXT
13+
description: Description to display if the list is empty.
14+
- name: empty_description_md
15+
type: TEXT
16+
description: Description to display if the list is empty, in Markdown format.
17+
- name: empty_link
18+
type: URL
19+
description: URL to which the user should be taken if they click on the empty list.
20+
- name: empty_title
21+
type: TEXT
22+
description: Title text to display if the list is empty.
23+
- id
24+
- name: title
25+
type: TEXT
26+
description: Text header at the top of the list.
27+
- name: wrap
28+
type: BOOLEAN
29+
description: Wrap list items onto multiple lines if they are too long
30+
row:
31+
- name: active
32+
type: BOOLEAN
33+
description: Whether this item in the list is considered "active". Active items are displayed more prominently.
34+
- class
35+
- name: color
36+
type: COLOR
37+
description: The name of a color, to be displayed as a dot near the list item contents.
38+
- name: delete_link
39+
type: URL
40+
description: A page that will be loaded when the user clicks on the delete button for this specific item.
41+
The link will be submitted as a POST request.
42+
- name: description
43+
type: TEXT
44+
description: A description of the list item, displayed as greyed-out text.
45+
- name: description_md
46+
type: TEXT
47+
description: A description of the list item, displayed as greyed-out text, in Markdown format, allowing
48+
you to use rich text formatting, including `**bold**` and `*italic*` text.
49+
- name: edit_link
50+
type: URL
51+
description: A URL to which the user should be taken when they click on the "edit" icon. Does not show
52+
the icon when omitted.
53+
- name: icon
54+
type: ICON
55+
description: Name of an icon to display on the left side of the item.
56+
- id
57+
- name: image_url
58+
type: URL
59+
description: The URL of a small image to display on the left side of the item.
60+
- name: link
61+
type: URL
62+
description: An URL to which the user should be taken when they click on the list item.
63+
- name: title
64+
type: TEXT
65+
required: true
66+
description: Name of the list item, displayed prominently.
67+
- name: view_link
68+
type: URL
69+
description: A URL to which the user should be taken when they click on the "view" icon. Does not show
70+
the icon when omitted.
71+
---
72+
73+
A vertical list of items. Each item can be clickable and link to another page.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
rows:
3+
- component: list
4+
compact: true
5+
title: SQLPage lists are...
6+
- title: Beautiful
7+
- title: Useful
8+
- title: Versatile
9+
---
10+
11+
A basic compact list
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
rows:
3+
- component: list
4+
empty_title: No items yet
5+
empty_description: This list is empty. Click here to create a new item !
6+
empty_link: documentation.sql
7+
---
8+
9+
The empty state appears when the query after `select 'list' as component` returns no rows. `empty_link` makes that state clickable.

0 commit comments

Comments
 (0)