Documentation ¶
Overview ¶
Package bs is a Bootstrap toolkit. It wraps Alert, Badge, Button, Card, List Group, Modal, Progress Bar, Spinner, and Table. It also implements Bootstrap utilities like size, spacing, text alignment, float, color and visibility.
Index ¶
- Constants
- func Center(elm *dom.Element) *dom.Element
- func Color(elm *dom.Element, color ...string) *dom.Element
- func Float(elm *dom.Element, side string, vs ...string) *dom.Element
- func Height(elm *dom.Element, size string) *dom.Element
- func Margin(elm *dom.Element, side string, size string, vs ...string) *dom.Element
- func NegativeMargin(elm *dom.Element, side string, size string, vs ...string) *dom.Element
- func Padding(elm *dom.Element, side string, size string, vs ...string) *dom.Element
- func RemoveCenter(elm *dom.Element) *dom.Element
- func RemoveColor(elm *dom.Element, color ...string) *dom.Element
- func RemoveFloat(elm *dom.Element, side string, vs ...string) *dom.Element
- func RemoveHeight(elm *dom.Element) *dom.Element
- func RemoveMargin(elm *dom.Element, side string, size string, vs ...string) *dom.Element
- func RemoveNegativeMargin(elm *dom.Element, side string, size string, vs ...string) *dom.Element
- func RemovePadding(elm *dom.Element, side string, size string, vs ...string) *dom.Element
- func RemoveTextAlign(elm *dom.Element, side string, vs ...string) *dom.Element
- func RemoveVerticalAlign(elm *dom.Element, side string) *dom.Element
- func RemoveWidth(elm *dom.Element) *dom.Element
- func TextAlign(elm *dom.Element, side string, vs ...string) *dom.Element
- func VerticalAlign(elm *dom.Element, side string) *dom.Element
- func Width(elm *dom.Element, size string) *dom.Element
- type Component
- func (obj *Component) Center() *Component
- func (obj *Component) Color(color ...string) *Component
- func (obj *Component) Float(side string, vs ...string) *Component
- func (obj *Component) Height(size string) *Component
- func (obj *Component) Hide() *Component
- func (obj *Component) Margin(side string, size string, vs ...string) *Component
- func (obj *Component) NegativeMargin(side string, size string, vs ...string) *Component
- func (obj *Component) On(event string, fn func(*js.Event))
- func (obj *Component) OnHide(cb func(*Component))
- func (obj *Component) OnShow(cb func(*Component))
- func (obj *Component) Padding(side string, size string, vs ...string) *Component
- func (obj *Component) RemoveCenter() *Component
- func (obj *Component) RemoveColor(color ...string) *Component
- func (obj *Component) RemoveFloat(side string, vs ...string) *Component
- func (obj *Component) RemoveHeight() *Component
- func (obj *Component) RemoveMargin(side string, size string, vs ...string) *Component
- func (obj *Component) RemoveNegativeMargin(side string, size string, vs ...string) *Component
- func (obj *Component) RemovePadding(side string, size string, vs ...string) *Component
- func (obj *Component) RemoveTextAlign(side string, vs ...string) *Component
- func (obj *Component) RemoveVerticalAlign(side string) *Component
- func (obj *Component) RemoveWidth() *Component
- func (obj *Component) Show() *Component
- func (obj *Component) TextAlign(side string, vs ...string) *Component
- func (obj *Component) VerticalAlign(side string) *Component
- func (obj *Component) Width(size string) *Component
- type Style
Constants ¶
const ( VSExtraSmall = "" VSSmall = "sm" VSMedium = "md" VSLarge = "lg" VSExtraLarge = "xl" )
pre-defined viewport size values.
const ( SideLeft = "left" SideRight = "right" SideTop = "top" SideBottom = "bottom" SideCenter = "center" SideNone = "none" // margin, padding SideNegative = "n" SideBlank = "" SideAll = "" SideX = "x" SideY = "y" // vertical alignment SideMiddle = "middle" SideBaseline = "baseline" SideTextTop = "text-top" SideTextBottom = "text-bottom" // flex justify content. SideStart = "start" SideEnd = "end" SideBetween = "between" SideAround = "around" SideStretch = "stretch" )
pre-defined position values.
const ( // for margin and padding Size0 = "0" Size1 = "1" Size2 = "2" Size3 = "3" Size4 = "4" Size5 = "5" // for width and height Size25 = "25" Size50 = "50" Size75 = "75" Size100 = "100" SizeAuto = "auto" )
pre-defined bootstrap size values.
const ( FGPrimary = "text-primary" FGSecondary = "text-secondary" FGSuccess = "text-success" FGDanger = "text-danger" FGWarning = "text-warning" FGInfo = "text-info" FGLight = "text-light" FGDark = "text-dark" FGBody = "text-body" FGMuted = "text-muted" FGWhite = "text-white" FGHalfBlack = "text-black-50" FGHalfWhite = "text-white-50" BGPrimary = "bg-primary" BGSecondary = "bg-secondary" BGSuccess = "bg-success" BGDanger = "bg-danger" BGWarning = "bg-warning" BGInfo = "bg-info" BGLight = "bg-light" BGDark = "bg-dark" BGWhite = "bg-white" BGTransparent = "bg-transparent" )
pre-defined values.
Variables ¶
This section is empty.
Functions ¶
func NegativeMargin ¶
NegativeMargin add negative margin style to element.
func RemoveCenter ¶
RemoveCenter removes horizontally centering style from element.
func RemoveColor ¶
RemoveColor removes foreground, backgroup or gradient colors from element.
func RemoveFloat ¶
RemoveFloat removes float style from element.
func RemoveHeight ¶
RemoveHeight removes height style.
func RemoveMargin ¶
RemoveMargin removes margin style from element.
func RemoveNegativeMargin ¶
RemoveNegativeMargin removes negative margin style from element.
func RemovePadding ¶
RemovePadding removes paddind style from element.
func RemoveTextAlign ¶
RemoveTextAlign removes text alignment style from element.
func RemoveVerticalAlign ¶
RemoveVerticalAlign removes vertical alignment style to inline, inline-block, inline-table, and table cell elements.
func RemoveWidth ¶
RemoveWidth removes width style from element.
func VerticalAlign ¶
VerticalAlign adds vertical alignment style to inline, inline-block, inline-table, and table cell elements.
Types ¶
type Component ¶
Component represents Bootstrap component.
func ComponentOf ¶
ComponentOf returns a Bootstrap component.
func (*Component) NegativeMargin ¶
NegativeMargin add negative margin style to component.
func (*Component) RemoveCenter ¶
RemoveCenter removes horizontally centering style from component.
func (*Component) RemoveColor ¶
RemoveColor removes foreground, backgroup or gradient colors from component.
func (*Component) RemoveFloat ¶
RemoveFloat removes float style from component.
func (*Component) RemoveHeight ¶
RemoveHeight removes height style from component.
func (*Component) RemoveMargin ¶
RemoveMargin removes margin style from component.
func (*Component) RemoveNegativeMargin ¶
RemoveNegativeMargin removes negative margin style from component.
func (*Component) RemovePadding ¶
RemovePadding removes paddind style from component.
func (*Component) RemoveTextAlign ¶
RemoveTextAlign removes text alignment style from component.
func (*Component) RemoveVerticalAlign ¶
RemoveVerticalAlign removes vertical alignment style to inline, inline-block, inline-table, and table cell elements.
func (*Component) RemoveWidth ¶
RemoveWidth removes width style from component.
func (*Component) VerticalAlign ¶
VerticalAlign adds vertical alignment style to inline, inline-block, inline-table, and table cell elements.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package alert wraps Bootstrap Alert component
|
Package alert wraps Bootstrap Alert component |
Package badge wraps Bootstrap Badge component
|
Package badge wraps Bootstrap Badge component |
Package button wraps Bootstrap Button component.
|
Package button wraps Bootstrap Button component. |
Package card wraps Bootstrap Card component.
|
Package card wraps Bootstrap Card component. |
Package list wraps Bootstrap List Group component.
|
Package list wraps Bootstrap List Group component. |
Package modal wraps Bootstrap Modal component.
|
Package modal wraps Bootstrap Modal component. |
Package progress wraps Bootstrap Progress component.
|
Package progress wraps Bootstrap Progress component. |
Package spinner wraps Bootstrap spinner component.
|
Package spinner wraps Bootstrap spinner component. |
Package table wraps Bootstrap default Table Content.
|
Package table wraps Bootstrap default Table Content. |