Documentation
¶
Overview ¶
Package bottomsheet contains Material 3 Bottom Sheet components.
Reference: [Bottom Sheets](https://m3.material.io/components/bottom-sheets/overview) Specs: [Bottom Sheets Specs](https://m3.material.io/components/bottom-sheets/specs)
Index ¶
- type Composable
- type Composer
- type ModalBottomSheetOption
- func WithContainerColor(col graphics.Color) ModalBottomSheetOption
- func WithIsOpen(isOpen bool) ModalBottomSheetOption
- func WithOnDismissRequest(onDismiss func()) ModalBottomSheetOption
- func WithScrimColor(col graphics.Color) ModalBottomSheetOption
- func WithSheetState(state *SheetState) ModalBottomSheetOption
- type ModalBottomSheetOptions
- type SheetState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Composable ¶
type Composable = api.Composable
func ModalBottomSheet ¶
func ModalBottomSheet( sheetContent Composable, content Composable, options ...ModalBottomSheetOption, ) Composable
type ModalBottomSheetOption ¶
type ModalBottomSheetOption func(*ModalBottomSheetOptions)
func WithContainerColor ¶
func WithContainerColor(col graphics.Color) ModalBottomSheetOption
func WithIsOpen ¶
func WithIsOpen(isOpen bool) ModalBottomSheetOption
WithIsOpen is useful if the parent controls the state specifically without a SheetState object, but usually SheetState is preferred for imperative show/hide. Let's align with Drawer: it uses `IsOpen` and `OnClose`.
func WithOnDismissRequest ¶
func WithOnDismissRequest(onDismiss func()) ModalBottomSheetOption
func WithScrimColor ¶
func WithScrimColor(col graphics.Color) ModalBottomSheetOption
func WithSheetState ¶
func WithSheetState(state *SheetState) ModalBottomSheetOption
type ModalBottomSheetOptions ¶
type ModalBottomSheetOptions struct {
IsOpen bool // Controlled by parent usually, or we can use visible state?
OnDismissRequest func()
SheetState *SheetState
ContainerColor graphics.Color // Will use default if not set
ScrimColor graphics.Color // Will use default if not set
Shape token.CornerShape // Will use default if not set
DragHandle Composable // Optional custom drag handle
}
func DefaultModalBottomSheetOptions ¶
func DefaultModalBottomSheetOptions() ModalBottomSheetOptions
type SheetState ¶
type SheetState struct {
// contains filtered or unexported fields
}
func NewSheetState ¶
func NewSheetState() *SheetState
func (*SheetState) Hide ¶
func (s *SheetState) Hide()
func (*SheetState) IsVisible ¶
func (s *SheetState) IsVisible() bool
func (*SheetState) Show ¶
func (s *SheetState) Show()
Click to show internal directories.
Click to hide internal directories.