React Native MantineData display

EmptyState

Tell the user that there is no content to display

Import: import { EmptyState } from 'react-native-mantine';

Usage

import { EmptyState, Button, Icon } from 'react-native-mantine';

<EmptyState
  title="No projects yet"
  description="Create your first project to get started."
  icon={<Icon name="inbox" size={28} color="#228be6" />}
  withIndicatorBackground
  color="blue"
  size="md"
  align="center"
>
  <EmptyState.Actions>
    <Button size="xs">Create project</Button>
    <Button size="xs" variant="outline">Import</Button>
  </EmptyState.Actions>
</EmptyState>

// Compound components are also available:
// EmptyState.Indicator, EmptyState.Title,
// EmptyState.Description, EmptyState.Actions

Props

PropTypeDefaultDescription
titleReact.ReactNodeTitle displayed below the icon
descriptionReact.ReactNodeDescription displayed below the title
iconReact.ReactNodeIcon displayed inside the indicator
size'xs' | 'sm' | 'md' | 'lg' | 'xl'"md"Controls icon, title and description sizes
align'left' | 'center' | 'right'"center"Content alignment
variant'filled' | 'light'"light"Controls indicator colors
colorMantineColorKey of theme.colors or any valid color, controls indicator color
withIndicatorBackgroundbooleanfalseDetermines whether the indicator should have a background
childrenReact.ReactNodeContent displayed below the description, usually EmptyState.Actions
styleViewStyleAdditional styles to apply to the root element

Source on GitHub · npm