Tablas, formularios y validación en React
Nano’s React UI uses TanStack Table v8 for data tables and Formik for form management, with Bootstrap 5 providing the styling. These libraries help you build reusable data tables and forms with support for sorting, filtering, pagination, and input validation.
This guide explains how Nano implements client-side and server-side data tables, defines reusable table columns, and handles form validation with Formik and Yup.
Data Tables
Nano includes two data table implementations: client-table y server-table. Both support pagination, sorting, and filtering, but they differ in where these operations are performed.
- Client-side tables process the available dataset in the browser. They are suitable when the data can reasonably be loaded into the frontend.
- Server-side tables request data from the backend as needed, allowing pagination, sorting, and filtering to be performed on the server.
TanStack Table v8
Nano uses TanStack Table v8, a headless table library that provides the logic for building flexible, reusable data tables. It evolved from React Table and supports multiple frontend frameworks, including React and Vue.
TanStack Table does not impose a visual design on your tables. Nano uses Bootstrap 5 table classes to style the rendered output, while allowing individual cells to contain different data or React components.
Column definitions are maintained separately from the table components, making it easier to reuse table configurations and keep column-specific logic organized.
The React and Vue versions of Nano use TanStack Table, while the Razor Pages UI uses jQuery DataTables, a separate table library suited to that frontend implementation.
Consulta el TanStack Table documentation for details on its APIs and configuration options.
Forms & Validation
Nano uses Formik to manage React forms, including form values, submission, and validation state. Form inputs are styled with Bootstrap 5 to maintain a consistent interface across the application.
Formik can be combined with Yup to define validation schemas and check user input before submitting a form. This keeps validation rules organized and makes them easier to maintain.
To understand how these libraries work together, review the existing forms in the boilerplate and use them as examples when building your own forms.
Próximos pasos
Continuar a Theme & Styling to learn how Nano’s React UI handles its theme and styles.