cards
This commit is contained in:
parent
f03b933359
commit
aa651083cd
7 changed files with 330 additions and 1 deletions
|
|
@ -304,6 +304,103 @@ type FormtablerValidationStates struct {
|
|||
Lite bool
|
||||
}
|
||||
|
||||
// FormtablerCardStatus represents a status bar on the card.
|
||||
type FormtablerCardStatus struct {
|
||||
Position string // "top", "bottom", "start"
|
||||
Color string // "blue", "red", "green", "yellow", etc.
|
||||
}
|
||||
|
||||
// FormtablerCardHeader represents a card header section.
|
||||
type FormtablerCardHeader struct {
|
||||
Title string
|
||||
// Tab-based header
|
||||
UseTabs bool
|
||||
Tabs []FormtablerCardTab
|
||||
// Pill-based header
|
||||
UsePills bool
|
||||
Pills []FormtablerCardTab
|
||||
}
|
||||
|
||||
// FormtablerCardTab represents a single tab/pill in a card header.
|
||||
type FormtablerCardTab struct {
|
||||
Title string
|
||||
Active bool
|
||||
Disabled bool
|
||||
Link string
|
||||
}
|
||||
|
||||
// FormtablerCardAlert represents an alert inside a card.
|
||||
type FormtablerCardAlert struct {
|
||||
Text string
|
||||
Type string // "success", "info", "warning", "danger"
|
||||
}
|
||||
|
||||
// FormtablerCardImage represents an image at top or bottom of a card.
|
||||
type FormtablerCardImage struct {
|
||||
Position string // "top", "bottom"
|
||||
Src string
|
||||
Ratio string // "21x9", "4x3", etc.
|
||||
}
|
||||
|
||||
// FormtablerCardFooter represents a card footer.
|
||||
type FormtablerCardFooter struct {
|
||||
Text string // simple footer text
|
||||
// Single button
|
||||
Button string
|
||||
ButtonLink string
|
||||
// Two buttons (Cancel / Action)
|
||||
ButtonsCancel string
|
||||
ButtonsAction string
|
||||
ButtonsActionLink string
|
||||
// Elements row (switch, check, avatars, more)
|
||||
HasSwitch bool
|
||||
HasCheck bool
|
||||
HasAvatars bool
|
||||
HasMore bool
|
||||
}
|
||||
|
||||
// FormtablerCardBody represents the body content of a card.
|
||||
type FormtablerCardBody struct {
|
||||
Title string
|
||||
Subtitle string
|
||||
Text string
|
||||
HasButton bool
|
||||
ButtonText string
|
||||
ButtonLink string
|
||||
}
|
||||
|
||||
// FormtablerCardProgress represents a progress bar in the card.
|
||||
type FormtablerCardProgress struct {
|
||||
Percent int
|
||||
Color string
|
||||
}
|
||||
|
||||
// FormtablerCard represents a single card component.
|
||||
// All fields are populated by the caller; the template renders based on what it finds.
|
||||
type FormtablerCard struct {
|
||||
// Outer attributes
|
||||
Link string // if set, card is an <a href> instead of <div>
|
||||
Active bool
|
||||
Inactive bool
|
||||
Class string
|
||||
// Empty state
|
||||
Empty bool
|
||||
// Image top/bottom
|
||||
Image *FormtablerCardImage
|
||||
// Status bar
|
||||
Status *FormtablerCardStatus
|
||||
// Header
|
||||
Header *FormtablerCardHeader
|
||||
// Alert
|
||||
Alert *FormtablerCardAlert
|
||||
// Body
|
||||
Body *FormtablerCardBody
|
||||
// Footer
|
||||
Footer *FormtablerCardFooter
|
||||
// Progress
|
||||
Progress *FormtablerCardProgress
|
||||
}
|
||||
|
||||
// FormtablerFormElementsPage is the page-specific struct for the form elements demo.
|
||||
// Each field is one of the 25 form element groups.
|
||||
type FormtablerFormElementsPage struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue