Skip to main content

CupertinoActionSheet

An iOS-style action sheet.

Examples

Live example

Basic Example

import flet as ft

def main(page):
page.theme_mode = ft.ThemeMode.LIGHT
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER

action_sheet = ft.CupertinoActionSheet(
title=ft.Text("Title"),
message=ft.Text("Message"),
cancel=ft.CupertinoActionSheetAction(
content=ft.Text("Cancel"),
on_click=lambda e: page.close_bottom_sheet(),
),
actions=[
ft.CupertinoActionSheetAction(
content=ft.Text("Default Action"),
is_default_action=True,
on_click=lambda e: print("Default clicked"),
),
ft.CupertinoActionSheetAction(
content=ft.Text("Normal Action"),
on_click=lambda e: print("Normal Action clicked"),
),
ft.CupertinoActionSheetAction(
content=ft.Text("Destructive Action"),
is_destructive_action=True,
on_click=lambda e: print("Destructive Action clicked"),
),
],
)

page.add(
ft.OutlinedButton(
"Open CupertinoBottomSheet containing CupertinoActionSheet",
on_click=lambda e: page.show_bottom_sheet(
ft.CupertinoBottomSheet(action_sheet)
),
)
)

ft.app(main)

Properties

actions

A list of action buttons to be shown in the sheet. These actions are typically CupertinoActionSheetActions. This list must have at least one action.

cancel

An optional control to be shown below the actions but grouped separately from them. Typically a CupertinoActionSheetAction button.

message

A control containing a descriptive message that provides more details about the reason for the alert. Typically a Text control.

title

A control containing the title of the action sheet. Typically a Text control.