BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/mrdoge-ui/entity-image

Entity Image

mrdoge-ui/entity-image
FreeComponent

Team or region logo, unstyled; falls back to initials when the image is missing.

Install it

npx shadcn@latest add https://mrdoge.co/r/entity-image.json

Source

registry/mrdoge-ui/entity-image/entity-image.tsxmrdoge.co/r/entity-image.json
1"use client"
2
3import { useState } from "react"
4import { cn } from "@/lib/utils"
5
6export interface EntityImageProps {
7 src?: string | null
8 /** Used for the alt text and the initials fallback. */
9 name: string
10 size?: "sm" | "default" | "lg"
11 className?: string
12}
13
14const sizeClass: Record<NonNullable<EntityImageProps["size"]>, string> = {
15 sm: "size-5",
16 default: "size-8",
17 lg: "size-10",
18}
19
20/**
21 * Just the image: no background, border, or corner radius, so team crests
22 * and region flags render at their native shape. Pass a `className` (e.g.
23 * `size-6`) to override the size; it takes precedence over `size`.
24 */
25export function EntityImage({ src, name, size = "default", className }: EntityImageProps) {
26 const [errored, setErrored] = useState(false)
27
28 if (!src || errored) {
29 return (
30 <span
31 className={cn(
32 "flex shrink-0 items-center justify-center rounded-full bg-muted text-[0.6rem] font-medium text-muted-foreground",
33 sizeClass[size],
34 className
35 )}
36 >
37 {name.slice(0, 2).toUpperCase()}
38 </span>
39 )
40 }
41
42 return (
43 // eslint-disable-next-line @next/next/no-img-element -- framework-agnostic registry component, no next/image dependency
44 <img
45 src={src}
46 alt={name}
47 className={cn("shrink-0 object-contain", sizeClass[size], className)}
48 onError={() => setErrored(true)}
49 />
50 )
51}

Files it writes

  • registry/mrdoge-ui/entity-image/entity-image.tsx

Facts

Registry
mrdoge-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-12
Last confirmed
today

Go to the source

mrdoge.co mrdogeco/docs on GitHub Raw registry item This item as JSON

More from mrdoge-ui

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Bet Slipbet-slipmrdoge-uiComponentsFreeno deps
Match Cardmatch-cardmrdoge-uiComponentsFreeno deps · 3 files
Match Card Compactmatch-card-compactmrdoge-uiComponentsFreeno deps
Match Highlightmatch-highlightmrdoge-uiComponentsFreeno deps · 2 files
Match Timelinematch-timelinemrdoge-uiComponentsFreeno deps
Odds Selectorodds-selectormrdoge-uiComponentsFreeno deps · 2 files
Stats Liststats-listmrdoge-uiComponentsFreeno deps
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex