0.0.3 • Published 4 years ago
@w3b6x9/grid v0.0.3
Supabase Grid
A react component to display your Postgresql table data.
Usage
<SupabaseGrid
table="countries"
clientProps={{
supabaseUrl: '',
supabaseKey: '',
}}
/>table variable can be:
- SupaTable object
- Table or View name
- Readonly: support both table and view
- Editable: only for table. Required to create Postgresql functions so that it can pull your table info.
Properties
tabledatabase table swagger or table name.clientPropsprops to create Supabase client.gridPropsprops to config grid view.schematable schema. Defaults to 'public'.storageRefstorageRef is used to save state on localstorage.editableenable table editor.headerActionsreact node to display in grid header.themegrid theme.onAddColumnshow create new column button if available.onAddRowshow add row button if available.onErrorerror handler.onEditColumnshow edit column menu if available.onDeleteColumnshow delete column menu if available.onEditRowshow edit row button if available.
Run example
- Build library:
npm start - Go to example folder:
cd example - Create .env file:
cp .env.example .env - Update example/.env file with your Supabase project URL and key
- Run example app:
npm start
Contributing
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes and merge
License
This repo is licensed under MIT.