Level

The b.Level constructor creates a level.

ChildAction
b.LevelLeft(...any)Apply children to the <div class="level-left"> element
b.LevelRight(...any)Apply children to the <div class="level-right"> element
e.ElementAdd the level-item class to the element and apply the element to the <nav class="level"> element
stringWrap text into an <p> element with class level-item and apply it to the <nav class="level"> element
gomponents.Nodeof type gomponents.AttributeTypeApply attribute to the <nav class="level"> element
gomponents.Nodeof type gomponents.ElementTypeWrap element into a <div> element with class level-item and apply it to the <nav class="level"> element
Anything elseApply child to the <nav class="level"> element

The b.LevelLeft and b.LevelRight functions create content for the level left or right sections.

ChildAction
e.ElementAdd the level-item class to the element
stringWrap text into an <p> element with class level-item
gomponents.Nodeof type gomponents.AttributeTypeApply attribute to the level section
gomponents.Nodeof type gomponents.ElementTypeWrap element into a <div> element with class level-item

Bulma examples

Example
ResultHTML
Code
b.Level(
	b.LevelLeft(
		e.Div(
			b.Subtitle(5, e.Strong("123"), " posts"),
		),
		e.Div(
			b.Field(
				b.Addons,
				b.Control(b.InputText(e.Placeholder("Find a post"))),
				b.Control(b.Button("Search")),
			),
		),
	),
	b.LevelRight(
		e.P(e.Strong("All")),
		e.P(e.A("Published")),
		e.P(e.A("Drafts")),
		e.P(e.A("Deleted")),
		e.P(b.ButtonA(b.Success, "New")),
	),
)

Centered level

Example
ResultHTML
Code
b.Level(
	e.Div(
		b.TextCentered,
		e.Div(e.P("Tweets"), b.Title(html.P, "3,456")),
	),
	e.Div(
		b.TextCentered,
		e.Div(e.P("Following"), b.Title(html.P, "123")),
	),
	e.Div(
		b.TextCentered,
		e.Div(e.P("Followers"), b.Title(html.P, "456K")),
	),
	e.Div(
		b.TextCentered,
		e.Div(e.P("Likes"), b.Title(html.P, "789")),
	),
)
Example
ResultHTML
Code
b.Level(
	e.P(b.TextCentered, e.A("Home")),
	e.P(b.TextCentered, e.A("Menu")),
	e.P(e.ImgSrc("https://bulma.io/assets/images/bulma-type.png", e.Alt(""), e.Styles{"height": "30px"})),
	e.P(b.TextCentered, e.A("Reservations")),
	e.P(b.TextCentered, e.A("Contact")),
)

Mobile level

Example
ResultHTML
Code
b.Level(
	b.Mobile,
	e.Div(
		b.TextCentered,
		e.Div(e.P("Tweets"), b.Title(html.P, "3,456")),
	),
	e.Div(
		b.TextCentered,
		e.Div(e.P("Following"), b.Title(html.P, "123")),
	),
	e.Div(
		b.TextCentered,
		e.Div(e.P("Followers"), b.Title(html.P, "456K")),
	),
	e.Div(
		b.TextCentered,
		e.Div(e.P("Likes"), b.Title(html.P, "789")),
	),
)