Button
Button component - used in forms or as part of navigation. Icons in buttons are placed using a component IconButton.
ButtonBosons
Color
Color from the Tailwind palette.
type:
string
default:
primary
values:
primary, secondary, warning, info, success, danger
Size
Button size.
type:
string
default:
md
values:
xs, sm, md, lg, xl, full
Type
Button type.
type:
string
default:
button
values:
button, submit
Tag
Type of html tag.
type:
string
default:
button
values:
button, a
Rounded
Determines the rounding of the button.
type:
bool
default:
false
Outline
Alternative setting - color arrangement with a clear border.
type:
bool
default:
false
Light
Setting an alternative color arrangement.
type:
bool
default:
false
Disabled
Allows you to deactivate the button.
type:
bool
default:
false
Icononly
It only leaves the default area for the icon.
type:
bool
default:
false
Full
Sets the button width to 100% of the available area.
type:
bool
default:
false
Reverse
Changes the order of the icon and text.
type:
bool
default:
false
Title
Button text.
type:
string
Attrs
Sets attributes in the html tag.
type:
gopress.Attrs
Examples
Default button with sizes
xs
sm
md
lg
xl
1// Default Button with medium size
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Size: "md",
6 Title: "Button",
7 },
8)
Light variant of button
xs
sm
md
lg
xl
1// Light variant
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Size: "md",
6 Title: "Button",
7 Light: true,
8 },
9)
Light variant of button
xs
sm
md
lg
xl
1// Outline variant
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Size: "md",
6 Title: "Button",
7 Outline: true,
8 },
9)
Color variant of button
primary
secondary
warning
danger
success
info
1// Colors of Button (widh default md size)
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Color: "primary",
6 Title: "Primary",
7 },
8)
Color light variant of button
primary
secondary
warning
danger
success
info
1// Light color variant (widh default md size)
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Color: "primary",
6 Title: "Primary",
7 Light: true,
8 },
9)
Color outline variant of button
primary
secondary
warning
danger
success
info
1// Outline color variant (widh default md size)
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Color: "primary",
6 Title: "Primary",
7 Outline: true,
8 },
9)
Disabled variant of button
default
light
outine
1// Disabled variant
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Color: "primary",
6 Title: "Primary",
7 Disabled: true,
8 },
9)
Rounded variant of button
default
light
outine
1// Rounded variant
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Color: "primary",
6 Title: "Primary",
7 Rounded: true,
8 },
9)
Buttons with an icon
default
light
outine
1// Button with icon
2
3@atoms.ButtonIcon(
4 &atoms.ButtonBosons{
5 Title: "Primary",
6 },
7) {
8 @icons.IconCheck()
9}
Buttons with an icon on the right (reverse)
default
light
outine
1// Button with reverse icon
2
3@atoms.ButtonIcon(
4 &atoms.ButtonBosons{
5 Reverse: true,
6 Title: "Primary",
7 },
8) {
9 @icons.IconCheck()
10}
Buttons icon only
default
light
outine
default
light
outine
1// Button with icon only
2
3@atoms.ButtonIcon(
4 &atoms.ButtonBosons{
5 Icononly: true
6 },
7) {
8 @icons.IconCheck()
9}
Buttons full width
1// Full variant
2
3@atoms.Button(
4 &atoms.ButtonBosons{
5 Title: "Button text",
6 Full: true,
7 },
8)