Spacer

@sushindustries/ui

Vertical space on the scale, optionally with a rule and a label. Built for Markdown.

5 min read
View as MarkdownEdit on GitHub

Examples are the tab where the component is shown doing a job, not demonstrating a prop. The API tab already lists the props.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/spacer.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/spacer.json

Press Compare. The frames are real viewports, so a layout that breaks at 320 breaks here too rather than in somebody's hands.

In a page

import { Spacer } from "@sushindustries/ui";

export function Article({ intro, body }: { intro: string; body: string }) {
	return (
		<article className="prose">
			<p>{intro}</p>
			<Spacer size={6} label="Later" />
			<p>{body}</p>
		</article>
	);
}
tsx

What this example is not

This is the JSX form, for the rare case of composing SpacerSpacerVertical space on the scale, optionally with a rule and a label. For Markdown, where there is no markup to hang a margin on.@sushindustries/ui · layout directly inside a hand-written page. Its home is Markdown - the <!-- ::start:spacer size="6" label="Later" --><!-- ::end:spacer --> block this site's own posts and docs pages use - because that is where there is no markup left to hang a margin on.

Used byGridGridA responsive grid with no breakpoints in it. One number decides the column count at every width.@sushindustries/ui · layout