Logo for Astro
Astro brand containers with optional home-page links.
Installation
bunx --bun shadcn@latest add @gnostic/logonpx shadcn@latest add @gnostic/logopnpm dlx shadcn@latest add @gnostic/logoCopy the files
src/components/ui/logo/types.tssrc/components/ui/logo/index.tssrc/components/ui/logo/logo-image.astrosrc/components/ui/logo/logo-text.astrosrc/components/ui/logo/logo.astro
Usage
import { Logo, LogoImage, LogoText } from "@/components/ui/logo"
import logo from "@/assets/logo.svg"
<Logo>
<LogoImage src={logo} alt="Logo" />
<LogoText>gnosticai UI</LogoText>
</Logo>
For theme-specific marks, pass both sources on src.
<Logo href="/">
<LogoImage src={{ light: logoLight, dark: logoDark }} alt="Logo" />
<LogoText>gnosticai UI</LogoText>
</Logo>
Notes
Logobecomes an anchor automatically when you passhref.LogoImageis optional, which makes text-only marks straightforward.- Use
srcfor a single logo. Pass{ light, dark }when the mark changes by theme. - Use
Logofor compact brand marks and site headers, not for general-purpose hero artwork.
Examples
Responsive Logo
Adjust the container width to see the logo image and text respond to the container width.
SVG Logo
The Logo accepts a default slot, where you can pass an SVG component.
API Reference
LogoImageProps
src?| ImageMetadata
| {
light: ImageMetadata
dark: ImageMetadata
}
One image for both modes, or a light and dark pair.
| ImageMetadata
| {
light: ImageMetadata
dark: ImageMetadata
}When to use Logo
Place a symbol, wordmark, or text inside Logo. Set href when it should act as a link. Keep the brand mark separate from navigation so it can be reused in headers and footers.
Keyboard and behavior
A linked image needs an accessible name for its destination. If the wordmark is also visible text, avoid announcing the name twice. Use a normal anchor for home navigation.
Theme and layout
Check the mark on light, dark, and tinted surfaces. Prefer artwork with an intentional dark-mode treatment instead of applying a filter that changes brand colors unpredictably.