Attribute Reference
Complete reference for all DBindly data attributes
This page provides a comprehensive reference of all DBindly data attributes. Click on any attribute to see detailed documentation, examples, and use cases.
Quick Reference Table
| Attribute | Category | Description |
|---|---|---|
dbind_data | Core Binding | Bind text content to a data field |
dbind_html | Core Binding | Bind HTML content (use with caution) |
dbind_format | Formatting | Apply formatting filters to values |
dbind_default | Core Binding | Fallback value when data is missing |
dbind_href | HTML Attributes | Bind link URL |
dbind_src | HTML Attributes | Bind image/media source |
dbind_alt | HTML Attributes | Bind image alt text |
dbind_title | HTML Attributes | Bind element title |
dbind_placeholder | HTML Attributes | Bind input placeholder |
dbind_class | Styling | Dynamically add CSS classes |
dbind_style | Styling | Dynamically add inline styles |
dbind_show | Visibility | Show element when truthy |
dbind_hide | Visibility | Hide element when truthy |
dbind_if | Visibility | Conditional display with operators |
dbind_unless | Visibility | Inverse of dbind_if |
dbind_empty | Visibility | Show when array/value is empty |
dbind_repeat | Lists | Repeat element for each array item |
dbind_repeat-empty | Lists | Show when repeated array is empty |
dbind_filter | Lists | Filter repeated items |
dbind_sort | Lists | Sort repeated items |
dbind_limit | Lists | Limit number of repeated items |
dbind_collection | Collections | Load collection data |
dbind_search | Collections | Search input for filtering |
dbind_paginate | Collections | Add pagination controls |
dbind_loadmore | Collections | Add load more button |
dbind_page-info | Collections | Display pagination info |
dbind_reactive | Data Loading | Subscribe to real-time updates for a data item |
dbind_model | Forms | Two-way data binding for inputs |
dbind_click | Forms | Handle click events |
dbind_submit | Forms | Handle form submissions |
dbind_error | Forms | Display general error messages |
dbind_error-field | Forms | Display field-specific errors |
dbind_skeleton | Loading | Show skeleton loading state |
dbind_loading | Loading | Show/hide during loading |
dbind_cloak | Animations | Hide until content loads |
dbind_transition | Animations | Add entrance animations |
dbind_aria-* | Accessibility | Dynamic ARIA attributes |
dbind_live | Accessibility | Announce updates to screen readers |
Attributes by Category
Core Binding
These attributes handle the fundamental task of binding data to your HTML elements.
dbind_data- The primary attribute for displaying text content from your datadbind_html- Display raw HTML content (use only with trusted data)dbind_default- Specify fallback values when data is missing or null
HTML Attributes
Bind data values to standard HTML attributes like links, images, and form elements.
dbind_href- Set thehrefattribute on anchor tagsdbind_src- Set thesrcattribute on images, videos, iframesdbind_alt- Set thealtattribute for accessibilitydbind_title- Set thetitleattribute for tooltipsdbind_placeholder- Set input placeholder text
Styling
Dynamically control CSS classes and inline styles based on your data.
dbind_class- Add CSS classes from data valuesdbind_style- Add inline styles from data values
Visibility & Conditionals
Control element visibility based on data conditions.
dbind_show- Show element when value is truthydbind_hide- Hide element when value is truthydbind_if- Advanced conditional with comparison operatorsdbind_unless- Inverse conditional (show when false)dbind_empty- Show when array or value is empty
Lists & Repetition
Render arrays and collections with filtering, sorting, and limiting.
dbind_repeat- Repeat element for each item in arraydbind_repeat-empty- Fallback content for empty arraysdbind_filter- Filter items by field valuedbind_sort- Sort items by fielddbind_limit- Limit number of displayed items
Collections & Pagination
Work with server-side collections including search and pagination.
dbind_collection- Load data from a named collectiondbind_search- Create a search input for filteringdbind_paginate- Add automatic paginationdbind_loadmore- Add "Load More" buttondbind_page-info- Display current page information
Data Loading
Connect HTML elements to specific data from your collections.
- URL Parameter
?did=- Auto-load single item on page load DBindly.load(dataId)- Load single item via JavaScriptdbind_reactive- Real-time subscription to a data itemdbind_collection- Load all items from a collection
See the Data Loading guide for complete documentation.
Forms & Events
Two-way data binding and event handling for interactive forms.
dbind_model- Two-way binding for form inputsdbind_click- Handle click eventsdbind_submit- Handle form submissionsdbind_error- Display general error messagesdbind_error-field- Display field-specific errors
Formatting & Filters
Apply formatting transformations to data values.
dbind_format- Apply formatting filters (currency, date, etc.)
Loading States
Control loading indicators and skeleton screens.
dbind_skeleton- Show skeleton placeholder during loadingdbind_loading- Show/hide elements based on loading state
Animations & Transitions
Add smooth animations when content loads or changes.
dbind_cloak- Hide content until fully loadeddbind_transition- Add fade/slide/scale entrance effects
Accessibility
Ensure your dynamic content is accessible to all users.
dbind_aria-*- Bind dynamic ARIA attributesdbind_live- Announce content changes to screen readers
Similar Attributes Comparison
Understanding when to use similar-looking attributes is crucial for effective DBindly usage.
dbind_show vs dbind_hide vs dbind_if
| Attribute | Condition | Use When |
|---|---|---|
dbind_show | Shows when truthy | Simple boolean check (e.g., isActive) |
dbind_hide | Hides when truthy | Inverse of show (e.g., hide when isLoading) |
dbind_if | Supports operators | Complex conditions (e.g., price>100, status==active) |
<!-- dbind_show: Simple truthy check -->
<span dbind_show="isVerified">Verified</span>
<!-- dbind_hide: Hide when truthy -->
<span dbind_hide="isLoading">Content loaded</span>
<!-- dbind_if: Complex comparison -->
<span dbind_if="stock>0">In Stock</span>
<span dbind_if="status==premium">Premium Member</span>dbind_data vs dbind_html
| Attribute | Output | Security | Use When |
|---|---|---|---|
dbind_data | Text only (escaped) | Safe | User-generated content, any text |
dbind_html | Raw HTML | Dangerous | Trusted rich content only |
<!-- dbind_data: Safe, escaped text -->
<p dbind_data="userComment"></p>
<!-- If userComment is "<script>alert('xss')</script>", it displays as text -->
<!-- dbind_html: Raw HTML (use carefully!) -->
<div dbind_html="trustedRichContent"></div>
<!-- Only use with content you control, like CMS rich text -->dbind_repeat vs dbind_collection
| Attribute | Data Source | Use When |
|---|---|---|
dbind_repeat | In-memory array | Data already loaded, client-side arrays |
dbind_collection | Server-side | Fetching from API with pagination |
<!-- dbind_repeat: Use with existing array data -->
<div dbind_repeat="items">
<span dbind_data="name"></span>
</div>
<!-- dbind_collection: Fetch from server -->
<div dbind_collection="products">
<span dbind_data="name"></span>
</div>dbind_filter vs dbind_search
| Attribute | Type | Filtering | Use When |
|---|---|---|---|
dbind_filter | Attribute | Static, field-based | Filter by category, status, etc. |
dbind_search | Input | Dynamic, text-based | User search across all fields |
<!-- dbind_filter: Static filter by field value -->
<div dbind_repeat="products" dbind_filter="category:electronics">
<!-- dbind_search: User-driven text search -->
<input type="text" dbind_search="products" placeholder="Search...">dbind_paginate vs dbind_loadmore
| Attribute | UI Pattern | Use When |
|---|---|---|
dbind_paginate | Numbered pages | Traditional pagination, known page count |
dbind_loadmore | Infinite scroll | Social feeds, continuous loading |
<!-- dbind_paginate: Show page numbers -->
<div dbind_repeat="posts" dbind_paginate="10">
<!-- dbind_loadmore: Append more items -->
<div dbind_repeat="posts" dbind_loadmore="10">Attribute Naming Convention
All DBindly attributes follow a consistent naming pattern:
dbind_[action/property]
dbind_- Prefix identifying DBindly attributes- Action/Property - What the attribute does (data, show, repeat, etc.)
Modifier Patterns
Some attributes support modifiers:
dbind_[base]-[modifier]
Examples:
dbind_repeat-empty- Empty state for repeatdbind_error-field- Field-specific errordbind_aria-label- Specific ARIA attribute
Next Steps
- Core Binding - Start with the fundamentals
- Examples - See attributes in action
- JavaScript API - Programmatic control