Overview
The View API provides resources to create new data fields, custom views, all while handling selection, customization, and permissions.
Data fields
Data fields can be added to Index’s field selection list for use in any view. In table views they are displayed as columns in grid views they are displayed as line items. Data fields are registered in PHP and can be enhanced further in Javascript. Be aware that data fields need to still be added to individual views in the settings panel after being registered.
Views and items
Views handle the layout and display of individual items returned from a post type’s REST request. Instead of creating an entire view, this resource creates new single items in addition to settings to handle the view type, padding, and mobile customizations. New views are registered with PHP and require an additional Javascript hook to output content.
Selection
A selection component is passed into every custom view item to handle item selection. It abstracts checking and requesting item selection, verifying permissions, and even handling dark mode. Included are customization options to make your views as flexible as possible.
Layout
The built-in layout options provide full view customization without having to add custom CSS that might break with updates. Choose between grid and table layouts on desktop and optionally include a separate item component for the list layout used on mobile devices.