Skeletons in bulma

The b.SkeletonBlock constructor creates a block skeleton.

The b.SkeletonLines constructor creates a block of skeleton lines. It takes the number of lines as its only argument

Use the b.Skeleton modifier on any supported component to make it a skeleton. Use b.HasSkeleton for the has-skeleton class.

Bulma examples

Skeleton block

Example
Code
b.SkeletonBlock()
ResultHTML
Example
Code
b.SkeletonBlock(
	"Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.",
)
ResultHTML
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.

Skeleton lines

Example
Code
b.SkeletonLines(5)
ResultHTML

Bulma components with skeletons

Button

Example
Code
b.Buttons(
	b.Button(b.Skeleton, "Button"),
	b.Button(b.Link, b.Skeleton, "Link"),
	b.Button(b.Primary, b.Skeleton, "Primary"),
	b.Button(b.Success, b.Skeleton, "Success"),
	b.Button(b.Info, b.Skeleton, "Info"),
	b.Button(b.Warning, b.Skeleton, "Warning"),
	b.Button(b.Danger, b.Skeleton, "Danger"),
)
ResultHTML

Icon

Example
Code
fa.Icon(fa.Solid, "reply", b.Skeleton)
ResultHTML

Image

Example
Code
b.ImageImg("https://placehold.co/16x16", b.ImgSq16, b.Skeleton),
b.ImageImg("https://placehold.co/32x32", b.ImgSq32, b.Skeleton),
b.ImageImg("https://placehold.co/64x64", b.ImgSq64, b.Skeleton),
b.ImageImg("https://placehold.co/128x128", b.ImgSq128, b.Skeleton)
ResultHTML

Media object

Example
Code
b.Media(
	b.MediaLeft(
		b.ImageImg("https://placehold.co/128x128", html.P, b.ImgSq64, b.Skeleton),
	),
	b.Content(
		b.Skeleton,
		e.P(
			e.Strong("John Smith"), " ", e.Small("@johnsmith"), " ", e.Small("31m"),
			e.Br(),
			"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.",
		),
	),
	b.Level(
		b.Mobile,
		b.LevelLeft(
			e.A(fa.Icon(fa.Solid, "reply", b.Small, b.Skeleton)),
			e.A(fa.Icon(fa.Solid, "retweet", b.Small, b.Skeleton)),
			e.A(fa.Icon(fa.Solid, "heart", b.Small, b.Skeleton)),
		),
	),
	b.MediaRight(
		b.Delete(e.AriaLabel("delete"), b.Skeleton),
	),
)
ResultHTML

John Smith @johnsmith 31m
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.

Example
Code
b.Media(
	b.MediaLeft(b.ImageImg("https://placehold.co/128x128", html.P, b.ImgSq64, b.Skeleton)),
	b.Field(
		b.Control(
			html.P,
			b.Textarea(b.Skeleton, e.Placeholder("Add a comment...")),
		),
	),
	b.Level(
		b.LevelLeft(
			e.Div(
				b.ButtonA(b.Info, b.Skeleton, "Submit"),
			),
		),
		b.LevelRight(
			e.Div(
				b.Checkbox(
					b.OnLabel(b.Skeleton),
					"Press enter to submit",
				),
			),
		),
	),
)
ResultHTML

Notification

Example
Code
b.Notification(
	b.Skeleton,
	"Curabitur blandit tempus porttitor. Etiam porta sem malesuada magna mollis euismod. Cras justo odio, dapibus ac facilisis in, egestas eget quam.",
)
ResultHTML
Curabitur blandit tempus porttitor. Etiam porta sem malesuada magna mollis euismod. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

Tag

Example
Code
b.Tag(b.Skeleton, "Tag"), " ",
b.Tag(b.Link, b.Skeleton, "Link"), " ",
b.Tag(b.Primary, b.Skeleton, "Primary"), " ",
b.Tag(b.Info, b.Skeleton, "Info"), " ",
b.Tag(b.Success, b.Skeleton, "Success"), " ",
b.Tag(b.Warning, b.Skeleton, "Warning"), " ",
b.Tag(b.Danger, b.Skeleton, "Danger")
ResultHTML
Tag Link Primary Info Success Warning Danger

Title and subtitle

Example
Code
b.Title(b.Skeleton, "Title")
ResultHTML

Title

Example
Code
b.Title(b.HasSkeleton, "Title")
ResultHTML

Title

Example
Code
b.Subtitle(b.Skeleton, "Subtitle")
ResultHTML

Subtitle

Example
Code
b.Subtitle(b.HasSkeleton, "Subtitle")
ResultHTML

Subtitle

Example
Code
b.Title(b.Skeleton, b.Spaced, "Title"),
b.Subtitle(b.Skeleton, "Subtitle")
ResultHTML

Title

Subtitle

Example
Code
b.Title(b.HasSkeleton, b.Spaced, "Title"),
b.Subtitle(b.HasSkeleton, "Subtitle")
ResultHTML

Title

Subtitle

Form control

Example
Code
b.InputText(b.Skeleton)
ResultHTML
Example
Code
b.Textarea(b.Skeleton)
ResultHTML