barakoCMS

The block library

The block library

Every site gets these, compiled in from the primitives. None of them is code, so a site that wants one to look different saves its own under the same name and that one wins.

Block What it is Props
hero The band at the head of a page heading, body, image, imageAlt, primaryLabel, primaryHref, secondaryLabel, secondaryHref, tone, columns, align, padding
band Copy with one call to action tone, heading, body, label, href, align, padding, width
statBand A row of figures heading, tone, columns, padding, items
cardGrid Cards from a collection heading, collection, filterField, filterValue, empty, tone, columns, padding, hueRotate, option
peopleGrid People from a collection, typed in place, or both heading, collection, filterField, filterValue, role, tone, columns, padding, items
timeline Dated entries heading, tone, padding, width, items
steps Numbered entries heading, tone, padding, width, items
tiers Giving or pricing tiers heading, tone, columns, padding, items
keyValueTable A panel of facts heading, tone, padding, radius, rows
tabs Sections that open heading, tone, padding, width, items
announcement The one line above everything, and it stays there message, label, href, tone, edge, align
codeTabs A snippet to run, with the other ways behind it heading, body, code, language, selectLabel, tone, padding, width, items
progressList How far along each entry of a collection is heading, collection, filterField, filterValue, empty, tone, padding, width
changelogList Release entries, with the word for the kind of release heading, collection, filterField, filterValue, empty, tone, padding, width
faq Questions, all openable at once heading, body, tone, padding, width, items
map An embedded map, held to embedHosts src, title, heading, aspect, tone, padding
stat One figure and its label value, label, align, motion
timelineEntry One dated entry date, title, body
step One numbered step number, title, body
tier One tier name, amount, body, label, href, tone
person One person name, role, photo, href, linkLabel, align
keyValueRow One fact label, value
codeTab One more way to run it label, code, language, selectLabel, group
faqItem One question and its answer question, answer, tone

The blocks in the second half go in the first half's slots: stats in a statBand, entries in a timeline, disclosure blocks in tabs, codeTab blocks in codeTabs, faqItem blocks in faq. A card grid reads its entries through {{item.Title}}, {{item.Summary}}, {{item.Date | date}} and {{item.Href}}, so it works against whatever the tenant calls those fields, and it takes the collection as a prop rather than knowing any name. {{item.Href}} is the collection's href field when it has one, and the item's own route otherwise, so a collection with no route on this site (one filled by a sync, say) still gets a working card once its entries carry their own link.

Set a card grid's option to show and each card carries the glyph and the word the site declared for that entry's option, read through {{item.Icon}} and {{item.Word}}. With filterField and filterValue picking the category, that is a module grid: one band per category, each card marked with its own. It is off by default, so a grid that did not ask for it draws what it always drew.

progressList reads its figure through {{item.Progress}}, which is the collection's progress field role: the tenant says which of its own fields holds a number from 0 to 100. Where a source gives two counts instead, progressCount and progressTotal carry those through and the bar does the division, so a GitHub milestone's open and closed issues need no field computing a percentage first. changelogList does not group by itself, because grouping means knowing which field holds the kind and that is the tenant's field name. One band per kind with filterField and filterValue is the grouping, and the chip on each entry is the option's own word.