Skip to content

Commit 71f181b

Browse files
committed
Move navigation and status references to Markdown
1 parent 0b4085c commit 71f181b

17 files changed

Lines changed: 280 additions & 275 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
icon: dots
3+
since: 0.18.0
4+
category: navigation
5+
summary: Link the current page to its parent pages.
6+
top:
7+
- class
8+
- id
9+
row:
10+
- name: active
11+
type: TEXT
12+
description: Whether the link is active or not. Defaults to false.
13+
- name: description
14+
type: TEXT
15+
description: Description of the link. This is displayed when the user hovers over the link.
16+
- name: link
17+
type: TEXT
18+
description: Link to the page to display when the link is clicked. By default, the link refers to the current
19+
page, with a 'link' parameter set to the link's title.
20+
- name: title
21+
type: TEXT
22+
required: true
23+
description: Hyperlink text to display.
24+
---
25+
26+
A secondary navigation aid that helps users understand their location on a website or mobile application.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
rows:
3+
- component: breadcrumb
4+
- title: Home
5+
link: /
6+
- title: Components
7+
link: /documentation.sql
8+
- title: Breadcrumb
9+
link: ?component=breadcrumb
10+
---
11+
12+
Basic usage of the breadcrumb component
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
rows:
3+
- component: breadcrumb
4+
- title: Home
5+
link: /
6+
active: true
7+
- title: Articles
8+
link: /blog.sql
9+
description: Stay informed with the latest news
10+
- title: JSON in SQL
11+
link: /blog.sql?post=JSON%20in%20SQL%3A%20A%20Comprehensive%20Guide
12+
description: Learn advanced json functions for MySQL, SQLite, PostgreSQL, and SQL Server
13+
---
14+
15+
Description of a link and selection of the current page.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
icon: layout-bottombar
3+
since: 0.49.0
4+
category: navigation
5+
summary: Show status messages and links in a horizontal bar.
6+
top:
7+
- class
8+
- name: fixed
9+
type: BOOLEAN
10+
description: Keep the bar at the bottom of the screen while the page scrolls. Defaults to true. A fixed
11+
bar overlays page content, so leave space below your last item if needed. Set to false to place the bar
12+
in the page where the SQL appears.
13+
- id
14+
- name: label
15+
type: TEXT
16+
description: Accessible name for the bar. Defaults to "Status bar".
17+
row:
18+
- class
19+
- name: color
20+
type: COLOR
21+
description: Color of the segment text and icon.
22+
- name: icon
23+
type: ICON
24+
description: Icon displayed before the text.
25+
- name: link
26+
type: URL
27+
description: URL to open when the segment is clicked.
28+
- name: title
29+
type: TEXT
30+
description: Text displayed in the segment.
31+
- name: tooltip
32+
type: TEXT
33+
description: Text shown when hovering over the segment or focusing its link. For an icon without a title,
34+
supply a tooltip to give the segment an accessible name.
35+
---
36+
37+
Display short status messages and links in a single horizontal bar. Each row adds one segment. When there are several segments, the last one aligns to the far edge. If the segments do not all fit, scroll the bar horizontally to see the rest.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
rows:
3+
- component: status_bar
4+
label: Query status
5+
fixed: false
6+
- title: Connected
7+
icon: database
8+
color: green
9+
tooltip: Connected to the reporting database
10+
- title: 24 rows
11+
- title: SQL functions
12+
icon: book
13+
link: /functions.sql
14+
---
15+
16+
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.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
icon: dots-circle-horizontal
3+
category: navigation
4+
summary: Mark progress through the stages of a task.
5+
top:
6+
- name: color
7+
type: COLOR
8+
description: Color of the bars displayed between steps.
9+
- name: counter
10+
type: TEXT
11+
description: Display the number of the step on top of its name.
12+
- name: description
13+
type: TEXT
14+
description: Description of the section.
15+
- name: id
16+
type: TEXT
17+
description: id attribute injected as an anchor in HTML. It can be used for scrolling to this item through
18+
links (use "#id" in link url). Added in v0.18.0.
19+
- name: title
20+
type: TEXT
21+
description: Title of the section.
22+
row:
23+
- name: active
24+
type: BOOLEAN
25+
description: Whether this item in the grid is considered "active". Active items are displayed more prominently.
26+
- name: description
27+
type: TEXT
28+
description: Tooltip to display when the user passes their mouse over the step's name.
29+
- name: icon
30+
type: ICON
31+
description: An icon name (from tabler-icons.io) to display on the left side of the step name.
32+
- name: link
33+
type: URL
34+
description: A target URL to which the user should be taken when they click on the step.
35+
- name: title
36+
type: TEXT
37+
description: Name of the step.
38+
---
39+
40+
Guide users through multi-stage processes, displaying a clear list of previous and future steps.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
rows:
3+
- component: steps
4+
- title: Shopping
5+
- title: Store pickup
6+
- title: Payment
7+
active: true
8+
- title: Review & Order
9+
---
10+
11+
Online store checkout steps.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
rows:
3+
- component: steps
4+
counter: true
5+
color: purple
6+
- title: Registration form
7+
icon: forms
8+
link: https://github.com/sqlpage/SQLPage
9+
description: Initial account data creation.
10+
- title: Email confirmation
11+
icon: mail
12+
link: https://sql-page.com
13+
description: Confirm your email by clicking on a link in a validation email.
14+
- title: ID verification
15+
description: Checking personal information
16+
icon: user
17+
link: '#'
18+
- title: Final account approval
19+
description: ophir.dev
20+
link: https://ophir.dev/
21+
icon: eye-check
22+
active: true
23+
- title: Account creation
24+
icon: check
25+
---
26+
27+
A progress indicator with custom color, auto-generated step numbers, icons, and description tooltips.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
icon: row-insert-bottom
3+
since: 0.9.5
4+
category: navigation
5+
summary: Switch between related pages using labeled tabs.
6+
top:
7+
- name: center
8+
type: BOOLEAN
9+
description: Whether the tabs should be centered or not. Defaults to false.
10+
- class
11+
- id
12+
row:
13+
- name: active
14+
type: BOOLEAN
15+
description: Whether the tab is active or not. Defaults to false.
16+
- name: center
17+
type: BOOLEAN
18+
description: Whether this individual tab's label should be centered inside the tab. Defaults to false.
19+
- class
20+
- name: color
21+
type: TEXT
22+
description: Color of the tab's text, and of its underline when it is active. See preview.tabler.io/colors.html
23+
for a list of available colors.
24+
- name: description
25+
type: TEXT
26+
description: Description of the tab. This is displayed when the user hovers over the tab.
27+
- name: icon
28+
type: TEXT
29+
description: Name of the icon to display on the tab. See tabler-icons.io for a list of available icons.
30+
- id
31+
- name: link
32+
type: TEXT
33+
description: Link to the page to display when the tab is clicked. By default, the link refers to the current
34+
page, with a 'tab' parameter set to the tab's title and hash set to the id (if passed) - this brings
35+
us back to the location of the tab after submission.
36+
- name: title
37+
type: TEXT
38+
required: true
39+
description: Text to display on the tab. If link is not set, the link will be the current page with a '$tab'
40+
parameter set to the tab's title. If 'id' is set, the page will be scrolled to the tab.
41+
---
42+
43+
Build a tabbed interface, with each tab being a link to a page. Each tab can be in two states: active or inactive.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
rows:
3+
- component: tab
4+
- title: This tab does not exist
5+
active: true
6+
link: ?component=tab&tab=tab_1
7+
- title: I am not a true tab
8+
link: ?component=tab&tab=tab_2
9+
- title: Do not click here
10+
link: ?component=tab&tab=tab_3
11+
---
12+
13+
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.
14+
15+
To implement contents that change based on the active tab, use the `tab` parameter in the page query string.
16+
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`.
17+
18+
You could then for instance display contents coming from the database based on the value of the `tab` parameter.
19+
For instance: `SELECT 'text' AS component, contents_md FROM my_page_contents WHERE tab = $tab`.
20+
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:
21+
22+
```sql
23+
set tab = coalesce($tab, 'Projects');
24+
select 'tab' as component;
25+
select 'Projects' as title, $tab = 'Projects' as active;
26+
select 'Tasks' as title, $tab = 'Tasks' as active;
27+
28+
select 'table' as component;
29+
30+
select * from my_projects where $tab = 'Projects';
31+
select * from my_tasks where $tab = 'Tasks';
32+
```
33+
34+
Note that the example below is completely static, and does not use the `tab` parameter to actually switch between tabs.
35+
The query above defaults to Projects on the first visit; the links then select either `?tab=Projects` or `?tab=Tasks`.

0 commit comments

Comments
 (0)