Showcase

@sushindustries/ui

A component at every width it has to survive, with its source, install commands, and a live StackBlitz editor.

8 min read
View as MarkdownEdit on GitHub

Install commands are on Home, attached from the registry - they are not written here, because a second copy is a copy that goes stale. This tab starts after the install worked.

Use it

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

export function Example() {
	return (
		<Showcase
			src="/preview/card"
			title="Card"
			code={`<Card>...</Card>`}
			install={{ tanstack: "pnpm dlx @tanstack/cli add card" }}
		/>
	);
}
tsx

src has to point at a real route that renders the component alone, with nothing else on the page - that route is the app's to build, not something this component generates.

What you should see

A bar with Preview and Code tabs, a row of width buttons, and Compare selected by default: four to six framed iframes side by side, each labelled with its width and why that width was picked. Switch to Code and the same component renders again next to its source, with a copy button over the block. If install was passed, a row of copyable commands sits under whichever tab is open.

If nothing happens

The frames stay blank when src does not resolve to a real page - a typo in the route, or a preview page that was never built for this component. Check the Preview tab first with the browser's own devtools open on the iframe; a 404 inside the frame looks identical to an empty component from the outside.

UsesIconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · contentCopy ButtonCopy ButtonA glass chip that writes to the clipboard and confirms in the button itself, then hands back.@sushindustries/ui · contentDeviceDeviceA phone, a tablet or a laptop in CSS 3D, chosen by the stylesheet rather than by JavaScript, whose screen is a real scroll container with real controls in it.@sushindustries/ui · layoutuseDeviceKinduseDeviceKindWhich machine the stylesheet is currently drawing, as a value. Null until mounted, on purpose - a default would be a claim the server cannot support.@sushindustries/ui · layout