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 |
Name | Type | Description |
---|---|---|
backdropclick | function(e) | Click handler on backdrop element |
<template><k-page><k-navbar title="Sheet Modal" /><k-block strong-ios outline-ios class="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><k-button @click="() => (sheetOpened = true)">Open Sheet</k-button></p></k-block><k-sheetclass="pb-safe":opened="sheetOpened"@backdropclick="() => (sheetOpened = false)"><k-toolbar top><div class="left" /><div class="right"><k-link toolbar @click="() => (sheetOpened = false)"> Done </k-link></div></k-toolbar><k-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 class="mt-4"><k-button @click="() => (sheetOpened = false)">Action</k-button></div></k-block></k-sheet></k-page></template><script>import { ref } from 'vue';import {kPage,kNavbar,kNavbarBackLink,kSheet,kBlock,kButton,kToolbar,kLink,} from 'konsta/vue';export default {components: {kPage,kNavbar,kNavbarBackLink,kSheet,kBlock,kButton,kToolbar,kLink,},setup() {const sheetOpened = ref(false);return {sheetOpened,};},};</script>