Web Components
29 interactive Web Components with full keyboard support, ARIA attributes, and XSS-safe rendering.
velin-modal
Accessible modal dialog with focus trapping and Escape to close.
Open Modal
This modal traps focus. Press Tab to cycle, Escape to close.
Cancel
Confirm
Attributes
Name Type Default Description
titlestring ""Modal heading text
openboolean falseShow/hide the modal (reflected)
Methods
Name Description
open()Opens the modal, traps focus
close()Closes the modal, restores focus
Events
Name Detail
velin-closeFired when modal is closed
Slots
Name Description
(default) Modal body content
footerFooter area (action buttons)
velin-tabs
Tabbed interface with roving tabindex and arrow key navigation.
Overview
Features
API
VelinStyle tabs use native roving tabindex. Arrow keys navigate between tabs.
Keyboard navigation Automatic ARIA Panel show/hide
Listen to velin-tab-change for tab switch events.
Events
Name Detail
velin-tab-change{ tab, index }
Slots
Name Description
tabTab buttons with role="tab" (set aria-selected="true" for default)
panelTab panel content (matched by order)
velin-accordion
Native <details>/<summary> with optional exclusive mode. Arrow keys navigate between items. Panel styles use light-DOM CSS (slotted descendants cannot be styled with ::slotted()).
What is VelinStyle? An accessibility-first CSS framework.
How do I install it?
Can I customize it? Yes! Override CSS custom properties or use theme presets.
Attributes
Name Type Default Description
exclusiveboolean falseOnly one item open at a time
Keyboard
Key Action
ArrowUp/Down Navigate between summaries
Home / End Jump to first/last item
Enter / Space Toggle the focused item (native details)
velin-toast
Notification toasts with aria-live region.
Success
Warning
Error
Info (sticky)
Methods
Name Parameters Description
show(options){ message, type, duration }Show a toast. Types: success, warning, danger, info. Duration in ms (0 = sticky).
velin-dropdown
Dropdown menu with keyboard navigation and outside-click closing.
Options
Edit
Duplicate
Delete
Attributes
Name Type Default Description
openboolean falseToggle menu visibility
alignstring "start"Menu alignment: start or end
Methods
Name Description
open()Open the dropdown
close()Close the dropdown
toggle()Toggle open/close
Slots
Name Description
triggerButton that opens the menu
(default) Menu items (<button> or links; slotted into role="menu")
velin-drawer
Slide-in panel with focus trapping. Supports all 4 sides.
Open Left
Open Right
Settings panel content goes here.
Attributes
Name Type Default Description
titlestring ""Drawer heading
sidestring "start"Position: start, end, top, bottom
openboolean falseShow/hide (reflected)
Methods
Name Description
open()Open the drawer
close()Close the drawer
Events
Name Detail
velin-closeFired on close
velin-popover
Popover with click, hover, or focus trigger. Auto role (tooltip/dialog).
Click me
This popover opens on click. Press Escape to close.
Hover me
This popover opens on hover/focus.
Attributes
Name Type Default Description
placementstring "bottom"top, bottom, start, end
triggerstring "click"click, hover, focus
titlestring ""Popover heading (optional)
Methods
Name Description
open() / close() / toggle()Programmatic control
velin-collapse
Expandable/collapsible content section.
Toggle Content
This content can be expanded and collapsed. Supports open(), close(), and toggle() methods.
Attributes
Name Type Default Description
openboolean falseExpanded state (reflected)
Methods
Name Description
open() / close() / toggle()Programmatic expand/collapse
Events
Name Detail
velin-openFired when expanded
velin-closeFired when collapsed
velin-carousel
Image/content carousel with keyboard navigation and autoplay.
Attributes
Name Type Default Description
autoplayboolean falseAuto-advance slides
intervalnumber 5000Autoplay interval in ms
Keyboard
Key Action
ArrowLeft / ArrowRight Previous / Next slide
Home / End First / Last slide
Events
Name Detail
velin-slide-change{ index }
velin-lightbox
Fullscreen image/video gallery with focus trapping and keyboard navigation.
Image 1
Image 2
Image 3
Click any image to open lightbox. Arrow keys to navigate.
Methods
Name Description
open(index)Open lightbox at slide index
close()Close lightbox
Events
Name Detail
velin-closeFired on close
velin-dialog
Native <dialog> wrapper for alert, confirm, and prompt. Returns a Promise.
Methods
Name Parameters Returns
alert(message, opts){ title, confirmText }Promise<true>
confirm(message, opts){ title, confirmText, cancelText, danger }Promise<boolean>
prompt(message, opts){ title, confirmText, cancelText, placeholder, defaultValue }Promise<string|null>
Events
Name Detail
velin-dialog-close{ value }
velin-stepper
Multi-step progress indicator with panel management.
Step 1: Create your account.
Step 2: Fill in your profile details.
Step 3: Review and confirm everything.
Previous
Next
Attributes
Name Type Default Description
labelsstring ""Comma-separated step labels
activenumber 0Current active step (0-based)
Methods
Name Description
next()Go to next step
prev()Go to previous step
goTo(index)Jump to specific step
Events
Name Detail
velin-step-change{ step }
velin-countdown
Live countdown timer with role="timer" and aria-live.
Attributes
Name Type Description
datetimestring ISO date string target (e.g. 2027-01-01T00:00:00)
show-daysstring Set "false" to hide days segment
label-daysstring Custom label for days (default: "Days")
label-hoursstring Custom label for hours
label-minutesstring Custom label for minutes
label-secondsstring Custom label for seconds
sizestring sm or lg for size variants
Events
Name Detail
velin-countdown-endFired when countdown reaches zero
velin-progress-ring
Circular progress indicator with role="progressbar".
Attributes
Name Type Default Description
valuenumber 0Progress value (0-100)
sizenumber 60Diameter in pixels
strokenumber 4Stroke width
colorstring primary CSS color for the progress arc
velin-copy
One-click copy-to-clipboard button.
Click to copy npm install velinstyle to clipboard.
Attributes
Name Type Description
valuestring Text to copy to clipboard
Events
Name Detail
velin-copiedFired after successful copy
velin-theme-toggle
Light/dark mode toggle with localStorage persistence. Click the button to switch between light and dark mode.
Attributes
Name Type Default Description
targetstring "html"CSS selector for element to toggle data-velin-theme on
Events
Name Detail
velin-theme-change{ theme, dark }
velin-persist
Auto-saves form data to localStorage. Survives page reload. Password/file fields excluded for security.
Type something, reload the page -- your input persists!
Attributes
Name Type Default Description
keystring "default"Storage key identifier (alphanumeric, max 64 chars)
storagestring "local""local" or "session" for sessionStorage
Methods
Name Description
clear()Remove saved data from storage
Events
Name Detail
velin-persist-restore{ data } -- Fired after data is restored from storage
velin-persist-clearFired after data is cleared
velin-persist-error{ error: "quota" } -- Storage quota exceeded
velin-haptic (Utility)
Device vibration feedback for buttons and interactions. Works on supported mobile devices.
Tap
Double Tap
Error
Success
Add haptic="pattern" to any element. Patterns: tap, double-tap, error, success, warning.
HTML API
Attribute Values Description
haptictap, double-tap, error, success, warningVibration pattern triggered on click
JS API
Export Description
vibrate(pattern)Trigger vibration with a duration array
applyHaptic(el, pattern)Bind haptic click handler to element
VelinHapticObserverMutationObserver that auto-applies [haptic] attribute
velin-icon
SVG icon component with multi-provider support. See Icons page for the full icon gallery.
<!-- Local sprite (default) -->
<velin-icon name="check" size="24"></velin-icon>
<!-- External provider (CDN) -->
<velin-icon name="heart" provider="lucide"></velin-icon>
<velin-icon name="academic-cap" provider="heroicons"></velin-icon>
<!-- Custom sprite -->
<velin-icon name="custom" sprite="my-icons.svg"></velin-icon>
Attributes
Name Type Default Description
namestring required Icon name
sizenumber 24Width and height in pixels
labelstring ""Accessible label (sets role="img" + aria-label)
spritestring "velin-icons.svg"Custom sprite path
providerstring ""External icon provider: lucide, heroicons, bootstrap, material, fontawesome, tabler
Providers
Provider Icons License
lucideLucide (Feather fork) ISC
heroiconsHeroicons (Tailwind Labs) MIT
bootstrapBootstrap Icons MIT
materialMaterial Symbols (Google) Apache 2.0
fontawesomeFont Awesome (Free) CC BY 4.0
tablerTabler Icons MIT
JS API
Method Description
VelinIcon.registerProvider(name, urlTemplate)Register a custom icon provider at runtime. Use {name} as placeholder.
VelinIcon.providersReturns array of registered provider keys
CLI
Command Description
velinstyle icons listShow available providers and installed icons
velinstyle icons add <provider> --icons name1,name2Download icons from a provider into the local sprite
velinstyle icons remove <provider>Remove all icons from a provider
velinstyle icons buildRebuild the SVG sprite
velin-bottom-nav
Mobile bottom navigation; set current to match data-nav on links.
velin-sheet
Bottom sheet with focus trap. Methods: open(), close().
velin-segmented-control
List
Grid
velin-calendar
Month calendar. value (ISO date), optional min/max, event velin-change. Keyboard: arrows, Home/End, PageUp/Down, Enter.
velin-file-dropzone
Client-side dropzone. Events velin-files / velin-error. Does not upload to a server — wire your API.
velin-command
Command palette. Close with Escape, backdrop click, or toggle(). Closed overlay does not intercept pointer events.
Open palette
Dashboard
Settings
Methods
Name Description
open()Open the palette
close()Close the palette
toggle()Toggle open/close
velin-announcer
Live region for screen readers. Static helper: VelinAnnouncer.announceGlobal().