Dataviews DataForm Examples
DataViews and DataForm examples
by JuanMa Garrido · github.com/juanma-wp/dataviews-dataform-examples
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/juanma-wp/dataviews-dataform-examples/archive/refs/heads/main.zipDataViews & DataForm Examples Plugin
A comprehensive WordPress plugin showcasing multiple examples of DataViews and DataForm components for displaying, managing, and interacting with data in modern WordPress development.
Features
DataViews Examples
- Photos Dashboard: Browse and manage a collection of images from Unsplash API with topics and authors
- Planets Dashboard: Explore solar system planets and celestial objects data with filtering and sorting
- Demo Dashboards: Additional DataViews implementation examples showcasing different layouts and configurations
DataForm Examples
- Simple Form: Basic form implementation with text inputs and validation
- Advanced Form: Complex form with multiple field types, conditional logic, and custom validation
- Nested Fields: Form with nested data structures and array field handling
- Custom Validation: Form with comprehensive validation patterns and error handling
- Dynamic Form: Form with dynamic field generation and real-time updates
Project Structure
src/
├── examples/
│ ├── DataFormExamples/ # Form components showcasing different layouts and features
│ ├── data/ # dataset
│ ├── fields/ # Field configuration
│ └── DataViewsExamples/ # Data table implementations with various configurations
│ ├── DashboardPhotos/ # Photo gallery with Unsplash data
│ ├── DashboardsPlanets/ # Solar system data with multiple view types
│ ├── data/ # Shared datasets
│ └── fields/ # Field configurations
├── utils/ # Shared utility functions
├── App.js # Main application with navigation
├── index.js # WordPress admin integration
└── style.scss # Global styles
Related Articles
The development process is documented in the WordPress Developer Blog:
- Using Data Views to display and interact with data in plugins
- Actions from Data Views: Adding images to the Media Library
Installation & Development
Prerequisites
- WordPress 6.1 or higher
- PHP 7.4 or higher
- Node.js and npm
Setup Instructions
- Set up a local WordPress development environment
- Clone/download this repository into the
wp-content/pluginsfolder:cd wp-content/plugins git clone [repository-url] dataviews-dataform-examples - Navigate to the plugin folder:
cd dataviews-dataform-examples - Install dependencies:
npm install - Build the plugin:
npm run buildOr for development with hot reload:
npm run start - Activate the plugin in WordPress Admin → Plugins
Usage
Once activated, the plugin adds a new top-level menu item "DataViews & DataForm Examples" in the WordPress admin sidebar. Navigate through the interface to explore:
- DataViews Examples: Interactive data tables with filtering, sorting, and bulk actions
- DataForm Examples: Various form implementations demonstrating different field types, validation patterns, and data handling approaches
Each example includes live data interaction and demonstrates best practices for implementing these components in WordPress plugins.
Available Scripts
npm run build- Build the plugin for productionnpm run start- Start development mode with file watching
Dependencies
@wordpress/dataviews- Core DataViews component@wordpress/scripts- WordPress build tools@wordpress/icons- Icon library