John Smith
@johnsmith
The b.Card
constructor creates a card.
Child | Action |
---|---|
b.OnCard(...any) | Apply children to the <div class="card"> element |
b.OnContent(...any) | Apply children to the current <div class="card-content"> element |
b.SplitContent() | Force starting a new <div class="card-content"> element |
b.CardHeader(...any) | Apply children to the <header class="card-header"> element |
b.CardHeaderIcon(...any | Apply an icon to the <header class="card-header"> element |
b.CardHeaderTitle(...any) | Add a title to the <header class="card-header"> element |
b.CardFooter(...any) | Apply children to the <header class="card-footer"> element |
b.CardImage(...any) | Add image to the <div class="card"> element |
b.CardImageImg(...any) | Add image to the <div class="card"> element |
e.Element | Add element to the <div class="card-content"> element |
gomponents.Node of type gomponents.AttributeType | Apply child to the <div class="card"> element |
gomponents.Node of type gomponents.ElementType | Apply child to the <div class="card-content"> element |
Anything else | Apply child to the <div class="card-content"> element |
The b.CardHeader
function marks children as being part of the card header.
Child | Action |
---|---|
b.IconElem | Add this icon as the card header icon |
string | Add this text as the card header title |
Anything else | Apply child to the card header |
The b.CardHeaderIcon
constructor creates a card header icon element, as an alternative to providing an icon to b.CardHeader
, allowing to customize the icon. The b.CardHeaderTitle
constructor creates a card header title element, as an alternative to providing a string to b.CardHeader
, allowing to customize the title.
The b.CardImage
constructor creates an image by calling b.Image
and wrapping it into a card image element. The b.CardImageImg
constructor creates an image by calling b.ImageImg
and wrapping it into a card image element.
Child | Action |
---|---|
b.OnCardImage(...any) | Apply children to the <div class="card-image"> element |
Anything else | Apply children to the <figure class="image"> element |
b.Card( b.CardImage( b.Img4By3, e.ImgSrc( "https://bulma.io/assets/images/placeholders/1280x960.png", e.Alt("Placeholder image"), ), ), b.Media( b.MediaLeft( b.ImageImg( "https://bulma.io/assets/images/placeholders/96x96.png", e.Alt("Placeholder image"), ), ), b.Title(4, html.P, "John Smith"), b.Subtitle(6, html.P, "@johnsmith"), ), b.Content( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec iaculis mauris. ", e.A("@bulmaio"), ". ", e.AHref("#", "#css"), " ", e.AHref("#", "#responsive"), e.Br(), e.Time(gomponents.Attr("datetime", "2016-1-1"), "11:09 PM - 1 Jan 2016"), ), )
John Smith
@johnsmith
<div class="card"><div class="card-image"><figure class="image is-4by3"><img src="https://bulma.io/assets/images/placeholders/1280x960.png" alt="Placeholder image"></figure></div><div class="card-content"><article class="media"><div class="media-left"><figure class="image" alt="Placeholder image"><img src="https://bulma.io/assets/images/placeholders/96x96.png"></figure></div><div class="media-content"><p class="title">John Smith</p><p class="subtitle">@johnsmith</p></div></article><div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec iaculis mauris. <a>@bulmaio</a>. <a href="#">#css</a> <a href="#">#responsive</a><br><time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time></div></div></div>
b.Block( b.Card( b.CardHeader( b.CardHeaderTitle( "Card header", ), b.CardHeaderIcon( e.AriaLabel("more options"), fa.Icon(fa.Solid, "angle-down"), ), ), ), ), b.Block( b.Card( b.CardHeader( "Card header", fa.Icon(fa.Solid, "angle-down"), ), ), ), b.Block( b.Card( b.CardHeaderTitle("Card header"), b.CardHeaderIcon( e.AriaLabel("more options"), fa.Icon(fa.Solid, "angle-down"), ), ), )
Card header
Card header
Card header
<div class="block"><div class="card"><header class="card-header"><p class="card-header-title">Card header</p><button class="card-header-icon" aria-label="more options"><span class="icon"><i class="fa-angle-down fa-solid"></i></span></button></header></div></div> <div class="block"><div class="card"><header class="card-header"><p class="card-header-title">Card header</p><button class="card-header-icon"><span class="icon"><i class="fa-angle-down fa-solid"></i></span></button></header></div></div> <div class="block"><div class="card"><header class="card-header"><p class="card-header-title">Card header</p><button class="card-header-icon" aria-label="more options"><span class="icon"><i class="fa-angle-down fa-solid"></i></span></button></header></div></div>
b.Card( b.MarginBottom(4), b.CardImage( b.Img4By3, e.ImgSrc( "https://bulma.io/assets/images/placeholders/1280x960.png", html.Alt("Placeholder image"), ), ), ), b.Card( b.CardImageImg( "https://bulma.io/assets/images/placeholders/1280x960.png", b.Img4By3, ), )
<div class="card mb-4"><div class="card-image"><figure class="image is-4by3"><img src="https://bulma.io/assets/images/placeholders/1280x960.png" alt="Placeholder image"></figure></div></div> <div class="card"><div class="card-image"><figure class="image is-4by3"><img src="https://bulma.io/assets/images/placeholders/1280x960.png"></figure></div></div>
b.Card( b.Content( "Lorem ipsum leo risus, porta ac consectetur ac, vestibulum at eros. Donec id elit non mi porta gravida at eget metus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum.", ), )
Lorem ipsum leo risus, porta ac consectetur ac, vestibulum at eros. Donec id elit non mi porta gravida at eget metus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum.
<div class="card"><div class="card-content"><div class="content"><p>Lorem ipsum leo risus, porta ac consectetur ac, vestibulum at eros. Donec id elit non mi porta gravida at eget metus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum.</p></div></div></div>
b.Card( b.CardFooter( e.AHref("#", "Save"), e.AHref("#", "Edit"), e.AHref("#", "Delete"), ), )
<div class="card"><footer class="card-footer"><a class="card-footer-item" href="#">Save</a><a class="card-footer-item" href="#">Edit</a><a class="card-footer-item" href="#">Delete</a></footer></div>
b.Card( b.CardHeader( "Component", b.CardHeaderIcon( e.AriaLabel("more options"), fa.Icon(fa.Solid, "angle-down"), ), ), b.Content( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec iaculis mauris. ", e.A("@bulmaio"), ". ", e.AHref("#", "#css"), " ", e.AHref("#", "#responsive"), e.Br(), e.Time(gomponents.Attr("datetime", "2016-1-1"), "11:09 PM - 1 Jan 2016"), ), b.CardFooter( e.AHref("#", "Save"), e.AHref("#", "Edit"), e.AHref("#", "Delete"), ), )
Component
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec iaculis mauris.
@bulmaio.
#css#responsive
<div class="card"><header class="card-header"><p class="card-header-title">Component</p><button class="card-header-icon" aria-label="more options"><span class="icon"><i class="fa-solid fa-angle-down"></i></span></button></header><div class="card-content"><div class="content"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec iaculis mauris. </p><a>@bulmaio</a><p>. </p><a href="#">#css</a><p> </p><a href="#">#responsive</a><br><time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time></div></div><footer class="card-footer"><a class="card-footer-item" href="#">Save</a><a class="card-footer-item" href="#">Edit</a><a class="card-footer-item" href="#">Delete</a></footer></div>
b.Card( b.Title(html.P, "“There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.”"), b.Subtitle(html.P, "Jeff Atwood"), b.CardFooter( e.P( e.Span( "View on ", e.AHref("https://twitter.com/codinghorror/status/506010907021828096", "Twitter"), ), ), e.P( e.Span( "Share on ", e.AHref("#", "Facebook"), ), ), ), )
“There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.”
Jeff Atwood
<div class="card"><div class="card-content"><p class="title">“There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.”</p><p class="subtitle">Jeff Atwood</p></div><footer class="card-footer"><p class="card-footer-item"><span>View on <a href="https://twitter.com/codinghorror/status/506010907021828096">Twitter</a></span></p><p class="card-footer-item"><span>Share on <a href="#">Facebook</a></span></p></footer></div>