Documentation
¶
Index ¶
- type Detent
- type Sheet
- func (s *Sheet) Adaptive(on bool) *Sheet
- func (s *Sheet) Detents(d ...Detent) *Sheet
- func (s *Sheet) Dismissible(on bool) *Sheet
- func (s *Sheet) Footer(f func() elements.Element) *Sheet
- func (s *Sheet) Layout(gtx layout.Context) layout.Dimensions
- func (s *Sheet) Opened() bool
- func (s *Sheet) OutOfFlow()
- func (s *Sheet) Styles(st styles.Styles) *Sheet
- func (s *Sheet) Title(t string) *Sheet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet is a modal panel over a dimmed scrim: a bottom sheet that slides up from the bottom edge, or with Adaptive a centered dialog on wide windows. It has an optional title, a scrolling body and a footer pinned below it. The scrim, Back and Escape close it, as does dragging its handle down; with several Detents, dragging moves it between them.
Like Drawer it takes no space in the layout and paints over the window while open, so it can sit anywhere in the tree. Create it once with New, outside the view function.
func New ¶
New returns a Sheet bound to open: it shows whenever *open is true. content builds the body fresh every frame the sheet is shown. The styles argument is optional and styles the panel: Background (default theme.surface), Padding (default 16 on the sides), Color.
func (*Sheet) Adaptive ¶
Adaptive shows the sheet as a centered dialog when the window is at least 600dp wide, and as a bottom sheet below that. It returns s for chaining.
func (*Sheet) Detents ¶
Detents sets the heights a bottom sheet rests at, smallest first; it opens at the first. Dragging the handle moves between them, and below the first closes the sheet. It returns s for chaining.
func (*Sheet) Dismissible ¶
Dismissible controls whether the scrim, Back, Escape and dragging close the sheet (on by default). It returns s for chaining.
func (*Sheet) Footer ¶
Footer sets content pinned below the scrolling body, such as action buttons. It returns s for chaining.
func (*Sheet) Layout ¶
func (s *Sheet) Layout(gtx layout.Context) layout.Dimensions
Layout updates the sheet and, while it's visible, registers the overlay that paints it. It takes no space.
func (*Sheet) OutOfFlow ¶
func (s *Sheet) OutOfFlow()
OutOfFlow marks the sheet as taking no space in a Box, so the box's Gap leaves it out; see elements.OutOfFlow.