Custom HTML filters

🎠 Create any filtering experience you like

Custom HTML Filters are a powerful feature that allows developers to create completely customized filtering interfaces for Directual Web Components (Tables, Cards, etc.). Instead of being limited to the built-in filter components, you can write your own HTML, CSS, and JavaScript to create any filtering experience you need.

What are HTML Filters?

HTML Filters are custom user interfaces that replace the standard Directual filtering system. They consist of:

  • Custom HTML: Your own form elements, layouts, and styling

  • Interactive JavaScript: Logic to handle user interactions and generate filters

  • DQL Integration: Seamless connection to Directual's query language

  • Real-time Updates: Instant filtering as users interact with your interface

Key Benefits

βœ… Complete Design Freedom: Create filters that match your exact design requirements βœ… Advanced Interactions: Build complex filtering logic with multiple conditions βœ… Custom Components: Use any UI library or custom components you prefer βœ… Business Logic: Implement domain-specific filtering rules and validations βœ… User Experience: Design intuitive interfaces tailored to your users' needs

How It Works

  1. Enable Custom Filters: Set customHTMLfilters: true in your component props

  2. Provide HTML Content: Pass your custom HTML/CSS/JS in customHTMLfiltersContent

  3. Use the API: Access window.DirectualFilter to interact with the filtering system

  4. Generate DQL: Create Directual Query Language strings to filter data

  5. Apply Filters: Call window.DirectualFilter.emit(dql) to update the view

Use Cases

  • E-commerce: Product search with price ranges, categories, ratings, and availability

  • Real Estate: Property filters with location maps, price ranges, and feature checkboxes

  • CRM: Contact filtering with tags, date ranges, and custom field combinations

  • Analytics: Data filtering with date pickers, metric selectors, and comparison tools

  • Content Management: Article filtering with categories, authors, and publication dates

AI Prompt for Custom Filter Development

Last updated

Was this helpful?