Clipboard Manager

Real-world examples showing how to use the selection bubble menu feature

🎮 Interactive Demo

📖 Select text here:

Try selecting this text! Highlight any portion and watch the bubble menu appear above your selection.

Here are some useful things to save:

  • Email: support@company.com
  • Phone: +1-555-0123
  • Code: npm install flowbite-svelte
  • Promo: SAVE25OFF
"The best interface is one that gets out of your way." - Design wisdom

💾 Your saved items:

No clipboard items yet.

Select any text and click "Save" to add it here

📚 Usage Examples

Basic

Enable Selection Menu

Simplest setup - enable selection on entire page

Targeted

Target Specific Area

Limit selection menu to specific content area using CSS selector using selectionTarget prop.

Use enableSelectionMenu to show selection bubble menu.

Your article content here...

Users can select any text to save it.

No clipboard items yet.

Select any text and click "Save" to add it here

Modal

Modal

Display the clipboard manager in a modal dialog. Select any text in the paragraph to save it using the selection bubble menu.

Set storageKey to customize the localStorage key name.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam, repudiandae. Optio delectus nihil assumenda laborum voluptatum nam illum nobis blanditiis esse sapiente, cumque facere ab consequatur. Odit, architecto enim! At!

Documentation

Documentation Site

Perfect for docs where users need to save commands, code snippets, or API examples

Use items prop to set initial value. Use limit prop to set max items to store.

API Documentation

Select any code snippet or command to save it.

git clone https://github.com/repo.git
Content

Blog/Article Reader

Let readers save quotes, insights, or key points while reading

Use saveLabel and clearLabel to change labels.

How to Build Better UIs

Select any quote or insight to save for later...

No clipboard items yet.

Select any text and click "Save" to add it here

Support

Email Client / Support Dashboard

Quick responses with ability to save new ones from actual emails

Pinned
20 minutes ago

Thank you for contacting us!

Pinned
30 minutes ago

Your order has been shipped.

Pinned
about 1 hour ago

We appreciate your feedback.

localStorage

Save to Store

The saveToStorage prop controls whether the clipboard items are saved to localStorage so they survive page refreshes and browser sessions.

When saveToStorage=true (default):

  • Items are automatically saved to localStorage whenever they change
  • When you reload the page, all your clipboard items are restored
  • Data persists across browser sessions

When saveToStorage=false :

  • Items only exist in memory during the current session
  • Refreshing the page clears all clipboard items
  • Data is lost when you close the tab

JavaScript Variables

Select important concepts to remember:

  • let creates block-scoped variables
  • const creates read-only references
  • var creates function-scoped variables

My Notes

No clipboard items yet.

Select any text and click "Save" to add it here

Developer

Code Editor with Snippets

Save frequently used code patterns directly from the editor.

Use filterSensitive=false to unblock sensitive data such as password pattern, api token pattern, etc. The component provide default function (see below) to detect sensitive data. However use the detectSensitiveData prop to provide your own logic.

This will block texts containing "confidential" or "secret".

  • Detects common sensitive information (credit cards, passwords, API keys, credentials).
  • ⚠️ Note: These patterns are heuristic and may produce false positives/negatives.
  • Credit card regex may match any 16-digit sequence, not just valid card numbers
  • Password regex is intentionally strict (12+ chars, mixed case, digits) and misses many real passwords
  • API key regex matches any long alphanumeric token (32+ chars), which may catch legitimate IDs
  • Credential keyword regex may trigger on non-secret words like "token = false"
// Editable area
Pinned
20 minutes ago

console.log()

Pinned
30 minutes ago

async function

Advanced

Multiple Content Areas

Use class selector to enable selection across multiple elements

Content area 1 with class="selectable-area"

You can select from this div.

Content area 2 with class="non-selectable-area"

You CAN'T select from this div.

Content area 3 with class="selectable-area"

You can select from this div.

No clipboard items yet.

Select any text and click "Save" to add it here

Selection Only

No Manual Input

Use showInput=false to hide the input box and use only selection menu with custom rendering

JavaScript Variables

Lorem ipsum dolor sit amet consectetur adipisicing elit.

No clipboard items yet.

Select any text and click "Save" to add it here

Custom

Custom Empty State

Provide clear instructions for first-time users

JavaScript Variables

Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus iste, quis fugit quo sint quasi quam architecto ipsum, ab reprehenderit error eveniet sunt neque atque vero nulla, labore magnam mollitia.

👆

No saved items yet

Highlight any text in the article above
and click "Save to Clipboard" to get started

💡 Best Practices

✅ Do

  • • Target specific content areas
  • • Use for text-heavy interfaces
  • • Combine with manual input option
  • • Show clear visual feedback
  • • Test on mobile/touch devices

❌ Don't

  • • Enable on form inputs
  • • Use for tiny text snippets
  • • Forget mobile considerations
  • • Overwhelm with too many features
  • • Target entire page unnecessarily

🔄 Selection Menu vs Manual Input

👆 Selection Menu

  • Faster for existing content
  • No context switching
  • Natural workflow
  • Works on mobile

⌨️ Manual Input

  • Create new snippets
  • Edit before saving
  • Paste from external sources
  • More control

💡 Pro tip: Enable both for maximum flexibility!

Props

PropTypeDefaultDescription
itemsClipboardItem[][]Initial clipboard items
placeholderstring"Type and save to clipboard"Input placeholder text
saveLabelstring"Save"Label for the save button
clearLabelstring"Clear All"Label for the clear all button
limitnumber20Maximum number of clipboard items to store
saveToStoragebooleantrueWhether to persist clipboard items to localStorage
toastDurationnumber2000Duration in milliseconds to show toast notifications
filterSensitivebooleantrueWhether to filter out sensitive data (credit cards, passwords, etc.)
maxLengthnumber10000Maximum character length for clipboard items
enableSelectionMenubooleanfalseEnable text selection menu for saving selected text
selectionTargetstring"body"CSS selector for elements where selection menu should be enabled
showInputbooleantrueWhether to show the input field for adding new clipboard items
classClassValue""Additional CSS classes for the component container
classesClipboardManagerVariantsundefinedObject containing CSS classes for component parts
storageKeystringundefinedCustom localStorage key (defaults to 'flowbite-clipboard-manager')
openbooleanundefinedControl modal state. If undefined, renders inline; if defined, renders as modal
badgePropsOmit<BadgeProps, 'children'>{ color: 'blue', class: 'text-xs' }Props to pass to the pinned badge component
modalPropsModalPropsundefinedProps to pass to the modal component when rendering as modal
detectSensitiveData(text: string) => booleanundefinedCustom function to detect sensitive data. Overrides default detection
childrenSnippetundefinedCustom render function for clipboard items. Receives item, copyItem, deleteItem, and togglePin
emptyStateSnippetundefinedCustom render function for the empty state