Action Sheet is a slide-up pane for presenting the user with a set of alternatives for how to proceed with a given task.
You can also use action sheets to prompt the user to confirm a potentially dangerous action.
The action sheet contains an optional title and one or more buttons, each of which corresponds to an action to take.
There are following components included:
Actions
ActionsButton
ActionsLabel
ActionsGroup
Name | Type | Default | Description |
---|---|---|---|
backdrop | boolean | true | Enables Action Sheet backdrop (dark semi transparent layer behind) |
component | string | 'div' | Component's HTML Element |
opened | boolean | false | Allows to open/close Action Sheet and set its initial state |
Name | Type | Description |
---|---|---|
backdropclick | function(e) | Click handler on backdrop element |
Name | Type | Default | Description |
---|---|---|---|
bold | boolean | undefined | Makes button text bold. Overwrites |
boldIos | boolean | false | Makes button text bold in iOS theme |
boldMaterial | boolean | false | Makes button text bold in Material theme |
colors | object | Object with Tailwind CSS colors classes | |
colors.activeBgIos | string | 'active:bg-neutral-200 dark:active:bg-neutral-700' | |
colors.activeBgMaterial | string | '' | |
colors.bgIos | string | 'bg-white dark:bg-neutral-800' | |
colors.bgMaterial | string | 'bg-md-light-surface-3 dark:bg-md-dark-surface-3' | |
colors.textIos | string | 'text-primary' | |
colors.textMaterial | string | 'text-md-light-on-surface dark:text-md-dark-on-surface' | |
component | string | 'button' | Component's HTML Element |
dividers | boolean | undefined | Renders button outer hairlines (borders). If not specified, will be enabled for iOS theme |
fontSizeIos | string | 'text-xl' | Button text font size in iOS theme |
fontSizeMaterial | string | 'text-base' | Button text font size in Material theme |
href | string | Link's | |
touchRipple | boolean | true | Enables touch ripple effect in Material theme |
Name | Type | Default | Description |
---|---|---|---|
colors | object | Object with Tailwind CSS colors classes | |
colors.bgIos | string | 'bg-white dark:bg-neutral-800' | |
colors.bgMaterial | string | 'bg-md-light-surface-3 dark:bg-md-dark-surface-3' | |
colors.textIos | string | 'text-black text-opacity-55 dark:text-white dark:text-opacity-55' | |
colors.textMaterial | string | 'text-md-light-primary dark:text-md-dark-primary' | |
component | string | 'div' | Component's HTML Element |
dividers | boolean | undefined | Renders button outer hairlines (borders). If not specified, will be enabled in iOS theme |
fontSizeIos | string | 'text-sm' | Button text font size in iOS theme |
fontSizeMaterial | string | 'text-sm' | Button text font size in Material theme |
Name | Type | Default | Description |
---|---|---|---|
component | string | 'div' | Component's HTML Element |
dividers | boolean | true | Renders group outer hairlines (borders). (in Material theme only) |
<template><k-page><k-navbar title="ActionSheet" /><k-block strong inset class="space-y-4"><p>Action Sheet is a slide-up pane for presenting the user with a set ofalternatives for how to proceed with a given task.</p></k-block><k-block-title>Open Action Sheet</k-block-title><k-block strong inset class="flex space-x-4 rtl:space-x-reverse"><k-button @click="() => (actionsOneOpened = true)">One group</k-button><k-button @click="() => (actionsTwoOpened = true)">Two groups</k-button></k-block><k-actions:opened="actionsOneOpened"@backdropclick="() => (actionsOneOpened = false)"><k-actions-group><k-actions-label>Do something</k-actions-label><k-actions-button bold @click="() => (actionsOneOpened = false)">Button 1</k-actions-button><k-actions-button @click="() => (actionsOneOpened = false)">Button 2</k-actions-button><k-actions-button @click="() => (actionsOneOpened = false)">Cancel</k-actions-button></k-actions-group></k-actions><k-actions:opened="actionsTwoOpened"@backdropclick="() => (actionsTwoOpened = false)"><k-actions-group><k-actions-label>Do something</k-actions-label><k-actions-button bold @click="() => (actionsTwoOpened = false)">Button 1</k-actions-button><k-actions-button @click="() => (actionsTwoOpened = false)">Button 2</k-actions-button></k-actions-group><k-actions-group><k-actions-button @click="() => (actionsTwoOpened = false)">Cancel</k-actions-button></k-actions-group></k-actions></k-page></template><script>import {kPage,kNavbar,kNavbarBackLink,kBlockTitle,kBlock,kButton,kActions,kActionsButton,kActionsLabel,kActionsGroup,} from 'konsta/vue';import { ref } from 'vue';export default {components: {kPage,kNavbar,kNavbarBackLink,kBlockTitle,kBlock,kButton,kActions,kActionsButton,kActionsLabel,kActionsGroup,},setup() {const actionsOneOpened = ref(false);const actionsTwoOpened = ref(false);return {actionsOneOpened,actionsTwoOpened,};},};</script>