Skip to main content

Backdrop

Basic Usage

Hello world

import { Button, Backdrop } from 'chic-ui';

const BasicBackdrop = () => {
const [open, setOpen] = React.useState(false);
const handleClose = () => {
setOpen(false);
};
const handleToggle = () => {
setOpen(!open);
};

return (
<>
<Button onClick={handleToggle}>Toggle</Button>
<Backdrop visible={open} onClick={handleClose}>
<p>Hello world</p>
</Backdrop>
</>
);
};

Custom Colored Backdrop

Hello world

<Backdrop color="red" />

Invisible

<Backdrop color="red" visible={false} />

API

import { Backdrop } from 'chic-ui';
NameTypeDefaultDescription
visiblebooleantrueIf set to `true`, the Backdrop component will not be hidden
colorstringColor of backdrop
onClickfunctionSpecify a function that will be called when the Backdrop is clicked
classNamestringProvide external classnames to the component
styleReact.CSSPropertiesOverride default styling of the component
childrenReactNodeContents of the backdrop