Overview

Here you’ll find all about screen’s components and its attributes details.

What is it?

The Screen component is a Beagle element that helps the user to define a screen view structure. In this component we define settings such as using safe areas or displaying a toolbar/navigation bar.

All these functionalities are defined from attributes, which we list in the table below, defining the main characteristics of a Screen component.

AttributeTypeRequiredDefinition
idStringAttribute that identifies a screen in your application
safeAreaSafe AreaEnable Safe areas to help place views within the visible portion of the overall interface. By default it is not enabled and it won’t constrain considering any safe area.
navigationBarNavigation BarEnables some Navigation Bar details to be set, like Backbutton and Navigation Bar Itens
childServer-Driven ComponentReceives a list of Beagle componentes.
styleStyleProvide visual customization options to the screen
contextContextDataCreates a Context Data for a Screen.

How to use it?

Screen(
        navigationBar = NavigationBar(
            title = "Beagle Screen",
            showBackButton = true,
            navigationBarItems = listOf(
                NavigationBarItem(
                    text = "",
                    image = Local.justMobile("informationImage"),
                    onPress = listOf(Alert(
                        title = "Screen",
                        message = "Some message",
                        labelOk = "OK"
                    ))
                )
            )
        ),
        child = Container(
            children = listOf(
                Text("Some text")
            )
        )
    )

👉 Test this example in the Web Playground