Documentation
¶
Overview ¶
templ: version: v0.3.1070
templ: version: v0.3.1070
Index ¶
- func Appearance(p view.Page, d AppearanceData) templ.Component
- func DetailPage(p view.Page, d DetailData) templ.Component
- func Form(d FormData) templ.Component
- func FormPage(p view.Page, d FormData) templ.Component
- func Table(d TableData) templ.Component
- func TablePage(p view.Page, d TableData) templ.Component
- type AppearanceData
- type Cell
- type Choice
- type Column
- type Command
- type DetailData
- type Field
- type FormData
- type Option
- type PostCommand
- type PostField
- type Pre
- type Section
- type TableData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Appearance ¶
func Appearance(p view.Page, d AppearanceData) templ.Component
Appearance renders the per-user appearance settings. Saved server-side in a cookie – no JavaScript involved.
func DetailPage ¶
func DetailPage(p view.Page, d DetailData) templ.Component
DetailPage renders sections of key/value lists, tables and forms.
Types ¶
type AppearanceData ¶
type AppearanceData struct {
Messages []view.Message
Layouts []Choice
Themes []Choice
Densities []Choice
CSRF string // session token of the real UI; "" in the prototype
}
AppearanceData is the content of the appearance settings.
type Cell ¶
type Cell struct {
Text, Href, Rel string
Status view.Status // set: the text is a status
Mono, Num bool
NoWrap bool
Break bool // long values (URLs, errors) wrap anywhere
Posts []PostCommand
}
Cell is one table cell.
type DetailData ¶
DetailData is a detail page: commands and sections.
type Field ¶
type Field struct {
ID, Label, Type string // text, password, textarea, select, checkbox, file, number, hidden
Value, Hint, Error string
Required, Checked bool
Options []Option
Rows int
Autocomplete string // "" = off for passwords, else as given
Accept string // file inputs
}
Field is one form control.
type FormData ¶
type FormData struct {
Messages []view.Message
Title string // a heading above the form (in sections)
Intro []string
Pre []Pre
Action string
CSRF string
Multipart bool
Fields []Field
Submit string
Danger bool // the submit button is a dangerous action
Cancel string
Method string // "" = post; "get" for filters
}
FormData is a form with its fields.
type PostCommand ¶ added in v0.3.0
type Pre ¶
type Pre struct {
Title, Text string
}
Pre is a block of text shown as is (CSR, extension file, instructions).
type Section ¶
type Section struct {
Title string
Text []string
KV []view.KV
Pre []Pre
Table *TableData
Forms []FormData
}
Section is one part of a detail page.
type TableData ¶
type TableData struct {
RefreshURL string // optional passive fragment polling
Adaptive bool // wrap every column instead of scrolling narrow tables
Messages []view.Message
Title string // a heading (in sections)
Commands []Command
Filters *FormData
Columns []Column
Rows [][]Cell
Empty string
// More links to the next page (cursor).
More, MoreLabel string
}
TableData is a table with commands and filters.
Click to show internal directories.
Click to hide internal directories.