There are following components included:
Panel
- side panel elementName | Type | Default | Description |
---|---|---|---|
backdrop | boolean | true | Enables Panel backdrop (dark semi transparent layer behind) |
colors | object | Object with Tailwind CSS colors classes | |
colors.bg | string | 'bg-white dark:bg-black' | Panel bg color |
component | string | 'div' | Component's HTML Element |
floating | boolean | false | When enabled opened panel will have extra spaces from sides |
opened | boolean | false | Allows to open/close Panel and set its initial state |
side | 'left' | 'right' | 'left' | Panel side |
size | string | 'w-72 h-screen' | Tailwind CSS size classes |
Name | Type | Description |
---|---|---|
backdropclick | function(e) | Click handler on backdrop element |
<template><k-page><k-navbar title="Panel / Side Panel" /><k-block strong-ios outline-ios class="space-y-4"><p>Konsta UI comes with 2 panels (on left and on right), both are optional.You can put absolutely anything inside: data lists, forms, customcontent, etc.</p></k-block><k-block strong-ios outline-ios class="flex space-x-4 rtl:space-x-reverse"><k-button @click="() => (leftPanelOpened = true)">Left Panel</k-button><k-button @click="() => (rightPanelOpened = true)">Right Panel</k-button></k-block><k-block-title>Floating Panels</k-block-title><k-block strong-ios outline-ios class="flex space-x-4 rtl:space-x-reverse"><k-button @click="() => (leftFloatingPanelOpened = true)">Left Panel</k-button><k-button @click="() => (rightFloatingPanelOpened = true)">Right Panel</k-button></k-block><k-panelside="left":opened="leftPanelOpened"@backdropclick="() => (leftPanelOpened = false)"><k-page><k-navbar title="Left Panel"><template #right><k-link navbar @click="() => (leftPanelOpened = false)">Close</k-link></template></k-navbar><k-block class="space-y-4"><p>Here comes left panel.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendissefaucibus mauris leo, eu bibendum neque congue non. Ut leo mauris,eleifend eu commodo a, egestas ac urna. Maecenas in lacus faucibus,viverra ipsum pulvinar, molestie arcu. Etiam lacinia venenatisdignissim. Suspendisse non nisl semper tellus malesuada suscipit euet eros. Nulla eu enim quis quam elementum vulputate. Mauris ornareconsequat nunc viverra pellentesque. Aenean semper eu massa sit ametaliquam. Integer et neque sed libero mollis elementum at vitaeligula. Vestibulum pharetra sed libero sed porttitor. Suspendisse afaucibus lectus.</p></k-block></k-page></k-panel><k-panelside="right":opened="rightPanelOpened"@backdropclick="() => (rightPanelOpened = false)"><k-page><k-navbar title="Right Panel"><template #right><k-link navbar @click="() => (rightPanelOpened = false)">Close</k-link></template></k-navbar><k-block class="space-y-4"><p>Here comes right panel.</p><p>Duis ut mauris sollicitudin, venenatis nisi sed, luctus ligula.Phasellus blandit nisl ut lorem semper pharetra. Nullam tortor nibh,suscipit in consequat vel, feugiat sed quam. Nam risus libero,auctor vel tristique ac, malesuada ut ante. Sed molestie, est ineleifend sagittis, leo tortor ullamcorper erat, at vulputate erossapien nec libero. Mauris dapibus laoreet nibh quis bibendum. Fuscedolor sem, suscipit in iaculis id, pharetra at urna. Pellentesquetempor congue massa quis faucibus. Vestibulum nunc eros, convallisblandit dui sit amet, gravida adipiscing libero.</p></k-block></k-page></k-panel><k-panelside="left"floating:opened="leftFloatingPanelOpened"@backdropclick="() => (leftFloatingPanelOpened = false)"><k-page class="no-safe-areas-top no-safe-areas-bottom"><k-navbar title="Left Panel"><template #right><k-link navbar @click="() => (leftFloatingPanelOpened = false)">Close</k-link></template></k-navbar><k-block class="space-y-4"><p>Here comes left panel.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendissefaucibus mauris leo, eu bibendum neque congue non. Ut leo mauris,eleifend eu commodo a, egestas ac urna. Maecenas in lacus faucibus,viverra ipsum pulvinar, molestie arcu. Etiam lacinia venenatisdignissim. Suspendisse non nisl semper tellus malesuada suscipit euet eros. Nulla eu enim quis quam elementum vulputate. Mauris ornareconsequat nunc viverra pellentesque. Aenean semper eu massa sit ametaliquam. Integer et neque sed libero mollis elementum at vitaeligula. Vestibulum pharetra sed libero sed porttitor. Suspendisse afaucibus lectus.</p></k-block></k-page></k-panel><k-panelside="right"floating:opened="rightFloatingPanelOpened"@backdropclick="() => (rightFloatingPanelOpened = false)"><k-page class="no-safe-areas-top no-safe-areas-bottom"><k-navbar title="Right Panel"><template #right><k-link navbar @click="() => (rightFloatingPanelOpened = false)">Close</k-link></template></k-navbar><k-block class="space-y-4"><p>Here comes right panel.</p><p>Duis ut mauris sollicitudin, venenatis nisi sed, luctus ligula.Phasellus blandit nisl ut lorem semper pharetra. Nullam tortor nibh,suscipit in consequat vel, feugiat sed quam. Nam risus libero,auctor vel tristique ac, malesuada ut ante. Sed molestie, est ineleifend sagittis, leo tortor ullamcorper erat, at vulputate erossapien nec libero. Mauris dapibus laoreet nibh quis bibendum. Fuscedolor sem, suscipit in iaculis id, pharetra at urna. Pellentesquetempor congue massa quis faucibus. Vestibulum nunc eros, convallisblandit dui sit amet, gravida adipiscing libero.</p></k-block></k-page></k-panel></k-page></template><script>import { ref } from 'vue';import {kPage,kNavbar,kNavbarBackLink,kPanel,kBlock,kBlockTitle,kLink,kButton,} from 'konsta/vue';export default {components: {kPage,kNavbar,kNavbarBackLink,kPanel,kBlock,kBlockTitle,kLink,kButton,},setup() {const leftPanelOpened = ref(false);const rightPanelOpened = ref(false);const leftFloatingPanelOpened = ref(false);const rightFloatingPanelOpened = ref(false);return {leftPanelOpened,rightPanelOpened,leftFloatingPanelOpened,rightFloatingPanelOpened,};},};</script>