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
53 changes: 53 additions & 0 deletions examples/official-site/content/components/alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
icon: alert-triangle
category: forms-and-feedback
summary: Draw attention to a message with a color and an icon.
top:
- name: close_label
type: TEXT
description: Accessible name of the close button of a dismissible alert, which screen readers announce.
The default is "Close".
- class
- name: color
type: COLOR
description: The color theme for the alert message.
- name: description
type: TEXT
description: Detailed description or content of the alert message.
- name: description_md
type: TEXT
description: Detailed description or content of the alert message, in Markdown format, allowing you to
use rich text formatting, including `**bold**` and `*italic*` text.
- name: dismissible
type: BOOLEAN
description: Whether the user can close the alert message.
- name: icon
type: TEXT
description: Icon name (from tabler-icons.io) to display next to the alert message.
- id
- name: important
type: BOOLEAN
description: Set this to TRUE to make the alert message more prominent.
- name: link
type: URL
description: A URL to link to from the alert message.
- name: link_text
type: TEXT
description: Customize the text of the link in the alert message. The default is "Ok".
- name: title
type: TEXT
required: true
description: Title of the alert message.
row:
- name: color
type: COLOR
description: Customize the color of the link.
- name: link
type: URL
description: A URL to link to from the alert message.
- name: title
type: TEXT
description: Customize the text of the link in the alert message. The default is "Ok".
---

A visually distinctive message or notification.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
rows:
- component: alert
title: Attention
description: This is an important message.
---

A basic alert message
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
rows:
- component: alert
title: Success
description: Item successfully added to your cart.
icon: check
color: green
- component: alert
title: Warning
description: Your cart is almost full.
icon: alert-triangle
color: yellow
- component: alert
title: Error
description: Your cart is full.
icon: alert-circle
color: red
---

A list of notifications
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
rows:
- component: alert
title: Your dashboard is ready!
icon: analyze
color: teal
dismissible: true
description: Your public web dashboard was successfully created.
- link: dashboard.sql
title: View your dashboard
- link: index.sql
title: Back to home
color: secondary
---

A full-featured notification message with multiple links
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
rows:
- component: alert
title: Alert
icon: alert-circle
color: red
important: true
dismissible: true
close_label: Dismiss this alert
description: SQLPage is entirely free and open source.
link: https://github.com/sqlpage/SQLPage
link_text: See source code
---

A dismissible alert. `close_label` names the close button for screen readers.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
rows:
- component: alert
title: Free and open source
icon: free-rights
color: info
description_md: '*SQLPage* is entirely free and open source. You can **contribute** to it on [GitHub](https://github.com/sqlpage/SQLPage).'
---

An alert message with a Markdown-formatted description
46 changes: 46 additions & 0 deletions examples/official-site/content/components/empty_state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
icon: info-circle
since: 0.35.0
category: forms-and-feedback
summary: Explain an empty view and offer the reader a next step.
top:
- class
- name: description
type: TEXT
description: A short text displayed below the title.
- name: description_md
type: TEXT
description: A short text displayed below the title, formatted using markdown.
- name: header
type: TEXT
description: Text displayed on the top of the empty state.
- name: icon
type: ICON
description: Name of an icon to be displayed on the top of the empty state.
- id
- name: image
type: URL
description: The URL (absolute or relative) of an image to display at the top of the empty state.
- name: link
type: URL
required: true
description: The URL to which the button should navigate when clicked.
- name: link_icon
type: ICON
required: true
description: Name of an icon to be displayed on the left side of the button.
- name: link_text
type: TEXT
required: true
description: The text displayed on the button.
- name: title
type: TEXT
required: true
description: Description of the empty state.
---

Displays a large placeholder message to communicate a single information to the user and invite them to take action.

Typically includes a title, an optional icon/image, descriptive text (rich text formatting and images supported via Markdown), and a call-to-action button.

Ideal for first-use screens, empty data sets, "no results" pages, or error messages.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
rows:
- component: empty_state
title: No results found
header: '404'
description: Try adjusting your search or filter to find what you're looking for.
link_text: Search again
link_icon: search
link: '#not-found'
id: not-found
---

