Skip to content

Commit edf6c44

Browse files
committed
Move alert, empty-state, and toast references to Markdown
1 parent 1e35694 commit edf6c44

20 files changed

Lines changed: 347 additions & 306 deletions
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
- name: close_label
7+
type: TEXT
8+
description: Accessible name of the close button of a dismissible alert, which screen readers announce.
9+
The default is "Close".
10+
- class
11+
- name: color
12+
type: COLOR
13+
description: The color theme for the alert message.
14+
- name: description
15+
type: TEXT
16+
description: Detailed description or content of the alert message.
17+
- name: description_md
18+
type: TEXT
19+
description: Detailed description or content of the alert message, in Markdown format, allowing you to
20+
use rich text formatting, including `**bold**` and `*italic*` text.
21+
- name: dismissible
22+
type: BOOLEAN
23+
description: Whether the user can close the alert message.
24+
- name: icon
25+
type: TEXT
26+
description: Icon name (from tabler-icons.io) to display next to the alert message.
27+
- id
28+
- name: important
29+
type: BOOLEAN
30+
description: Set this to TRUE to make the alert message more prominent.
31+
- name: link
32+
type: URL
33+
description: A URL to link to from the alert message.
34+
- name: link_text
35+
type: TEXT
36+
description: Customize the text of the link in the alert message. The default is "Ok".
37+
- name: title
38+
type: TEXT
39+
required: true
40+
description: Title of the alert message.
41+
row:
42+
- name: color
43+
type: COLOR
44+
description: Customize the color of the link.
45+
- name: link
46+
type: URL
47+
description: A URL to link to from the alert message.
48+
- name: title
49+
type: TEXT
50+
description: Customize the text of the link in the alert message. The default is "Ok".
51+
---
52+
53+
A visually distinctive message or notification.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
rows:
3+
- component: alert
4+
title: Attention
5+
description: This is an important message.
6+
---
7+
8+
A basic alert message
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
rows:
3+
- component: alert
4+
title: Success
5+
description: Item successfully added to your cart.
6+
icon: check
7+
color: green
8+
- component: alert
9+
title: Warning
10+
description: Your cart is almost full.
11+
icon: alert-triangle
12+
color: yellow
13+
- component: alert
14+
title: Error
15+
description: Your cart is full.
16+
icon: alert-circle
17+
color: red
18+
---
19+
20+
A list of notifications
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
rows:
3+
- component: alert
4+
title: Your dashboard is ready!
5+
icon: analyze
6+
color: teal
7+
dismissible: true
8+
description: Your public web dashboard was successfully created.
9+
- link: dashboard.sql
10+
title: View your dashboard
11+
- link: index.sql
12+
title: Back to home
13+
color: secondary
14+
---
15+
16+
A full-featured notification message with multiple links
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
rows:
3+
- component: alert
4+
title: Alert
5+
icon: alert-circle
6+
color: red
7+
important: true
8+
dismissible: true
9+
close_label: Dismiss this alert
10+
description: SQLPage is entirely free and open source.
11+
link: https://github.com/sqlpage/SQLPage
12+
link_text: See source code
13+
---
14+
15+
A dismissible alert. `close_label` names the close button for screen readers.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
rows:
3+
- component: alert
4+
title: Free and open source
5+
icon: free-rights
6+
color: info
7+
description_md: '*SQLPage* is entirely free and open source. You can **contribute** to it on [GitHub](https://github.com/sqlpage/SQLPage).'
8+
---
9+
10+
An alert message with a Markdown-formatted description
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
icon: info-circle
3+
since: 0.35.0
4+
category: forms-and-feedback
5+
summary: Explain an empty view and offer the reader a next step.
6+
top:
7+
- class
8+
- name: description
9+
type: TEXT
10+
description: A short text displayed below the title.
11+
- name: description_md
12+
type: TEXT
13+
description: A short text displayed below the title, formatted using markdown.
14+
- name: header
15+
type: TEXT
16+
description: Text displayed on the top of the empty state.
17+
- name: icon
18+
type: ICON
19+
description: Name of an icon to be displayed on the top of the empty state.
20+
- id
21+
- name: image
22+
type: URL
23+
description: The URL (absolute or relative) of an image to display at the top of the empty state.
24+
- name: link
25+
type: URL
26+
required: true
27+
description: The URL to which the button should navigate when clicked.
28+
- name: link_icon
29+
type: ICON
30+
required: true
31+
description: Name of an icon to be displayed on the left side of the button.
32+
- name: link_text
33+
type: TEXT
34+
required: true
35+
description: The text displayed on the button.
36+
- name: title
37+
type: TEXT
38+
required: true
39+
description: Description of the empty state.
40+
---
41+
42+
Displays a large placeholder message to communicate a single information to the user and invite them to take action.
43+
44+
Typically includes a title, an optional icon/image, descriptive text (rich text formatting and images supported via Markdown), and a call-to-action button.
45+
46+
Ideal for first-use screens, empty data sets, "no results" pages, or error messages.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
rows:
3+
- component: empty_state
4+
title: No results found
5+
header: '404'
6+
description: Try adjusting your search or filter to find what you're looking for.
7+
link_text: Search again
8+
link_icon: search
9+
link: '#not-found'
10+
id: not-found
11+
---
12+
13+
This example shows how to create a 404-style "Not Found" empty state with
14+
- a prominent header displaying "404",
15+
- a helpful description suggesting to adjust search parameters, and
16+
- a "Search again" button with a search icon that links back to the search page.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
rows:
3+
- component: empty_state
4+
title: A critical problem has occurred
5+
icon: mood-wrrr
6+
description_md: |-
7+
SQLPage can do a lot of things, but this is not one of them.
8+
9+
Please restart your browser and **cross your fingers**.
10+
link_text: Close and restart
11+
link_icon: rotate-clockwise
12+
link: '#'
13+
---
14+
15+
It's possible to use an icon or an image to illustrate the problem.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
icon: notification
3+
since: 0.46.0
4+
category: forms-and-feedback
5+
summary: Show a brief notification above the page.
6+
top:
7+
- class
8+
- name: color
9+
type: COLOR
10+
description: Optional Tabler color. The default is the neutral toast appearance; colored variants use the
11+
matching contrasting foreground utility.
12+
- name: description
13+
type: TEXT
14+
description: Escaped plain-text body. This is used only when `description_md` is not supplied.
15+
- name: description_md
16+
type: TEXT
17+
description: Rich-text alternative to `description`, rendered as Markdown. When both properties are supplied,
18+
`description_md` takes precedence.
19+
- name: dismissible
20+
type: BOOLEAN
21+
description: Whether to render an accessible manual close button. Defaults to true and is independent of
22+
automatic dismissal.
23+
- name: duration
24+
type: INTEGER
25+
description: Automatic dismissal delay in milliseconds. Defaults to 5000. Set to 0 to keep the toast visible
26+
until manually dismissed (when `dismissible` is true) or the page is left.
27+
- name: icon
28+
type: ICON
29+
description: Optional [Tabler icon](https://tabler.io/icons) name.
30+
- id
31+
- name: position
32+
type: TEXT
33+
description: 'Screen placement: `top-start`, `top-center`, `top-end`, `bottom-start`, `bottom-center`,
34+
or `bottom-end`. Defaults to `top-end`; invalid values safely fall back to that default.'
35+
- name: title
36+
type: TEXT
37+
description: Optional notification heading.
38+
- name: trigger
39+
type: TEXT
40+
description: Optional URL fragment that opens the toast without reloading the page, with or without the
41+
leading `#`. When set, the toast does not open on page load and can be opened repeatedly by a link or
42+
button whose target is that fragment. Multiple toasts can share a trigger to open as a stack.
43+
---
44+
45+
Displays a brief notification above the page. Each top-level `toast` row creates one notification, and consecutive toasts at the same position are queued in a shared stack.
46+
47+
Ordinary notifications use `role="status"` and `aria-live="polite"`. Colored variants retain a readable contrasting foreground. Automatic dismissal and the manual close control are configured independently.

0 commit comments

Comments
 (0)