scaffold

package
v0.1.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 13 Imported by: 0

README

Scaffold

@Composable
fun Scaffold(
    modifier: Modifier = Modifier,
    topBar: @Composable () -> Unit = {},
    bottomBar: @Composable () -> Unit = {},
    snackbarHost: @Composable () -> Unit = {},
    floatingActionButton: @Composable () -> Unit = {},
    floatingActionButtonPosition: FabPosition = FabPosition.End,
    containerColor: Color = MaterialTheme.colorScheme.background,
    contentColor: Color = contentColorFor(containerColor),
    contentWindowInsets: WindowInsets = ScaffoldDefaults.contentWindowInsets,
    content: @Composable (PaddingValues) -> Unit
): Unit

Documentation

Overview

Package scaffold contains Material 3 Scaffold components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composable

type Composable = api.Composable

func Scaffold

func Scaffold(content Composable, options ...ScaffoldOption) Composable

Scaffold implements the basic material design visual layout structure. This component provides API to put together several material components to construct your screen, by ensuring proper layout strategy for them and collecting necessary data so these components will work together correctly.

type Composer

type Composer = api.Composer

type FabPosition

type FabPosition int
const (
	FabPositionCenter FabPosition = iota
	FabPositionEnd
)

type ScaffoldOption

type ScaffoldOption func(*ScaffoldOptions)

func WithBottomBar

func WithBottomBar(c Composable) ScaffoldOption

WithBottomBar sets the bottom app bar.

func WithContainerColor

func WithContainerColor(col graphics.Color) ScaffoldOption

WithContainerColor sets the background color of the scaffold.

func WithContentColor

func WithContentColor(col graphics.Color) ScaffoldOption

WithContentColor sets the content color of the scaffold.

func WithFloatingActionButton

func WithFloatingActionButton(c Composable) ScaffoldOption

WithFloatingActionButton sets the FAB.

func WithFloatingActionButtonPosition

func WithFloatingActionButtonPosition(pos FabPosition) ScaffoldOption

WithFloatingActionButtonPosition sets the position of the FAB.

func WithModifier

func WithModifier(m ui.Modifier) ScaffoldOption

WithModifier sets the modifier for the Scaffold.

func WithSnackbarHost

func WithSnackbarHost(c Composable) ScaffoldOption

WithSnackbarHost sets the snackbar host.

func WithTopBar

func WithTopBar(c Composable) ScaffoldOption

WithTopBar sets the top app bar.

type ScaffoldOptions

type ScaffoldOptions struct {
	Modifier                     ui.Modifier
	TopBar                       Composable
	BottomBar                    Composable
	SnackbarHost                 Composable
	FloatingActionButton         Composable
	FloatingActionButtonPosition FabPosition
	ContainerColor               graphics.Color
	ContentColor                 graphics.Color
}

func DefaultScaffoldOptions

func DefaultScaffoldOptions(c Composer) ScaffoldOptions

DefaultScaffoldOptions returns the default options for a Scaffold.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL