Discovered from HTML
The identifier in data-controller is enough. Nothing to register.
Search 71 components and 72 controllers by name, category or description.
Stimulus controllers
Add a data-controller and the behavior loads itself. Use
what ships, extend it, take it over or write your own.
The identifier in data-controller is enough. Nothing to register.
Pages that never use an identifier never download it, or its npm dependencies.
Several controllers share one element and reconnect safely through Turbo renders.
Start with what ships. Take on maintenance only when the app needs it.
Set a component prop, or add a package identifier to any element. Fixes and updates keep coming from the package.
{{-- Components configure their controllers through props --}}
<hw:input name="phone" mask="phone-br" />
{{-- Any element can use a package controller by its identifier --}}
<a href="{{ route('posts.create') }}"
data-controller="hotkey"
data-action="keydown.n@window->hotkey#click">
New post
</a>
Subclass a package controller under a new identifier. Import through @hotwire, keep inherited definitions and call the parent lifecycle.
import CarouselController from "@hotwire/carousel_controller";
export default class extends CarouselController {
static targets = [...CarouselController.targets, "caption"];
connect() {
super.connect();
this.captionTarget.textContent = "Gallery ready.";
}
}
Try it: the Gallery and its plugins load only when this frame asks for them.
Publish a controller under the same identifier when the app must own the implementation. You also take on reviewing upstream changes.
php artisan hotwire:controllers carousel
For behavior only your app has. The filename becomes the identifier: my_custom_controller.js is my-custom.
$ php artisan hotwire:make-controller my-custom
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static targets = ["message"];
celebrate() {
this.messageTarget.textContent = "Your controller is running.";
}
}
<div data-controller="my-custom">
<hw:button data-action="my-custom#celebrate">
Run controller
</hw:button>
<p data-my-custom-target="message"></p>
</div>
Package, extended and app controllers cooperate on the same markup. Keep each one focused.
<section data-controller="gallery my-custom">
<button data-controller="tooltip" data-action="my-custom#celebrate">
Celebrate
<hw:tooltip>A composed experience</hw:tooltip>
</button>
<p data-my-custom-target="message"></p>
</section>
Controller catalog
Each one opens the reference shipped with the version you installed.
accordion
Coordinates native disclosure items in single or multiple mode and blocks disabled items
animated-number
Animates numeric content immediately or once it enters the viewport
carousel
Runs Embla carousels with navigation, dots, progress, responsive options and dynamic slides
chart
Renders responsive Apache ECharts from inline or fetched options with optional polling
disclosure
Toggles an inline panel, synchronizes ARIA state and emits change events
lazy-image
Polls for an image URL up to a limit and then renders responsive picture content
map
Renders Leaflet maps with OpenStreetMap tiles, inline markers or fetched GeoJSON
oembed
Converts editor-generated oembed tags into YouTube or Vimeo frames and fallback links
read-more
Measures overflow and synchronizes static, collapsed and expanded preview states
reveal
Coordinates load- or viewport-triggered reveal cascades and emits when content appears
tabs
Implements ARIA tabs with automatic activation and orientation-aware keyboard navigation
auto-resize
Resizes a textarea to fit its content after input, window resize and Turbo renders
auto-save
Saves changed forms with debouncing, status feedback and queued follow-up saves
auto-select
Selects all text in an input when it receives focus
auto-submit
Submits forms through immediate or debounced actions without duplicate IME commits
autofocus
Focuses a configured field or the first validation error initially and after relevant Turbo Frame loads
char-counter
Displays typed or remaining character counts with live updates
checkbox
Synchronizes native checkbox indeterminate state across changes and Turbo renders
checkbox-select-all
Synchronizes a master checkbox with grouped selections and indeterminate state
clean-query-params
Removes empty values from GET form submissions before building the query string
clear-input
Clears a targeted input, controls button visibility and emits input events
conditional-fields
Shows and disables dependent fields using declarative value and checkbox-state rules
error-scroll
Scrolls to the first validation error after Turbo Frame or full-page renders
file-preserve
Restores selected files when a submitted Turbo form re-renders with validation errors
file-upload
Uploads validated files through queued requests with JSON or Turbo Stream responses
input-mask
Applies Maska static, dynamic, reverse and custom-token masks to text inputs
input-otp
One-time code editing with digit filtering, paste, visual selection and completion events on a native input
money-input
Formats locale-aware money entry and exposes canonical minor-unit values
multi-select
Enhances a native multiple select with search, limits, select-all and floating positioning
password-visibility
Toggles password visibility and synchronizes the trigger ARIA state
remote-form
Submits a form from a decoupled trigger while preserving submitter metadata
reset-files
Clears opted-in file inputs after successful form submission and a render without validation errors
rich-text
Runs a Tiptap editor with form sync, read-only mode and optional image-upload events
rich-text-toolbar
Formats a linked Tiptap editor and synchronizes toolbar ARIA pressed states
slider
Synchronizes a native range input visual fill after input, reset and Turbo morphs
slug
Autofills and sanitizes a slug from a source field until manual editing, with optional length limits
toggle
Synchronizes a two-state button ARIA state and optional hidden form input
toggle-group
Coordinates single or multiple pressed-button groups and synchronizes form inputs
unsaved-changes
Confirms Turbo Drive navigation away from forms with unsaved changes
alert-dialog
Guards click actions with an accessible confirmation dialog
drawer
Controls an accessible off-canvas overlay with optional Turbo Frame content
dropdown
Controls a responsive floating disclosure panel with selectable-item dismissal
hover-card
Shows a delayed floating preview on hover or focus with Escape dismissal
image-viewer
Enhances image galleries with zoom, pan, pinch and double-tap gestures, rotation/flips, keyboard, side-arrow and thumbnail navigation, tap-to-hide controls on touch screens, and automatic updates after Turbo renders
modal
Controls an accessible modal with optional Turbo Frame-driven content
popover
Controls an interactive floating panel with focus and dismissal management
sheet
Controls an accessible sheet overlay with optional Turbo Frame content
tooltip
Creates non-interactive ARIA tooltips from templates with anchored positioning
pagination
Appends server-rendered paginator pages manually or when the fallback link enters view
side-panel
Controls nested inline panel state with ARIA synchronization and optional persistence
sidebar
Controls persisted desktop sidebar state and an accessible mobile overlay
back-to-top
Reveals a control after a scroll threshold and returns to the top with reduced-motion support
color-scheme
Persists light, dark or system mode across tabs with optional View Transitions
copy-to-clipboard
Copies targeted text or input values and shows temporary success feedback
gallery
Local Carousel extension with Autoplay, Auto Scroll and Fade plugins
gtm
Loads Google Tag Manager immediately or on interaction and pushes data layer events
hotkey
Clicks or focuses its element from shortcuts while ignoring editable input
scroll-progress
Updates a progress bar from the document scroll position with optional throttling
timeago
Formats localized relative times with optional suffixes and automatic refresh
optimistic--dispatch
Applies optimistic Turbo Stream templates from arbitrary custom triggers
optimistic--form
Applies optimistic Turbo Stream templates before a form request begins
optimistic--link
Applies optimistic Turbo Stream templates when Turbo handles a link click
turbo--frame-src
Sends the Turbo Frame source URL with same-frame form submissions
turbo--morph-guard
Preserves the nearest Turbo Frame during outer morphs while the user is editing
turbo--polling
Reloads a Turbo Frame at configurable intervals with pause and refresh controls
turbo--preserve-scroll
Preserves page scroll across Turbo Frame renders that replace focused content
turbo--progress
Shows the Turbo progress bar for Turbo Frame and Turbo Stream requests
turbo--view-transition
Animates Turbo Frame updates with View Transitions when supported, using normal renders while modal dialogs are stacked
dev--duplicate-ids
Warns during development when duplicate DOM IDs appear within its render root
dev--log
Logs action events to the browser console for development debugging
Start from a preset and change the tokens your brand cares about.