Overview
TheQuickLinks component provides a visual bookmark manager that displays saved links with their favicons. It supports two display modes: a compact grid view and an expanded list view.
Props
When
true, displays links in a vertical list format with full titles and delete buttons. When false, displays links in a compact grid of favicon icons.When
true, the component expands to fill available width and height. Used when QuickLinks is displayed as a standalone widget.Usage
Grid View (Default)
Expanded List View
Full-Size Standalone Widget
src/app.tsx:117:
State Management
The component usesuseLocalStorage to persist bookmarks:
Types and Interfaces
QuickLinksProps
Fromsrc/components/quick-links.tsx:27:
QuickLink
Fromsrc/components/quick-links.tsx:32:
Features
Adding Links
- Enter a URL in the input field (with or without
https://protocol) - Press Enter or click the plus button
- The URL is automatically normalized and validated
- Title is extracted from the domain name
- Favicon is fetched using Google’s favicon service
src/components/quick-links.tsx:56:
Deleting Links
- Grid View: Hover over a link to reveal an X button in the top-right corner
- List View: Hover over a link to reveal a trash icon button
URL Utilities
The component relies on utility functions from@/lib/url-utils:
normalizeUrl(url)- Addshttps://protocol if missingisValidUrl(url)- Validates URL formatextractTitle(url)- Extracts domain name as titlegetFaviconUrl(url)- Generates Google Favicon Service URL
Display Modes
Grid View (expanded={false})
From src/components/quick-links.tsx:166:
List View (expanded={true})
From src/components/quick-links.tsx:92:
Animation
Links animate in and out using Framer Motion:Styling
The component dynamically calculates CSS classes based on props: Fromsrc/components/quick-links.tsx:239:
Dependencies
motion/react- Animation effects@tabler/icons-react- UI icons@/hooks/use-local-storage- Data persistence@/lib/url-utils- URL processing utilities@/components/ui/*- Shadcn UI components
Related Components
- TodoList - Companion widget for task management
- InteractiveCalendar - Companion widget for mood tracking