🎨 Web Components CDN

Reusable, standards-based custom elements for modern web development

🔍
flag-emoji.js Display country flags as SVG or emoji with ISO country codes <flag-emoji iso="us"></flag-emoji> 📖 Description

A custom element for displaying country flags using ISO 3166-1 alpha-2 country codes. Supports both emoji and SVG rendering with customizable size and styling.

🎯 Live Demo 💻 Usage Example <!-- Basic usage --> <flag-emoji iso="us"></flag-emoji> <!-- With custom size --> <flag-emoji iso="gb" size="64"></flag-emoji> <!-- Multiple flags --> <flag-emoji iso="de"></flag-emoji> <flag-emoji iso="fr"></flag-emoji> <flag-emoji iso="jp"></flag-emoji> 📜 Script Installation <!-- Include from CDN --> <script src="https://customelements-define.github.io/flag-emoji.js"></script> <!-- Or use ES modules --> <script type="module"> import 'https://customelements-define.github.io/flag-emoji.js'; </script> 📥 Download: Download flag-emoji.js View Source
playing-card.js Render customizable playing cards with suits and ranks <playing-card rank="A" suit="♠"></playing-card> 📖 Description

A web component for displaying playing cards with customizable ranks and suits. Perfect for card games, tutorials, or decorative elements. Supports all standard suits (♠ ♥ ♦ ♣) and ranks (A, 2-10, J, Q, K).

🎯 Live Demo 💻 Usage Example <!-- Single card --> <playing-card rank="A" suit="♠"></playing-card> <!-- Full hand --> <playing-card rank="K" suit="♥"></playing-card> <playing-card rank="Q" suit="♦"></playing-card> <playing-card rank="J" suit="♣"></playing-card> <playing-card rank="10" suit="♠"></playing-card> 📜 Script Installation <!-- Include from CDN --> <script src="https://customelements-define.github.io/playing-card.js"></script> <!-- Or use ES modules --> <script type="module"> import 'https://customelements-define.github.io/playing-card.js'; </script> 📥 Download: Download playing-card.js View Source
color-picker.js Advanced color picker with hex, RGB, and HSL support <color-picker value="#667eea"></color-picker> 📖 Description

A customizable color picker component with support for multiple color formats (hex, RGB, HSL). Features a visual palette, sliders, and text input for precise color selection.

💻 Usage Example <!-- Basic color picker --> <color-picker value="#667eea"></color-picker> <!-- With event listener --> <color-picker id="myPicker"></color-picker> <script> document.getElementById('myPicker') .addEventListener('change', (e) => { console.log('Selected color:', e.detail.color); }); </script> 📜 Script Installation <script src="https://customelements-define.github.io/color-picker.js"></script> 📥 Download: Download color-picker.js
progress-bar.js Animated progress bar with customizable colors and styles <progress-bar value="75" max="100"></progress-bar> 📖 Description

A flexible progress bar component with smooth animations, customizable colors, and percentage display. Perfect for showing upload progress, loading states, or task completion.

💻 Usage Example <!-- Basic progress bar --> <progress-bar value="75" max="100"></progress-bar> <!-- Animated with color --> <progress-bar value="50" max="100" color="#667eea" animated ></progress-bar> 📜 Script Installation <script src="https://customelements-define.github.io/progress-bar.js"></script> 📥 Download: Download progress-bar.js
modal-dialog.js Accessible modal dialog with backdrop and close button <modal-dialog open>Content here</modal-dialog> 📖 Description

An accessible modal dialog component with keyboard navigation, focus trapping, and backdrop click-to-close. Follows ARIA best practices for screen reader compatibility.

💻 Usage Example <!-- Basic modal --> <modal-dialog id="myModal"> <h2>Modal Title</h2> <p>Modal content goes here</p> </modal-dialog> <!-- Open with button --> <button onclick="document.getElementById('myModal').open = true"> Open Modal </button> 📜 Script Installation <script src="https://customelements-define.github.io/modal-dialog.js"></script> 📥 Download: Download modal-dialog.js
tab-container.js Tabbed interface with accessible keyboard navigation <tab-container><tab-panel label="Tab 1">...</tab-panel></tab-container> 📖 Description

A fully accessible tabbed interface component with keyboard navigation (arrow keys, Home, End) and ARIA attributes for screen readers.

💻 Usage Example <tab-container> <tab-panel label="Overview"> <p>Overview content</p> </tab-panel> <tab-panel label="Documentation"> <p>Documentation content</p> </tab-panel> <tab-panel label="Examples"> <p>Examples content</p> </tab-panel> </tab-container> 📜 Script Installation <script src="https://customelements-define.github.io/tab-container.js"></script> 📥 Download: Download tab-container.js
toast-notification.js Temporary toast notifications with auto-dismiss <toast-notification message="Success!" type="success"></toast-notification> 📖 Description

