What are Controls?
Controls in Flet are Python objects that represent visual elements in your application. Each control can be configured with properties and can respond to user interactions through event handlers.Material vs Cupertino
Flet supports two major design systems:Material Design
Google’s Material Design language - provides a modern, clean aesthetic used in Android and web applications.
Cupertino
Apple’s iOS design language - delivers a native iOS look and feel for iPhone and iPad apps.
Material Design
Material Design controls follow Google’s design principles, featuring:- Elevation and shadows for depth perception
- Material ripple effects for interactive feedback
- Bold colors and high contrast
- Rounded corners and smooth animations
Cupertino (iOS-style)
Cupertino controls match Apple’s Human Interface Guidelines:- Flat design with minimal shadows
- Subtle animations and transitions
- iOS-native colors and typography
- Characteristic iOS interactions like swipe gestures
Adaptive Controls
Many Flet controls support adaptive mode, automatically selecting Material or Cupertino styling based on the platform:Control Categories
Flet controls are organized into several categories:Layout
Arrange and position other controls - Row, Column, Stack, Container
Navigation
Help users navigate your app - AppBar, NavigationBar, Drawer
Input
Collect user input - TextField, Button, Checkbox, Slider
Dialogs
Display overlays and modal content - AlertDialog, BottomSheet
Common Control Properties
All Flet controls share common properties:| Property | Type | Description |
|---|---|---|
visible | bool | Whether the control is visible |
disabled | bool | Whether the control is disabled |
width | Number | Fixed width in pixels |
height | Number | Fixed height in pixels |
expand | bool/int | Whether to expand to fill available space |
tooltip | str | Tooltip text shown on hover |
data | any | Custom data associated with the control |
Event Handling
Controls can respond to user interactions through event handlers:on_click- User clicks the controlon_change- Control value changeson_focus- Control receives focuson_blur- Control loses focuson_hover- Mouse enters/exits control
Next Steps
Explore specific control categories:- Material Controls - Material Design controls
- Cupertino Controls - iOS-style controls
- Layout Controls - Arrange your UI
- Navigation Controls - App navigation
- Input Controls - User input
- Dialogs - Overlays and modals