Skip to main content

Empty state

When there are no rows and the grid isn't loading, it shows a message over the table area.

Basic usage​

empty-state.tsx
import { Text, View } from 'react-native';
import { DataGrid } from 'expo-flash-datagrid';

import { userColumns, type User } from './data';

export function EmptyGridScreen() {
return (
<DataGrid<User>
mode="client"
rows={[]}
columns={userColumns}
emptyState={
<View style={{ alignItems: 'center', padding: 24 }}>
<Text style={{ fontWeight: '700' }}>No customers yet</Text>
<Text>Invite someone to see them here.</Text>
</View>
}
style={{ flex: 1 }}
/>
);
}

Options​

PropTypeDefaultDescription
emptyLabelstringlocaleText.emptyLabelText for the built-in empty state.
emptyStateReactNodeBuilt-in messageReplaces the empty state. Can contain buttons.

Client vs server​

In client mode the message also appears when filters or search match nothing. In server mode it appears when rows is empty and loading is false.