Sheet React Component

Sheet Modal is a special overlay type. Such modal allows to create custom picker overlays with custom content.

Contents

Sheet Modal Components

There are following components included:

  • Sheet - sheet modal element

Sheet Props

NameTypeDefaultDescription
backdropbooleantrue

Enables Sheet modal backdrop (dark semi transparent layer behind)

colorsobject

Object with Tailwind CSS colors classes

colors.bgIosstring'bg-ios-light-surface-1 dark:bg-ios-dark-surface-1'
colors.bgMaterialstring'bg-md-light-surface dark:bg-md-dark-surface'
componentstring'div'

Component's HTML Element

onBackdropClickfunction(e)

Click handler on backdrop element

openedbooleanfalse

Allows to open/close Sheet modal and set its initial state

Examples

SheetModal.jsx
import React, { useState } from 'react';
import {
Page,
Navbar,
NavbarBackLink,
Sheet,
Block,
Button,
Toolbar,
ToolbarPane,
Link,
} from 'konsta/react';
import CloseIcon from '../components/CloseIcon';
export default function SheetModalPage() {
const [sheetOpened, setSheetOpened] = useState(false);
return (
<Page>
<Navbar
title="Sheet Modal"
/>
<Block strong inset className="space-y-4">
<p>
Sheet Modals slide up from the bottom of the screen to reveal more
content. Such modals allow to create custom overlays with custom
content.
</p>
<p>
<Button rounded onClick={() => setSheetOpened(true)}>
Open Sheet
</Button>
</p>
</Block>
<Sheet
className="pb-safe"
opened={sheetOpened}
onBackdropClick={() => setSheetOpened(false)}
>
<Toolbar top className="justify-end ios:pt-4">
<div className="ios:hidden" />
<ToolbarPane>
<Link iconOnly onClick={() => setSheetOpened(false)}>
<CloseIcon />
</Link>
</ToolbarPane>
</Toolbar>
<Block className="ios:mt-4">
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Harum ad
excepturi nesciunt nobis aliquam. Quibusdam ducimus neque
necessitatibus, molestias cupiditate velit nihil alias incidunt,
excepturi voluptatem dolore itaque sapiente dolores!
</p>
<div className="mt-8">
<Button large rounded onClick={() => setSheetOpened(false)}>
Action
</Button>
</div>
</Block>
</Sheet>
</Page>
);
}
Code licensed under MIT.
2025 © Konsta UI by nolimits4web.