アクションシートは、ユーザーに特定のタスクの処理方法に関する選択肢を提供するための、スライドアップパネルです。
潜在的に危険なアクションの確認をユーザーに促すためにも、アクションシートを使用できます。
アクションシートには、オプションのタイトルと1つ以上のボタンが含まれており、各ボタンは実行するアクションに対応しています。
次のコンポーネントが含まれています。
Actions
ActionsButton
ActionsLabel
ActionsGroup
名前 | 型 | デフォルト | 説明 |
---|---|---|---|
backdrop | boolean | true | アクションシートのバックドロップ(背後にある暗い半透明レイヤー)を有効にします。 |
component | string | 'div' | コンポーネントのHTML要素 |
opened | boolean | false | アクションシートを開閉し、初期状態を設定できます。 |
名前 | 型 | 説明 |
---|---|---|
backdropclick | function(e) | バックドロップ要素のクリックハンドラー |
名前 | 型 | デフォルト | 説明 |
---|---|---|---|
bold | boolean | undefined | ボタンのテキストを太字にします。 |
boldIos | boolean | false | iOSテーマでボタンのテキストを太字にします。 |
boldMaterial | boolean | false | Materialテーマでボタンのテキストを太字にします。 |
colors | object | Tailwind CSSカラークラスを含むオブジェクト | |
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' | コンポーネントのHTML要素 |
dividers | boolean | undefined | ボタンの外側のヘアライン(ボーダー)を描画します。指定されていない場合、iOSテーマで有効になります。 |
fontSizeIos | string | 'text-xl' | iOSテーマでのボタンテキストのフォントサイズ |
fontSizeMaterial | string | 'text-base' | Materialテーマでのボタンテキストのフォントサイズ |
href | string | リンクの | |
touchRipple | boolean | true | Materialテーマでタッチリップル効果を有効にします。 |
名前 | 型 | デフォルト | 説明 |
---|---|---|---|
colors | object | Tailwind CSSカラークラスを含むオブジェクト | |
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' | コンポーネントのHTML要素 |
dividers | boolean | undefined | ボタンの外側のヘアライン(ボーダー)を描画します。指定されていない場合、iOSテーマで有効になります。 |
fontSizeIos | string | 'text-sm' | iOSテーマでのボタンテキストのフォントサイズ |
fontSizeMaterial | string | 'text-sm' | Materialテーマでのボタンテキストのフォントサイズ |
名前 | 型 | デフォルト | 説明 |
---|---|---|---|
component | string | 'div' | コンポーネントのHTML要素 |
dividers | boolean | true | グループの外側のヘアライン(ボーダー)を描画します。(Materialテーマのみ) |
<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>