Krizaka
Documentation

Action sheet

A short list of actions on an item from the bottom edge, the destructive one in danger, cancel apart.

MobileBetaOverlays

Mobile only — React Native, from @krizaka/ui/native. Beta: its API may still change in a minor version.

When to use

  • The “more” button of a video, a message, a comment.
  • Choosing where a photo comes from: the library or the camera.

When not to use

  • For more than six actions or for content.Use instead: Dialog
  • To confirm what the action does.Use instead: Dialog

Installation

Install

npx expo install react-native-svg
npm install @krizaka/ui

Import

import { ActionSheet } from "@krizaka/ui/native";

Wrap the app once in ThemeProvider from @krizaka/ui/native: every component reads its colour roles.

Examples

React Native has no live preview on the web: each example shows the screenshot of its story, tested in both themes, and the code to copy.

A video's actions

Share, auction, edit, delete — cancel apart.

Action sheet — A video's actions, as React Native renders itAction sheet — A video's actions, as React Native renders it

Props

A short list of actions from the bottom edge — share, edit, delete — and a cancel button apart, as the platforms do.

PropTypeDefaultDescription
actionsrequiredreadonly ActionSheetAction[]—The choices, in order.
cancelLabelrequiredstring—The cancel button's words (“Cancel”) — passed translated.
titlerequiredstring—What the choices are about (“Your video”) — the accessible name.
defaultOpenboolean—Open at first, uncontrolled.
descriptionstring—One line under the title.
onOpenChange((open: boolean) => void)—Called when it opens or closes (the back button, the scrim, an action).
openboolean—Open (controlled).

Accessibility

  • A menu of menuitems named by the title; cancel is a button apart.
  • A selection tick on each action when the app gives haptics.

Best practices

  • Put the destructive action last, in its own words (“Delete the video”).
  • Keep it to verbs: share, edit, start an auction.

Generated from the code of @krizaka/ui 3.5.0: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page