TagList
Displays a filterable list of all tags across all bookmarks with their occurrence counts.Props
This component has no props. It reads state from the BookmarkStore.Usage
Features
- Auto-generated: Creates tag list from all bookmarks
- Occurrence Count: Shows how many bookmarks have each tag
- Active State: Highlights currently selected tag
- Responsive Layout: Horizontal scroll on mobile, wrapped grid on desktop
- Hidden When Empty: Returns null if no bookmarks exist
Tag Display
Each tag shows:- Tag name
- Count of bookmarks with that tag (in gray)
- Visual indication when selected (white background, dark text)
Example Output
Styling
- Default: Dark background with light text
- Selected: Light background with dark text
- Hover: Border color transitions to lighter gray
- Mobile: Horizontal scrollable with snap points
- Desktop: Centered, wrapped layout
BookmarkTags
Interactive tag editor for individual bookmarks. Allows adding, removing, and editing tags directly on a bookmark.Props
The bookmark object to manage tags for. See Bookmark component for full type details.
Usage
Features
- Inline Editing: Click to edit tags directly on the bookmark card
- Multiple Entry Methods: Add tags with comma or Enter key
- Backspace Deletion: Press backspace when input is empty to edit last tag
- Click to Remove: Click X icon on any tag to remove it
- Duplicate Prevention: Won’t add duplicate tags
- Click-outside to Cancel: Clicking outside cancels editing without saving
- Empty State: Shows “add tags…” placeholder when no tags exist
Keyboard Interactions
Adding Tags
Adding Tags
Removing Tags
Removing Tags
Saving Changes
Saving Changes
- Click the checkmark icon
- Or press
Enterwhen input is empty
Canceling
Canceling
- Click outside the tag area
- Changes are discarded and tags revert to original state
Example Interaction
State Management
Internal state:editable: Whether tags are in edit modeinputValue: Current text input valuenewTags: Working copy of tags being editedisKeyReleased: Tracks key state for backspace behavior
Validation
- Tags are trimmed of whitespace
- Tags are converted to lowercase
- Duplicate tags are prevented
- Empty tags are not added