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

AttributeCategoryDescription
dbind_dataCore BindingBind text content to a data field
dbind_htmlCore BindingBind HTML content (use with caution)
dbind_formatFormattingApply formatting filters to values
dbind_defaultCore BindingFallback value when data is missing
dbind_hrefHTML AttributesBind link URL
dbind_srcHTML AttributesBind image/media source
dbind_altHTML AttributesBind image alt text
dbind_titleHTML AttributesBind element title
dbind_placeholderHTML AttributesBind input placeholder
dbind_classStylingDynamically add CSS classes
dbind_styleStylingDynamically add inline styles
dbind_showVisibilityShow element when truthy
dbind_hideVisibilityHide element when truthy
dbind_ifVisibilityConditional display with operators
dbind_unlessVisibilityInverse of dbind_if
dbind_emptyVisibilityShow when array/value is empty
dbind_repeatListsRepeat element for each array item
dbind_repeat-emptyListsShow when repeated array is empty
dbind_filterListsFilter repeated items
dbind_sortListsSort repeated items
dbind_limitListsLimit number of repeated items
dbind_collectionCollectionsLoad collection data
dbind_searchCollectionsSearch input for filtering
dbind_paginateCollectionsAdd pagination controls
dbind_loadmoreCollectionsAdd load more button
dbind_page-infoCollectionsDisplay pagination info
dbind_reactiveData LoadingSubscribe to real-time updates for a data item
dbind_modelFormsTwo-way data binding for inputs
dbind_clickFormsHandle click events
dbind_submitFormsHandle form submissions
dbind_errorFormsDisplay general error messages
dbind_error-fieldFormsDisplay field-specific errors
dbind_skeletonLoadingShow skeleton loading state
dbind_loadingLoadingShow/hide during loading
dbind_cloakAnimationsHide until content loads
dbind_transitionAnimationsAdd entrance animations
dbind_aria-*AccessibilityDynamic ARIA attributes
dbind_liveAccessibilityAnnounce 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 data
  • dbind_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.

Styling

Dynamically control CSS classes and inline styles based on your data.

Visibility & Conditionals

Control element visibility based on data conditions.

Lists & Repetition

Render arrays and collections with filtering, sorting, and limiting.

Collections & Pagination

Work with server-side collections including search and pagination.

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 JavaScript
  • dbind_reactive - Real-time subscription to a data item
  • dbind_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.

Formatting & Filters

Apply formatting transformations to data values.

  • dbind_format - Apply formatting filters (currency, date, etc.)

Loading States

Control loading indicators and skeleton screens.

Animations & Transitions

Add smooth animations when content loads or changes.

Accessibility

Ensure your dynamic content is accessible to all users.


Similar Attributes Comparison

Understanding when to use similar-looking attributes is crucial for effective DBindly usage.

dbind_show vs dbind_hide vs dbind_if

AttributeConditionUse When
dbind_showShows when truthySimple boolean check (e.g., isActive)
dbind_hideHides when truthyInverse of show (e.g., hide when isLoading)
dbind_ifSupports operatorsComplex 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

AttributeOutputSecurityUse When
dbind_dataText only (escaped)SafeUser-generated content, any text
dbind_htmlRaw HTMLDangerousTrusted 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

AttributeData SourceUse When
dbind_repeatIn-memory arrayData already loaded, client-side arrays
dbind_collectionServer-sideFetching 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

AttributeTypeFilteringUse When
dbind_filterAttributeStatic, field-basedFilter by category, status, etc.
dbind_searchInputDynamic, text-basedUser 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

AttributeUI PatternUse When
dbind_paginateNumbered pagesTraditional pagination, known page count
dbind_loadmoreInfinite scrollSocial 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 repeat
  • dbind_error-field - Field-specific error
  • dbind_aria-label - Specific ARIA attribute

Next Steps