BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/deso-ui/logo

Logo

deso-ui/logo
FreeBlock

A component for displaying the DeSo logo with light and dark mode support.

Install it

npx shadcn@latest add https://ui.deso.com/r/logo.json

Source

src/components/deso/logo.tsxui.deso.com/r/logo.json
1'use client';
2
3import React, { useEffect, useState } from 'react';
4import { useTheme } from 'next-themes';
5import Image from 'next/image';
6import { cn } from '@/lib/utils/deso';
7
8export interface LogoProps {
9 className?: string;
10 width?: number;
11 height?: number;
12}
13
14export const Logo: React.FC<LogoProps> = ({
15 className,
16 width = 120,
17 height = 40,
18}) => {
19 const { theme, resolvedTheme } = useTheme();
20 const [mounted, setMounted] = useState(false);
21
22 // Only render after mounting to avoid hydration mismatch
23 useEffect(() => {
24 setMounted(true);
25 }, []);
26
27 // Determine if we're in dark mode
28 const getDarkMode = () => {
29 if (!mounted) {
30 // During SSR/initial render, check if document has dark class
31 if (typeof document !== 'undefined') {
32 return document.documentElement.classList.contains('dark');
33 }
34 return false;
35 }
36
37 // Use resolvedTheme which handles system preference, fallback to theme
38 const currentTheme = resolvedTheme || theme;
39 return currentTheme === 'dark';
40 };
41
42 const isDark = getDarkMode();
43
44 // Show a placeholder during initial render to avoid hydration mismatch
45 if (!mounted) {
46 return (
47 <div
48 className={cn('relative bg-muted animate-pulse rounded', className)}
49 style={{ width, height }}
50 />
51 );
52 }
53
54 return (
55 <div className={cn('relative', className)} style={{ width, height }}>
56 <Image
57 src={isDark ? '/logo-dark.svg' : '/logo-light.svg'}
58 alt="DeSo Logo"
59 fill
60 style={{ objectFit: 'contain' }}
61 priority
62 />
63 </div>
64 );
65};

Files it writes

  • src/components/deso/logo.tsx

Facts

Registry
deso-ui
Type
registry:block
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
2 days ago

Go to the source

ui.deso.com deso-protocol/deso-ui on GitHub Raw registry item This item as JSON

More from deso-ui

All 47 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Action Menuaction-menudeso-uiBlocksFreeno deps
Confirmation Dialogconfirmation-dialogdeso-uiBlocksFreeno deps
Copy Buttoncopy-buttondeso-uiBlocksFreeno deps
Editoreditordeso-uiBlocksFreeno deps
Editor Emoji Pickereditor-emoji-pickerdeso-uiBlocksFreeno deps
Editor Markdowneditor-markdowndeso-uiBlocksFreeno deps
Editor Uploadeditor-uploaddeso-uiBlocksFreeno deps
Feed Listfeed-listdeso-uiBlocksFreeno deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex