BlogMasthead
A blog's masthead as composable parts.
Small fixes for small services, written down.
View code
<BlogMasthead>
<BlogMasthead.Mark>
<FeatherIcon aria-hidden="true" />
</BlogMasthead.Mark>
<BlogMasthead.Title>
<BlogMasthead.TitleLink href="/">Field Notes</BlogMasthead.TitleLink>
</BlogMasthead.Title>
<BlogMasthead.Tagline>Small fixes for small services, written down.</BlogMasthead.Tagline>
<BlogMasthead.Art aria-hidden="true" mix={hills()} />
</BlogMasthead>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { BlogMasthead } from "@sdxc/ui/blog";Renders the masthead as a <header> laying out the parts it is given: a
BlogMasthead.Mark in a column of its own beside the title and tagline, which stack
in the order written, and a BlogMasthead.Art band across the full width wherever it
is written. A part left out leaves no gap.
Composition
The parts the component publishes, each a static property of the host.
BlogMastheadBlogMasthead.MarkThe blog's logo or glyph, in the brand colour; an SVG inside is drawn 2.75rem square.BlogMasthead.TitleThe blog's name as a large paragraph, so each page keeps its own title as the oneh1.BlogMasthead.TitleLinkThe title's link home, in the emphasis colour and the brand colour under the pointer.BlogMasthead.TaglineOne line under the title saying what the blog is about, in the muted colour.BlogMasthead.ArtA band across the masthead's full width, such as a drawn header image, clipped to rounded corners and spaced 1.25rem from the title block.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
Also accepts everything in TagProps<"header">.
BlogMasthead.Mark
Also accepts everything in TagProps<"span">.
BlogMasthead.Title
Also accepts everything in TagProps<"p">.
BlogMasthead.TitleLink
BlogMasthead.Tagline
Also accepts everything in TagProps<"p">.
BlogMasthead.Art
Also accepts everything in TagProps<"div">.