Intead of using the default search bar, I'd like to customize it as follows:
- Add a button in front of the search bar.
- Use an icon (
<i className="fa fa-search"/>
) in the search placeholder.
Here's my code so far:
import { Grid, _ } from 'gridjs-react';
const tableColumns = [
'Name',
'Phone',
{
name: 'Custom component',
formatter: (text) => _(<b>{text}</b>)
}
]
const tableData = [
['John', 12345, 'myText1'],
['Mike', 67891, 'myText2'],
]
export default function myCustomGrid() {
return (
<Grid
sort={true}
search={true} // This adds the search inp
columns={tableColumns}
data={tableData}
language={{
search: {
placeholder: ' Search...'
}
}}
pagination={{
enabled: true,
limit: 2
}}
/>
);
}