Skip to content

Commit db4a8be

Browse files
committed
Give each component one reference page for its parameters
1 parent d58313b commit db4a8be

45 files changed

Lines changed: 2825 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
icon: alert-triangle
3+
category: forms-and-feedback
4+
summary: Draw attention to a message with a color and an icon.
5+
top:
6+
- class
7+
- name: color
8+
type: COLOR
9+
description: The color theme for the alert message.
10+
- name: description
11+
type: TEXT
12+
description: Detailed description or content of the alert message.
13+
- name: description_md
14+
type: TEXT
15+
description: Detailed description or content of the alert message, in Markdown format, allowing you to
16+
use rich text formatting, including `**bold**` and `*italic*` text.
17+
- name: dismissible
18+
type: BOOLEAN
19+
description: Whether the user can close the alert message.
20+
- name: icon
21+
type: TEXT
22+
description: Icon name (from tabler-icons.io) to display next to the alert message.
23+
- id
24+
- name: important
25+
type: BOOLEAN
26+
description: Set this to TRUE to make the alert message more prominent.
27+
- name: link
28+
type: URL
29+
description: A URL to link to from the alert message.
30+
- name: link_text
31+
type: TEXT
32+
description: Customize the text of the link in the alert message. The default is "Ok".
33+
- name: title
34+
type: TEXT
35+
required: true
36+
description: Title of the alert message.
37+
row:
38+
- name: color
39+
type: COLOR
40+
description: Customize the color of the link.
41+
- name: link
42+
type: URL
43+
description: A URL to link to from the alert message.
44+
- name: title
45+
type: TEXT
46+
description: Customize the text of the link in the alert message. The default is "Ok".
47+
---
48+
49+
A visually distinctive message or notification.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
icon: lock
3+
since: 0.7.2
4+
category: server-logic
5+
summary: Restrict access by checking a password against a stored hash.
6+
top:
7+
- name: link
8+
type: TEXT
9+
description: The URL to redirect the user to if they are not logged in. If this parameter is not specified,
10+
the user will stay on the current page, but be asked to log in using a popup in their browser (HTTP basic
11+
authentication).
12+
- name: password
13+
type: TEXT
14+
description: The password that was sent by the user. You can set this to :password if you have a login
15+
form leading to your page.
16+
- name: password_hash
17+
type: TEXT
18+
description: The hash of the password that you stored for the user that is currently trying to log in.
19+
These hashes can be generated ahead of time using a tool like https://argon2.online/.
20+
---
21+
22+
Create pages with password-restricted access.
23+
24+
25+
When you want to add user authentication to your SQLPage application,
26+
you have two main options:
27+
28+
1. The `authentication` component:
29+
- lets you manage usernames and passwords yourself
30+
- does not require any external service
31+
- gives you fine-grained control over
32+
- which pages and actions are protected
33+
- the look of the [login form](?component=login)
34+
- the duration of the session
35+
- the permissions of each user
36+
2. [**Single sign-on**](/sso)
37+
- lets users log in with their existing accounts (like Google, Microsoft, or your organization's own identity provider)
38+
- requires setting up an external service (Google, Microsoft, etc.)
39+
- frees you from implementing a lot of features like password reset, account creation, user management, etc.
40+
41+
This page describes the first option.
42+
43+
When used, this component has to be at the top of your page,
44+
because once the page has begun being sent to the browser,
45+
it is too late to restrict access to it.
46+
47+
The authentication component checks if the user has sent the correct password,
48+
and if not, redirects them to the URL specified in the link parameter.
49+
50+
If you don't want to re-check the password on every page (which is an expensive operation),
51+
you can check the password only once and store a session token in your database
52+
(see the session example below).
53+
54+
You can use the [cookie component](?component=cookie) to set the session token cookie in the client browser,
55+
and then check whether the token matches what you stored in subsequent pages.
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: 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: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
icon: hand-click
3+
since: 0.14.0
4+
category: forms-and-feedback
5+
summary: Follow a link, download a file, or submit a form.
6+
top:
7+
- class
8+
- name: justify
9+
type: TEXT
10+
description: The horizontal alignment of the button list (e.g., start, end, center, between).
11+
- name: shape
12+
type: TEXT
13+
description: Shape of the buttons (e.g., pill, square)
14+
- name: size
15+
type: TEXT
16+
description: The size of the buttons (e.g., sm, lg).
17+
row:
18+
- name: color
19+
type: COLOR
20+
description: The color of the button (e.g., red, green, blue, but also primary, warning, danger, etc.).
21+
Only base color names are supported, not variations like "blue-lt" or "gray-300". Use a custom CSS stylesheet
22+
to further customize the colors.
23+
- name: disabled
24+
type: BOOLEAN
25+
description: Whether the button is disabled or not.
26+
- name: download
27+
type: TEXT
28+
description: If defined, the link will download the target instead of navigating to it. Set the value to
29+
the desired name of the downloaded file.
30+
- name: form
31+
type: TEXT
32+
description: Identifier (id) of the form to which the button should submit.
33+
- name: icon
34+
type: ICON
35+
description: Name of an icon to be displayed on the left side of the button.
36+
- name: icon_after
37+
type: ICON
38+
description: Name of an icon to display after the text in the button
39+
- name: id
40+
type: TEXT
41+
description: HTML Identifier to add to the button element.
42+
- name: image
43+
type: TEXT
44+
description: Path to image file (relative. relative to web root or URL) to be displayed on the button.
45+
- name: link
46+
type: URL
47+
description: The URL to which the button should navigate when clicked. If the form attribute is specified,
48+
then this overrides the page to which the form is submitted.
49+
- name: modal
50+
type: TEXT
51+
description: Display the modal window corresponding to the specified ID.
52+
- name: narrow
53+
type: BOOLEAN
54+
description: Whether to trim horizontal padding.
55+
- name: outline
56+
type: COLOR
57+
description: Outline color of the button (e.g. red, purple, ...)
58+
- name: rel
59+
type: TEXT
60+
description: '"nofollow" when the contents of the target link are not endorsed, "noopener" when the target
61+
is not trusted, and "noreferrer" to hide where the user came from when they open the link.'
62+
- name: space_after
63+
type: BOOLEAN
64+
description: Whether there should be extra space to the right of the button. In a line of buttons, this
65+
will put the buttons before this one on the left, and the ones after on the right.
66+
- name: target
67+
type: TEXT
68+
description: '"_blank" to open the link in a new tab, "_self" to open it in the same tab, "_parent" to
69+
open it in the parent frame, or "_top" to open it in the full body of the window.'
70+
- name: title
71+
type: TEXT
72+
description: The text displayed on the button.
73+
- name: tooltip
74+
type: TEXT
75+
description: Text displayed when the user hovers over the button.
76+
---
77+
78+
Displays one or more buttons that follow links, download files, or submit a form.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
icon: credit-card
3+
category: display-data
4+
summary: Arrange records in cards with images, links, or embedded content.
5+
top:
6+
- class
7+
- name: columns
8+
type: INTEGER
9+
description: The number of columns in the grid of cards. This is just a hint, the grid will adjust dynamically
10+
to the user's screen size, rendering fewer columns if needed to fit the contents. To control the size
11+
of cards individually, use the `width` row-level property instead.
12+
- name: description
13+
type: TEXT
14+
description: A short paragraph displayed below the title.
15+
- name: description_md
16+
type: TEXT
17+
description: A short paragraph displayed below the title - formatted using markdown.
18+
- name: title
19+
type: TEXT
20+
description: Text header at the top of the list of cards.
21+
row:
22+
- name: active
23+
type: BOOLEAN
24+
description: Whether this item in the grid is considered "active". Active items are displayed more prominently.
25+
- name: allow
26+
type: TEXT
27+
description: The permissions policy of the iframe embed code, for instance "fullscreen; clipboard-write".
28+
Used only when embed_mode is 'iframe'.
29+
- name: background_color
30+
type: COLOR
31+
description: The background color of the card.
32+
- class
33+
- name: color
34+
type: COLOR
35+
description: The name of a color, to be displayed on the left of the card to highlight it. If the embed
36+
parameter is enabled and you don't have a title or description, this parameter won't apply.
37+
- name: description
38+
type: TEXT
39+
description: |-
40+
The body of the card, where you put the main text contents of the card.
41+
This does not support rich text formatting, only plain text.
42+
If you want to use rich text formatting, use the `description_md` property instead.
43+
- name: description_md
44+
type: TEXT
45+
description: |2-
46+
47+
The body of the card, in Markdown format.
48+
This is useful if you want to display a lot of text in the card, with many options for formatting, such as
49+
line breaks, **bold**, *italics*, lists, #titles, [links](target.sql), ![images](photo.jpg), etc.
50+
- name: embed
51+
type: TEXT
52+
description: |-
53+
A url whose contents will be fetched and injected into the body of this card.
54+
This can be used to inject arbitrary html content, but is especially useful for injecting
55+
the output of other sql files rendered by SQLPage. For the latter case you can pass the
56+
`?_sqlpage_embed` query parameter, which will skip the shell layout.
57+
Components inside the fetched content initialize automatically. Custom scripts that insert
58+
SQLPage fragments should dispatch a bubbling `fragment-loaded` event on the element containing
59+
the new content. Initialization includes that element and its descendants; dispatching the
60+
event on `document` initializes pending components throughout the page. Repeated events
61+
preserve existing form and widget handlers
62+
- name: embed_mode
63+
type: TEXT
64+
description: |-
65+
Set to 'iframe' to embed the target (specified through embed property) in an iframe.
66+
Unless this is explicitly set, the embed target is fetched and injected within the parent page. If embed_mode is set to iframe,
67+
You can also set height and width parameters to configure the appearance and the sandbox and allow parameters to configure
68+
security aspects of the iframe. Refer to the [MDN page](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)
69+
for an explanation of these parameters.
70+
- name: footer
71+
type: TEXT
72+
description: Muted text to display at the bottom of the card.
73+
- name: footer_link
74+
type: URL
75+
description: An URL to which the user should be taken when they click on the footer.
76+
- name: footer_md
77+
type: TEXT
78+
description: Muted text to display at the bottom of the card, with rich text formatting in Markdown format.
79+
- name: height
80+
type: INTEGER
81+
description: Height of the iframe embed code, in pixels. Used only when embed_mode is 'iframe'.
82+
- name: icon
83+
type: ICON
84+
description: Name of an icon to display on the right side of the card.
85+
- id
86+
- name: link
87+
type: URL
88+
description: An URL to which the user should be taken when they click on the card.
89+
- name: sandbox
90+
type: TEXT
91+
description: The restrictions to apply to the iframe embed code, for instance "allow-scripts allow-same-origin".
92+
Used only when embed_mode is 'iframe'.
93+
- name: style
94+
type: TEXT
95+
description: 'Inline style property to your iframe embed code. For example "background-color: #FFFFFF"'
96+
- name: target
97+
type: TEXT
98+
description: 'Where the card''s link opens: "_blank" for a new tab, "_self" for the same tab, "_parent"
99+
for the parent frame, or "_top" for the full body of the window.'
100+
- name: title
101+
type: TEXT
102+
required: true
103+
description: Name of the card, displayed at the top.
104+
- name: top_image
105+
type: URL
106+
description: The URL (absolute or relative) of an image to display at the top of the card.
107+
- name: top_image_height
108+
type: INTEGER
109+
description: Specify the top image height, in pixels. Helps prevent layout shifts.
110+
- name: top_image_lazy
111+
type: BOOLEAN
112+
description: Whether the top image must be lazily loaded. Defaults to false, meaning eagerly loaded.
113+
- name: top_image_width
114+
type: INTEGER
115+
description: Specify the top image width, in pixels. Helps prevent layout shifts.
116+
- name: width
117+
type: INTEGER
118+
description: The width of the card, between 1 (smallest) and 12 (full-width). The default width is 3, resulting
119+
in 4 cards per line. When embed_mode is 'iframe', this is used as the width of the iframe instead, and
120+
defaults to 100%.
121+
---
122+
123+
A grid where each element is a small card that displays a piece of data.

0 commit comments

Comments
 (0)