web.components #
fn icon_ellipsis #
fn icon_ellipsis() string
fn kanban_example #
fn kanban_example() KanbanViewData
fn markdown #
fn markdown(path string) !Markdown
fn to_struct #
fn to_struct[T](t T) Struct
interface IComponent #
interface IComponent {
html() string
}
interface ILayout #
interface ILayout {
html() string
mut:
main IComponent
}
interface IView #
interface IView {
html() string
}
enum HeadingLevel #
enum HeadingLevel {
one = 1
two
three
four
five
}
enum ImageType #
enum ImageType {
@none
thumbnail
}
enum PriorityEnum #
enum PriorityEnum {
critical
urgent
normal
low
no
}
struct Anchor #
struct Anchor {
pub:
href string
content string
}
Define HTML element structs implementing the IComponent interface
struct Breadcrumbs #
struct Breadcrumbs {
pub:
anchors []Anchor // anchors for breadcrumbs
label string // label of current page
}
fn (Breadcrumbs) html #
fn (breadcrumbs Breadcrumbs) html() string
struct Button #
struct Button {
Unpoly
pub mut:
onclick string
typ string
content string
navigate string // the route the button is to navigate to, if it is
}
fn (Button) html #
fn (button Button) html() string
struct Cell #
struct Cell {
pub:
content string
}
fn (Cell) html #
fn (component Cell) html() string
struct Chat #
struct Chat {
pub:
messages []Message
}
fn (Chat) html #
fn (chat Chat) html() string
struct Dashboard #
struct Dashboard {
pub:
user string
}
fn (Dashboard) html #
fn (component Dashboard) html() string
struct Dropdown #
struct Dropdown {
pub:
label string
items []NavItem
}
fn (Dropdown) html #
fn (dropdown Dropdown) html() string
struct Event #
struct Event {
pub:
swimlane string
subject string
deadline string
link string
color ColorEnum
assigned string
priority PriorityEnum
labels string // comma separated
}
struct Feed #
struct Feed {
pub:
feed []Post
}
fn (Feed) html #
fn (feed Feed) html() string
struct Field #
struct Field {
pub:
name string
ftype string // data type of the field (e.g., string, int, bool, map, array)
value string // value of the field as a string
}
struct Form #
struct Form {
pub:
id string
content IComponent
}
fn (Form) html #
fn (form Form) html() string
struct Group #
struct Group {
pub:
components []IComponent
}
fn (Group) html #
fn (group Group) html() string
struct Head #
struct Head {
pub:
title string
links []Link
scripts []Script
}
fn (Head) html #
fn (head Head) html() string
struct Heading #
struct Heading {
pub:
content string
level HeadingLevel
}
fn (Heading) html #
fn (heading Heading) html() string
struct HeadingGroup #
struct HeadingGroup {
pub:
components []IComponent
}
fn (HeadingGroup) html #
fn (component HeadingGroup) html() string
struct IFrame #
struct IFrame {
pub mut:
source string
}
fn (IFrame) html #
fn (iframe IFrame) html() string
struct Image #
struct Image {
pub:
typ ImageType
source string
}
fn (Image) html #
fn (image Image) html() string
struct IncrementalInput #
struct IncrementalInput {
pub:
label string
typ string
}
fn (IncrementalInput) html #
fn (input IncrementalInput) html() string
struct Input #
struct Input {
pub:
id string
name string
label string
placeholder string
required bool
typ string
value string
}
fn (Input) html #
fn (input Input) html() string
struct KanbanViewData #
struct KanbanViewData {
pub:
swimlanes []Swimlane
events []Event
}
fn (KanbanViewData) html #
fn (data KanbanViewData) html() string
struct Link #
struct Link {
rel string
@as string
href string
data_precedence string
fetch_priority string
}
fn (Link) html #
fn (link Link) html() string
struct ListItem #
struct ListItem {
children []IComponent
}
struct Markdown #
struct Markdown {
pub:
doc elements.Doc
}
fn (Markdown) html #
fn (md Markdown) html() string
struct MarkdownContent #
struct MarkdownContent {
pub mut:
nav string
content string
title string
}
struct Message #
struct Message {
pub:
timestamp string
sender string
content string
}
struct Opt #
struct Opt {
pub:
content string
value string
}
fn (Opt) html #
fn (option Opt) html() string
struct PDFViewer #
struct PDFViewer {
pub:
name string
pdf_url string
log_endpoint string
}
fn (PDFViewer) html #
fn (component PDFViewer) html() string
struct Page #
struct Page {
pub mut:
heading PageHeading
content IComponent
scripts []Script
}
fn (Page) html #
fn (page Page) html() string
struct PageHeading #
struct PageHeading {
pub:
title string
subtitle string
buttons []Button
breadcrumbs ?Breadcrumbs
}
fn (PageHeading) html #
fn (heading PageHeading) html() string
struct Paragraph #
struct Paragraph {
pub:
content string
}
struct Post #
struct Post {
pub:
timestamp string
user string
typ string @[json: 'type'] // Can be "text", "news", or "image"
content string
description string // Only for image posts, optional
}
struct Row #
struct Row {
pub:
cells []Cell
}
fn (Row) html #
fn (component Row) html() string
struct Script #
struct Script {
pub:
source string
async string
}
fn (Script) html #
fn (script Script) html() string
struct SearchBar #
struct SearchBar {
pub:
route string
}
fn (SearchBar) html #
fn (input SearchBar) html() string
struct Select #
struct Select {
pub:
name string
options []Opt
}
fn (Select) html #
fn (input Select) html() string
struct Sidebar #
struct Sidebar {
pub mut:
items []NavItem
}
fn (Sidebar) html #
fn (sidebar Sidebar) html() string
struct Struct #
struct Struct {
pub:
typ string
fields []Field
}
struct Swimlane #
struct Swimlane {
pub:
name string
color ColorEnum
}
struct Table #
struct Table {
pub:
headers []string
rows []Row
}
fn (Table) html #
fn (table Table) html() string
struct UnorderedList #
struct UnorderedList {
children []IComponent
}
struct Unpoly #
struct Unpoly {
pub:
up_link string
}
fn (Unpoly) html #
fn (unpoly Unpoly) html() string
struct View #
struct View {
pub mut:
head Head
layout ILayout
}
fn (View) html #
fn (view View) html() string
- fn icon_ellipsis
- fn kanban_example
- fn markdown
- fn to_struct
- interface IComponent
- interface ILayout
- interface IView
- enum HeadingLevel
- enum ImageType
- enum PriorityEnum
- struct Anchor
- struct Breadcrumbs
- struct Button
- struct Cell
- struct Chat
- struct Dashboard
- struct Dropdown
- struct Event
- struct Feed
- struct Field
- struct Form
- struct Group
- struct Head
- struct Heading
- struct HeadingGroup
- struct IFrame
- struct Image
- struct IncrementalInput
- struct Input
- struct KanbanViewData
- struct Link
- struct ListItem
- struct Markdown
- struct MarkdownContent
- struct Message
- struct Nav
- struct NavItem
- struct Navbar
- struct Opt
- struct PDFViewer
- struct Page
- struct PageHeading
- struct Paragraph
- struct Post
- struct Row
- struct Script
- struct SearchBar
- struct Select
- struct Sidebar
- struct Struct
- struct Swimlane
- struct Table
- struct UnorderedList
- struct Unpoly
- struct View