Skip to content
Docs
Components
Modal

Modal

Component to render a modal imported from react-native-modal

https://github.com/react-native-modal/react-native-modal (opens in a new tab)

Import

import { Modal } from 'react-native-ficus-ui';

Usage

EDITABLE EXAMPLE
const TestModal = () => {
  const { isOpen, onOpen, onClose } = useDisclosure();
  return (
    <Box>
      <Button
        onPress={() => {
          onOpen();
        }}
      >
        Show Modal
      </Button>

      <Modal isOpen={isOpen}>
        <Button
          h={35}
          w={35}
          position="absolute"
          top={50}
          right={15}
          borderRadius="full"
          colorScheme="gray"
          onPress={() => {
            onClose();
          }}
        >
          <Icon color="white" name="close" />
        </Button>
      </Modal>
    </Box>
  );
}
render(<TestModal />)

Props

isOpen

Boolean to indicate if modal is opened or not.

TypeRequiredDefault
booleanNofalse

bg

The background color property (backgroundColor style prop in StyleSheet)

TypeRequired
stringNo

m

The margin property (margin style prop in StyleSheet)

TypeRequired
number, stringNo

mt

The margin top property (marginTop style prop in StyleSheet)

TypeRequired
number, stringNo

mb

The margin bottom property (marginBottom style prop in StyleSheet)

TypeRequired
number, stringNo

mr

The margin right property (marginRight style prop in StyleSheet)

TypeRequired
number, stringNo

ml

The margin left property (marginLeft style prop in StyleSheet)

TypeRequired
number, stringNo

mx

The margin horizontal property (marginHorizontal style prop in StyleSheet)

TypeRequired
number, stringNo

my

The margin vertical property (marginVertical style prop in StyleSheet)

TypeRequired
number, stringNo

p

The padding property (padding style prop in StyleSheet)

TypeRequired
number, stringNo

pt

The padding top property (paddingTop style prop in StyleSheet)

TypeRequired
number, stringNo

pb

The padding bottom property (paddingBottom style prop in StyleSheet)

TypeRequired
number, stringNo

pr

The padding right property (paddingRight style prop in StyleSheet)

TypeRequired
number, stringNo

pl

The padding left property (paddingLeft style prop in StyleSheet)

TypeRequired
number, stringNo

px

The padding horizontal property (paddingHorizontal style prop in StyleSheet)

TypeRequired
number, stringNo

py

The padding vertical property (paddingVertical style prop in StyleSheet)

TypeRequired
number, stringNo

h

The height property (height style prop in StyleSheet)

TypeRequired
number, stringNo

justifyContent

The justify content property for container (justifyContent style prop in StyleSheet)

TypeRequired
enum("flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly")No

borderRadius

The border radius property (borderRadius style prop in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderTopRadius

The border radius top property (borderTopLeftRadius and borderTopRightRadius style props in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderBottomRadius

The border radius bottom property (borderBottomLeftRadius and borderBottomRightRadius style props in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderLeftRadius

The border radius left property (borderTopLeftRadius and borderBottomLeftRadius style props in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderRightRadius

The border radius right property (borderTopRightRadius and borderBottomRightRadius style props in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderTopLeftRadius

The border radius top left property (borderTopLeftRadius style prop in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderTopRightRadius

The border radius top right property (borderTopRightRadius style prop in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderBottomLeftRadius

The border radius bottom left property (borderBottomLeftRadius style prop in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderBottomRightRadius

The border radius bottom right property (borderBottomRightRadius style prop in StyleSheet)

TypeRequiredDefault
number, stringNonone

borderColor

The border color property (borderColor style prop in StyleSheet)

TypeRequired
stringNo

borderTopColor

The border top color property (borderTopColor style prop in StyleSheet)

TypeRequired
stringNo

borderBottomColor

The border bottom color property (borderBottomColor style prop in StyleSheet)

TypeRequired
stringNo

borderRightColor

The border right color property (borderRightColor style prop in StyleSheet)

TypeRequired
stringNo

borderLeftColor

The border left color property (borderLeftColor style prop in StyleSheet)

TypeRequired
stringNo

borderWidth

The border width property (borderWidth style prop in StyleSheet)

TypeRequired
numberNo

borderTopWidth

The border top width property (borderTopWidth style prop in StyleSheet)

TypeRequired
numberNo

borderBottomWidth

The border bottom width property (borderBottomWidth style prop in StyleSheet)

TypeRequired
numberNo

borderRightWidth

The border right width property (borderRightWidth style prop in StyleSheet)

TypeRequired
numberNo

borderLeftWidth

The border left width property (borderLeftWidth style prop in StyleSheet)

TypeRequired
numberNo