Sheet Modal is a special overlay type. Such modal allows to create custom picker overlays with custom content.
There are following components included:
Sheet
- sheet modal elementName | Type | Default | Description |
---|---|---|---|
backdrop | boolean | true | Enables Sheet modal backdrop (dark semi transparent layer behind) |
colors | object | Object with Tailwind CSS colors classes | |
colors.bgIos | string | 'bg-white dark:bg-black' | |
colors.bgMaterial | string | 'bg-md-light-surface dark:bg-md-dark-surface' | |
component | string | 'div' | Component's HTML Element |
opened | boolean | false | Allows to open/close Sheet modal and set its initial state |
onBackdropClick | function(e) | Click handler on backdrop element |
import React, { useState } from 'react';import {Page,Navbar,NavbarBackLink,Sheet,Block,Button,Toolbar,Link,} from 'konsta/react';export default function SheetModalPage() {const [sheetOpened, setSheetOpened] = useState(false);return (<Page><Navbartitle="Sheet Modal"/><Block strongIos outlineIos className="space-y-4"><p>Sheet Modals slide up from the bottom of the screen to reveal morecontent. Such modals allow to create custom overlays with customcontent.</p><p><Button onClick={() => setSheetOpened(true)}>Open Sheet</Button></p></Block><SheetclassName="pb-safe"opened={sheetOpened}onBackdropClick={() => setSheetOpened(false)}><Toolbar top><div className="left" /><div className="right"><Link toolbar onClick={() => setSheetOpened(false)}>Done</Link></div></Toolbar><Block><p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Harum adexcepturi nesciunt nobis aliquam. Quibusdam ducimus nequenecessitatibus, molestias cupiditate velit nihil alias incidunt,excepturi voluptatem dolore itaque sapiente dolores!</p><div className="mt-4"><Button onClick={() => setSheetOpened(false)}>Action</Button></div></Block></Sheet></Page>);}