Smart Interactions
New HTML attributes in djust 0.4.0 for debounce, throttle, shortcuts, and more.
Debounced Search
dj-debounceType to search — input is debounced at 300ms via the HTML attribute, no Python decorator needed.
html
<input dj-input="search" dj-debounce="300">- Dashboard analytics
- User management
- File uploads
- Payment processing
- Email notifications
- API integrations
- Database migrations
- Theme customization
- Search indexing
- Cache management
Throttled Button
dj-throttleClick rapidly — only fires once per second thanks to HTML-level throttle.
0
likes
html
<button dj-click="like" dj-throttle="1000">Command Palette
dj-shortcut dj-click-awayPress Ctrl+K to open, Escape to close. Clicking outside also closes it.
html
<div dj-shortcut="ctrl+k:toggle_palette:prevent,
escape:close_palette">
<input autofocus placeholder="Search..."
dj-input="palette_search"
dj-debounce="150">Typed Parameters
dj-value-*Pass typed static values with events — integers, floats, booleans, JSON, and lists.
html
<button dj-click="submit_form"
dj-value-count:int="42"
dj-value-tags:list='["python","django"]'>Disable With + Lock
dj-disable-with
dj-lock
dj-disable-with disables the button and shows loading text during submission.
dj-lock prevents concurrent events until the handler responds (the save handler has a 1s simulated delay).
html
<button dj-click="save_with_lock"
dj-disable-with="Saving..." dj-lock>