Brand
The {SUBDOMAIN}.MD wordmark the mattdowney.com projects share. Any other site puts its own logo in the header's brand slot.
Installation
$
npx shadcn@latest add https://ui.mattdowney.com/r/brand.jsonUsage
import { Brand } from "@/components/ui/brand"Examples
Default
It takes the size and colour of the text around it. Pass the subdomain as name; it is upper-cased for you.
UI.MDSKILLS.MD
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | "UI" | The subdomain, shown upper-cased before .MD. |
| weight | "normal" | "medium" | "semibold" | "bold" | "normal" | Font weight. normal keeps the weight of the text around it. |
| className | string | - | Extra classes on the span. |
namestring = "UI"The subdomain, shown upper-cased before .MD. |
weight"normal" | "medium" | "semibold" | "bold" = "normal"Font weight. normal keeps the weight of the text around it. |
| classNamestringExtra classes on the span. |
import { cn } from "@/registry/lib/utils"
export type BrandWeight = "normal" | "medium" | "semibold" | "bold"
const WEIGHT: Record<BrandWeight, string> = {
normal: "",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
}
/**
* The {SUBDOMAIN}.MD wordmark shared by every project on mattdowney.com:
* UI.MD lives at ui.mattdowney.com, SKILLS.MD at skills.mattdowney.com, and
* so on. Rendered as a single inline span so the mark stays consistent
* everywhere; `name` is upper-cased here so the all-caps convention cannot
* drift per call site. Pass `weight` to match the surrounding emphasis
* (`normal` inherits it).
*/
// @use-when the {SUBDOMAIN}.MD wordmark on a mattdowney.com project. Any other
// site puts its own logo in SiteHeader's `brand` slot instead.
function Brand({
name = "UI",
weight = "normal",
className,
}: {
name?: string
weight?: BrandWeight
className?: string
}) {
return (
<span data-slot="brand" className={cn("tracking-tight", WEIGHT[weight], className)}>
{/* One expression, not `{name}.MD`: two JSX text children render with an
HTML comment between them (`SKILLS<!-- -->.MD`), which breaks any
crawler doing a contiguous text match on the wordmark, Google's
OAuth brand check among them. */}
{`${name.toUpperCase()}.MD`}
</span>
)
}
export { Brand }