This example shows how to create a 404-style "Not Found" empty state with
- a prominent header displaying "404",
- a helpful description suggesting to adjust search parameters, and
- a "Search again" button with a search icon that links back to the search page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
rows:
- component: empty_state
title: A critical problem has occurred
icon: mood-wrrr
description_md: |-
SQLPage can do a lot of things, but this is not one of them.

Please restart your browser and **cross your fingers**.
link_text: Close and restart
link_icon: rotate-clockwise
link: '#'
---

It's possible to use an icon or an image to illustrate the problem.
47 changes: 47 additions & 0 deletions examples/official-site/content/components/toast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
icon: notification
since: 0.46.0
category: forms-and-feedback
summary: Show a brief notification above the page.
top:
- class
- name: color
type: COLOR
description: Optional Tabler color. The default is the neutral toast appearance; colored variants use the
matching contrasting foreground utility.
- name: description
type: TEXT
description: Escaped plain-text body. This is used only when `description_md` is not supplied.
- name: description_md
type: TEXT
description: Rich-text alternative to `description`, rendered as Markdown. When both properties are supplied,
`description_md` takes precedence.
- name: dismissible
type: BOOLEAN
description: Whether to render an accessible manual close button. Defaults to true and is independent of
automatic dismissal.
- name: duration
type: INTEGER
description: Automatic dismissal delay in milliseconds. Defaults to 5000. Set to 0 to keep the toast visible
until manually dismissed (when `dismissible` is true) or the page is left.
- name: icon
type: ICON
description: Optional [Tabler icon](https://tabler.io/icons) name.
- id
- name: position
type: TEXT
description: 'Screen placement: `top-start`, `top-center`, `top-end`, `bottom-start`, `bottom-center`,
or `bottom-end`. Defaults to `top-end`; invalid values safely fall back to that default.'
- name: title
type: TEXT
description: Optional notification heading.
- name: trigger
type: TEXT
description: Optional URL fragment that opens the toast without reloading the page, with or without the
leading `#`. When set, the toast does not open on page load and can be opened repeatedly by a link or
button whose target is that fragment. Multiple toasts can share a trigger to open as a stack.
---

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.

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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
rows:
- component: toast
id: toast-auto
title: This is a SQLPage toast
description: This toast will open automatically when the page loads.
icon: check
color: green
---

A toast that opens when the page loads and disappears automatically after the default 5000 milliseconds.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
rows:
- component: toast
id: toast-dismissible
trigger: persistent-error
title: Could not save
description: Review the highlighted fields and try again.
icon: alert-triangle
color: black
duration: 0
dismissible: true
- component: toast
id: toast-nondismissible
trigger: persistent-status
title: Connection unavailable
description: This persistent notification has no manual close control.
duration: 0
dismissible: false
- component: button
- title: Show dismissible error
link: '#persistent-error'
color: red
- title: Show non-dismissible status
link: '#persistent-status'
---

A persistent error notification that disables automatic dismissal and requires the user to activate its close button.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
rows:
- component: toast
id: toast-markdown
trigger: rich-notifications
title: Release available
description: <strong>This fallback stays escaped</strong>
description_md: Version **2.0** is ready. [Read the notes](https://example.com/releases).
color: blue
duration: 0
- component: toast
id: toast-plain
trigger: rich-notifications
description: <strong>Plain text stays escaped</strong>
color: white
duration: 0
- component: button
- title: Show rich notifications
link: '#rich-notifications'
---

A persistent rich Markdown notification. Markdown takes precedence over plain text and renders emphasis and a link as HTML, while plain-text content remains escaped.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
rows:
- component: toast
id: toast-stack-one
trigger: queued notifications
title: Import started
description: Preparing records.
duration: 0
- component: toast
id: toast-stack-two
trigger: queued notifications
title: Import running
description: Processing records.
duration: 0
- component: toast
id: toast-short
trigger: queued notifications
title: Temporary update
description: This message closes shortly.
duration: 2000
- component: button
- title: Show queued notifications
link: '#queued notifications'
---

Several persistent queued notifications. Toasts with the same position share a container and stack instead of overlapping.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
rows:
- component: toast
id: toast-bottom-center
trigger: bottom-notification
title: Download ready
description: Your export is ready.
position: bottom-center
duration: 0
- component: button
- title: Show bottom notification
link: '#bottom-notification'
---

A notification placed at the bottom center of the screen instead of the default top end.
Loading
Loading