Lightweight toast notification component for displaying temporary messages. Supports success, error, warning, and info types with auto-dismiss functionality.

💻 Usage Example <!-- Success notification --> <toast-notification message="Successfully saved!" type="success" duration="3000" ></toast-notification> <!-- Error notification --> <toast-notification message="An error occurred" type="error" ></toast-notification> 📜 Script Installation <script src="https://customelements-define.github.io/toast-notification.js"></script> 📥 Download: Download toast-notification.js
image-carousel.js Touch-enabled image carousel with navigation controls <image-carousel><img src="...">...</image-carousel> 📖 Description

A responsive image carousel with touch/swipe support, navigation arrows, and pagination dots. Supports auto-play and customizable transitions.

💻 Usage Example <image-carousel autoplay interval="3000"> <img src="image1.jpg" alt="Slide 1"> <img src="image2.jpg" alt="Slide 2"> <img src="image3.jpg" alt="Slide 3"> </image-carousel> 📜 Script Installation <script src="https://customelements-define.github.io/image-carousel.js"></script> 📥 Download: Download image-carousel.js
code-editor.js Syntax-highlighted code editor with line numbers <code-editor language="javascript">...</code-editor> 📖 Description

A lightweight code editor component with syntax highlighting, line numbers, and support for multiple programming languages. Perfect for documentation and interactive coding tutorials.

💻 Usage Example <code-editor language="javascript" theme="dark"> function greet(name) { return `Hello, ${name}!`; } console.log(greet('World')); </code-editor> 📜 Script Installation <script src="https://customelements-define.github.io/code-editor.js"></script> 📥 Download: Download code-editor.js
accordion-panel.js Collapsible accordion panels for organizing content <accordion-panel><accordion-item title="...">...</accordion-item></accordion-panel> 📖 Description

An accordion component for creating collapsible content sections. Supports single or multiple panels open at once, with smooth animations.

💻 Usage Example <accordion-panel> <accordion-item title="What is a Web Component?"> <p>Web Components are reusable custom elements...</p> </accordion-item> <accordion-item title="How do I use them?"> <p>Simply include the script and use the custom element...</p> </accordion-item> </accordion-panel> 📜 Script Installation <script src="https://customelements-define.github.io/accordion-panel.js"></script> 📥 Download: Download accordion-panel.js
star-rating.js Interactive star rating component with hover effects <star-rating value="4" max="5"></star-rating> 📖 Description

An interactive star rating component with hover effects, half-star support, and customizable colors. Perfect for reviews, feedback forms, and ratings display.

💻 Usage Example <!-- Basic rating --> <star-rating value="4" max="5"></star-rating> <!-- Interactive with event listener --> <star-rating id="myRating" interactive></star-rating> <script> document.getElementById('myRating') .addEventListener('change', (e) => { console.log('Rating:', e.detail.rating); }); </script> 📜 Script Installation <script src="https://customelements-define.github.io/star-rating.js"></script> 📥 Download: Download star-rating.js
tooltip-element.js Accessible tooltips with customizable positioning <tooltip-element text="Tooltip text">Hover me</tooltip-element> 📖 Description

An accessible tooltip component with smart positioning, keyboard support, and customizable styling. Automatically adjusts position to stay within viewport.

💻 Usage Example <!-- Basic tooltip --> <tooltip-element text="This is helpful information"> Hover over me </tooltip-element> <!-- Positioned tooltip --> <tooltip-element text="Top tooltip" position="top" > Hover me </tooltip-element> 📜 Script Installation <script src="https://customelements-define.github.io/tooltip-element.js"></script> 📥 Download: Download tooltip-element.js
user-avatar.js User avatar with initials fallback and status indicator <user-avatar src="..." name="John Doe"></user-avatar> 📖 Description

A versatile avatar component that displays user images with automatic initials fallback. Supports status indicators (online, offline, busy) and customizable sizes.

💻 Usage Example <!-- With image --> <user-avatar src="user.jpg" name="John Doe" size="large" ></user-avatar> <!-- With initials fallback --> <user-avatar name="Jane Smith" status="online" ></user-avatar> 📜 Script Installation <script src="https://customelements-define.github.io/user-avatar.js"></script> 📥 Download: Download user-avatar.js
date-picker.js Accessible date picker with calendar popup <date-picker value="2024-01-01"></date-picker> 📖 Description

An accessible date picker component with calendar popup, keyboard navigation, and localization support. Includes min/max date validation and custom date formatting.

💻 Usage Example <!-- Basic date picker --> <date-picker value="2024-01-01"></date-picker> <!-- With min/max dates --> <date-picker min="2024-01-01" max="2024-12-31" ></date-picker> 📜 Script Installation <script src="https://customelements-define.github.io/date-picker.js"></script> 📥 Download: Download date-picker.js
🔍

No components found

Try different search terms or clear the search to see all components.