suiss/ui
  • Docs
  • Components
  • Patterns
  • Interactions
  • Charts
  • Blocks
  • AI
GitHubCreate
DocsComponentsPatternsInteractionsChartsBlocksAICreate
Components84
  • Overview
  • Accordion
  • Alert
  • Alert Dialog
  • Alert Sheet
  • Amount Input
  • Aspect Ratio
  • Attachment
  • Avatar
  • Badge
  • Bottom Bar
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Chip
  • Code Block
  • Collapsible
  • Combobox
  • Command
  • Context Menu
  • Dialog
  • Direction
  • Drawer
  • Dropdown Menu
  • Empty
  • FAB
  • Field
  • Fullscreen Menu
  • Haptics
  • Header
  • Hover Card
  • Icon
  • Input
  • Input Accessory Bar
  • Input Group
  • Input OTP
  • Item
  • Kbd
  • Keyboard Scroll View
  • Keypad
  • Label
  • Marker
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Page Indicator
  • Pagination
  • Pin Pad
  • Popover
  • Progress
  • QR Scanner
  • Questionnaire
  • Radio Group
  • Resizable
  • Screen
  • Scroll Area
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature Pad
  • Skeleton
  • Slider
  • Spinner
  • Switch
  • Tab Bar
  • Table
  • Tabs
  • Text
  • Textarea
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Trace
  • Wheel Picker
  • Widget

suiss/ui · Component

Screen

A full-screen container that pads for safe area insets and sets the status bar style.

Screen is an open-source component from suiss/ui for React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.

React Native
Screen demo in React Native, light modeScreen demo in React Native, dark mode
import { View } from "react-native"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

export default function ScreenDemo() {
  return (
    <Screen className="-m-4">
      <ScreenContent>
        <Text variant="h2">Account</Text>
        <Text variant="muted">
          The screen pads every safe-area edge and sets the status bar style
          from the color scheme.
        </Text>
        <View className="overflow-hidden rounded-2xl bg-muted">
          <View className="px-4 py-3">
            <Text>Row 1</Text>
import { View } from "react-native"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"
import { radius, useTheme } from "@/components/ui/theme"

export default function ScreenDemo() {
  const { colors } = useTheme()
  return (
    <Screen style={{ margin: -16 }}>
      <ScreenContent>
        <Text variant="h2">Account</Text>
        <Text variant="muted">
          The screen pads every safe-area edge and sets the status bar style
          from the color scheme.
        </Text>
        <View style={{ overflow: "hidden", borderRadius: radius["2xl"], backgroundColor: colors.muted }}>
import SwiftUI

struct ScreenExample: View {
  var body: some View {
    Screen {
      ScreenContent(scroll: false) {
        Text("Account").textVariant(.h2)
        Text("The screen pads every safe-area edge and sets the status bar style from the color scheme.")
          .textVariant(.muted)
        ScreenRows()
      }
    }
  }
}

struct ScreenRows: View {
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenContent
import com.esuiss.ui.components.Separator
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant
import com.esuiss.ui.theme.EsuissTheme

Screen is a View that fills the screen, paints the bg-background color (or bg-muted for the secondary variant) and adds padding for the safe area insets on the edges you choose. It also renders a StatusBar with light or dark content to match the color scheme.

ScreenContent lays out the body with padding and gaps. With scrollable, it renders a KeyboardScrollView so content scrolls and stays above the keyboard.

Installation

$ pnpm dlx shadcn@latest add @esuiss/screen

See Installation for the components.json setup. Or use the suiss/ui CLI:

$ pnpm dlx @esuiss/ui@latest add screen
$ pnpm dlx shadcn@latest add @esuiss/screen

See Installation for the components.json setup. Or use the suiss/ui CLI:

$ pnpm dlx @esuiss/ui@latest add screen --platform swift
$ pnpm dlx shadcn@latest add @esuiss/screen

See Installation for the components.json setup. Or use the suiss/ui CLI:

$ pnpm dlx @esuiss/ui@latest add screen --platform kotlin

The CLI also adds what it builds on: Keyboard Scroll View.

  1. Install the following dependencies:
npx expo install cn react-native-safe-area-context
  1. Add the pieces it builds on: Keyboard Scroll View.

  2. Copy and paste the following code into components/ui/screen.tsx:

uniwind/components/ui/screen.tsx
import { cn } from "cn"
import * as React from "react"
import { StatusBar, useColorScheme, View, type ViewProps } from "react-native"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { KeyboardScrollView } from "@/components/ui/keyboard-scroll-view"

type ScreenEdge = "top" | "right" | "bottom" | "left"

const ALL_EDGES: readonly ScreenEdge[] = ["top", "right", "bottom", "left"]

const ScreenContext = React.createContext<{
  edges: readonly ScreenEdge[]
} | null>(null)

function Screen({
  edges = ALL_EDGES,
  1. Update the import paths to match your project setup.
  1. Install the following dependencies:
npx expo install cn react-native-safe-area-context
  1. Add the pieces it builds on: Keyboard Scroll View.

  2. Copy and paste the following code into components/ui/screen.tsx:

nativewind/components/ui/screen.tsx
import { cn } from "cn"
import * as React from "react"
import { StatusBar, useColorScheme, View, type ViewProps } from "react-native"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { KeyboardScrollView } from "@/components/ui/keyboard-scroll-view"

type ScreenEdge = "top" | "right" | "bottom" | "left"

const ALL_EDGES: readonly ScreenEdge[] = ["top", "right", "bottom", "left"]

const ScreenContext = React.createContext<{
  edges: readonly ScreenEdge[]
} | null>(null)

function Screen({
  edges = ALL_EDGES,
  1. Update the import paths to match your project setup.
  1. Install the following dependencies:
npx expo install react-native-safe-area-context
  1. Add the pieces it builds on: Keyboard Scroll View.

  2. Copy and paste the following code into components/ui/screen.tsx:

stylesheet/components/ui/screen.tsx
import * as React from "react"
import { StatusBar, StyleSheet, View, type ViewProps } from "react-native"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { KeyboardScrollView } from "@/components/ui/keyboard-scroll-view"
import { useTheme } from "@/components/ui/theme"

type ScreenEdge = "top" | "right" | "bottom" | "left"

const ALL_EDGES: readonly ScreenEdge[] = ["top", "right", "bottom", "left"]

const ScreenContext = React.createContext<{
  edges: readonly ScreenEdge[]
} | null>(null)

const styles = StyleSheet.create({
  root: { flex: 1 },
  1. Update the import paths to match your project setup.
  1. Target iOS 17 or later.

  2. Copy the theme files every view uses:

swift/Theme/Theme.swift
import CoreText
import SwiftUI
import UIKit

struct RGBA: Sendable {
  let red: CGFloat
  let green: CGFloat
  let blue: CGFloat
  let alpha: CGFloat

  init(_ hex: UInt32, _ alpha: CGFloat = 1) {
    red = CGFloat((hex >> 16) & 0xFF) / 255
    green = CGFloat((hex >> 8) & 0xFF) / 255
    blue = CGFloat(hex & 0xFF) / 255
    self.alpha = alpha
  }
swift/Theme/Tokens.swift
import SwiftUI

public enum EsuissColor {
  public static let background = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x000000))
  public static let foreground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let card = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x1D1D1F))
  public static let cardForeground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let popover = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x1D1D1F))
  public static let popoverForeground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let primary = Color.adaptive(light: .init(0x0071E3), dark: .init(0x0A84FF))
  public static let primaryForeground = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0xFFFFFF))
  public static let secondary = Color.adaptive(light: .init(0x000000, 0.04), dark: .init(0xFFFFFF, 0.1))
  public static let secondaryForeground = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
  public static let muted = Color.adaptive(light: .init(0xF5F5F7), dark: .init(0x161617))
  public static let mutedForeground = Color.adaptive(light: .init(0x6E6E73), dark: .init(0x86868B))
  public static let accent = Color.adaptive(light: .init(0x000000, 0.06), dark: .init(0xFFFFFF, 0.1))
  1. Copy the source and every file it uses:
swift/Components/Screen.swift
import SwiftUI

extension EnvironmentValues {
  @Entry var screenBackground: Color = EsuissColor.background
}

public struct Screen<Content: View>: View {
  public enum Background: CaseIterable, Sendable {
    case background, muted

    var color: Color {
      switch self {
      case .background: EsuissColor.background
      case .muted: EsuissColor.muted
      }
    }
swift/Components/KeyboardScrollView.swift
import SwiftUI
import UIKit

public struct KeyboardScrollView<Content: View>: View {
  let showsIndicators: Bool
  let content: Content

  public init(showsIndicators: Bool = true, @ViewBuilder content: () -> Content) {
    self.showsIndicators = showsIndicators
    self.content = content()
  }

  public var body: some View {
    ScrollView(.vertical, showsIndicators: showsIndicators) {
      content
        .frame(maxWidth: .infinity, alignment: .topLeading)
  1. Add the files to your app target.
  1. Apply the Compose compiler plugin, enable Compose, set compileSdk to 37 or higher and minSdk to 24 or higher, and add the dependencies:
build.gradle.kts
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
  1. Copy the theme files every view uses:
kotlin/theme/Theme.kt
package com.esuiss.ui.theme

import android.content.res.AssetManager
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.dropShadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.shadow.Shadow as DropShadow
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
kotlin/theme/Tokens.kt
package com.esuiss.ui.theme

import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp

@Immutable
data class Colors(
    val background: Color,
    val foreground: Color,
    val card: Color,
    val cardForeground: Color,
    val popover: Color,
    val popoverForeground: Color,
    val primary: Color,
  1. Copy the source and every file it uses:
kotlin/components/Screen.kt
package com.esuiss.ui.components

import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.os.Build
import android.view.View
import android.view.Window
import android.view.WindowInsetsController
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.ColumnScope
kotlin/components/Content.kt
package com.esuiss.ui.components

import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

val LocalContentStyle = compositionLocalOf { TextStyle.Default }

val LocalContentColor = compositionLocalOf { Color.Unspecified }

val LocalIconSize = compositionLocalOf { 20.dp }
  1. Update the com.esuiss.ui package names to match your project.

Usage

import { View } from "react-native"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

function Rows({ count = 4 }: { count?: number }) {
  return (
    <View className="overflow-hidden rounded-2xl bg-muted">
      {Array.from({ length: count }, (_, index) => `Row ${index + 1}`).map(
        (label, index) => (
          <View
            key={label}
            className={
              index > 0 ? "border-t border-border px-4 py-3" : "px-4 py-3"
            }
          >
            <Text>{label}</Text>
          </View>
        )
      )}
    </View>
  )
}

export function ScreenExample() {
  return (
    <Screen className="-m-4">
      <ScreenContent>
        <Text variant="h2">Account</Text>
        <Text variant="muted">
          The screen pads every safe-area edge and sets the status bar style
          from the color scheme.
        </Text>
        <Rows />
      </ScreenContent>
    </Screen>
  )
}

This code uses Tailwind classes that need Uniwind or NativeWind. With StyleSheet, pass the same values through the style props.

import SwiftUI

struct ScreenExample: View {
  var body: some View {
    Screen {
      ScreenContent(scroll: false) {
        Text("Account").textVariant(.h2)
        Text("The screen pads every safe-area edge and sets the status bar style from the color scheme.")
          .textVariant(.muted)
        ScreenRows()
      }
    }
  }
}

struct ScreenRows: View {
  var labels: [String] = (1...4).map { "Row \($0)" }
  var background: Color = EsuissColor.muted

  var body: some View {
    VStack(spacing: 0) {
      ForEach(Array(labels.enumerated()), id: \.offset) { index, label in
        Text(verbatim: label)
          .textVariant(.default)
          .frame(maxWidth: .infinity, alignment: .leading)
          .padding(.horizontal, 16)
          .padding(.vertical, 12)
          .overlay(alignment: .top) {
            if index > 0 {
              EsuissColor.border.frame(height: 1)
            }
          }
      }
    }
    .background(background)
    .clipShape(RoundedRectangle(cornerRadius: Radius.xl2, style: .continuous))
  }
}
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenContent
import com.esuiss.ui.components.Separator
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Radius

@Composable
fun ScreenRows(labels: List<String>, background: Color) {
    Column(
        Modifier
            .fillMaxWidth()
            .clip(RoundedCornerShape(Radius.xl2))
            .background(background),
    ) {
        labels.forEachIndexed { index, label ->
            if (index > 0) Separator()
            Text(label, Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 12.dp))
        }
    }
}

fun screenRowLabels(count: Int): List<String> = (1..count).map { "Row $it" }

@Composable
fun ScreenDefault() {
    Screen {
        ScreenContent {
            Text("Account", variant = TextVariant.H2)
            Text(
                "The screen pads every safe-area edge and sets the status bar style from the color scheme.",
                variant = TextVariant.Muted,
            )
            ScreenRows(screenRowLabels(4), EsuissTheme.colors.muted)
        }
    }
}

Examples

Secondary

A screen with the secondary background, for grouped screens such as settings.

React Native
Screen secondary in React Native, light modeScreen secondary in React Native, dark mode
import { View } from "react-native"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

export default function ScreenSecondary() {
  return (
    <Screen variant="secondary" className="-m-4">
      <ScreenContent>
        <Text variant="h2">Settings</Text>
        <View className="overflow-hidden rounded-2xl bg-background">
          <View className="px-4 py-3">
            <Text>General</Text>
          </View>
          <View className="border-t border-border px-4 py-3">
            <Text>Privacy</Text>
          </View>
import { View } from "react-native"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"
import { radius, useTheme } from "@/components/ui/theme"

export default function ScreenSecondary() {
  const { colors } = useTheme()
  return (
    <Screen variant="secondary" style={{ margin: -16 }}>
      <ScreenContent>
        <Text variant="h2">Settings</Text>
        <View style={{ overflow: "hidden", borderRadius: radius["2xl"], backgroundColor: colors.background }}>
          <View style={{ paddingHorizontal: 16, paddingVertical: 12 }}>
            <Text>General</Text>
          </View>
          <View style={{ borderTopWidth: 1, borderColor: colors.border, paddingHorizontal: 16, paddingVertical: 12 }}>
import SwiftUI

struct ScreenSecondaryExample: View {
  var body: some View {
    Screen(background: .muted) {
      ScreenContent(scroll: false) {
        Text("Settings").textVariant(.h2)
        ScreenRows(labels: ["General", "Privacy", "Notifications"], background: EsuissColor.background)
      }
    }
  }
}

struct ScreenRows: View {
  var labels: [String] = (1...4).map { "Row \($0)" }
  var background: Color = EsuissColor.muted
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenContent
import com.esuiss.ui.components.ScreenVariant
import com.esuiss.ui.components.Separator
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

Scrollable

A screen whose content scrolls, for content taller than the screen or for forms.

React Native
Screen scrollable in React Native, light modeScreen scrollable in React Native, dark mode
import { View } from "react-native"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

export default function ScreenScrollable() {
  return (
    <Screen className="-m-4">
      <ScreenContent scrollable>
        <Text variant="h2">Long content</Text>
        <View className="overflow-hidden rounded-2xl bg-muted">
          {Array.from({ length: 24 }, (_, index) => `Row ${index + 1}`).map(
            (label, index) => (
              <View
                key={label}
                className={
                  index > 0 ? "border-t border-border px-4 py-3" : "px-4 py-3"

This code uses Tailwind classes that need Uniwind or NativeWind. With StyleSheet, pass the same values through the style props.

import SwiftUI

struct ScreenScrollableExample: View {
  var body: some View {
    Screen {
      ScreenContent {
        Text("Long content").textVariant(.h2)
        ScreenRows(labels: (1...24).map { "Row \($0)" })
      }
    }
  }
}

struct ScreenRows: View {
  var labels: [String] = (1...4).map { "Row \($0)" }
  var background: Color = EsuissColor.muted
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenContent
import com.esuiss.ui.components.Separator
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

Top edge only

A screen that pads only the top inset, for when a tab bar or bottom bar handles the bottom inset.

React Native
Screen top edge only in React Native, light modeScreen top edge only in React Native, dark mode
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

export default function ScreenTopEdgeOnly() {
  return (
    <Screen edges={["top"]} className="-m-4">
      <ScreenContent className="bg-muted">
        <Text variant="h3">Top edge only</Text>
        <Text variant="muted">
          The bottom, left and right edges are not padded.
        </Text>
      </ScreenContent>
    </Screen>
  )
}
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"
import { useTheme } from "@/components/ui/theme"

export default function ScreenTopEdgeOnly() {
  const { colors } = useTheme()
  return (
    <Screen edges={["top"]} style={{ margin: -16 }}>
      <ScreenContent style={{ backgroundColor: colors.muted }}>
        <Text variant="h3">Top edge only</Text>
        <Text variant="muted">
          The bottom, left and right edges are not padded.
        </Text>
      </ScreenContent>
    </Screen>
  )
import SwiftUI

struct ScreenTopEdgeOnlyExample: View {
  var body: some View {
    Screen(edges: .top) {
      ScreenContent(scroll: false) {
        Text("Top edge only").textVariant(.h3)
        Text("The bottom, left and right edges are not padded.")
          .textVariant(.muted)
      }
      .background(EsuissColor.muted)
    }
  }
}
import androidx.compose.foundation.background
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenContent
import com.esuiss.ui.components.ScreenEdge
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant
import com.esuiss.ui.theme.EsuissTheme

@Composable
fun ScreenTopEdgeOnly() {
    Screen(edges = setOf(ScreenEdge.Top)) {
        ScreenContent(Modifier.background(EsuissTheme.colors.muted)) {
            Text("Top edge only", variant = TextVariant.H3)
            Text("The bottom, left and right edges are not padded.", variant = TextVariant.Muted)

With bottom bar

A scrollable form with a bottom bar holding the main action.

React Native
Screen with bottom bar in React Native, light modeScreen with bottom bar in React Native, dark mode
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

export default function ScreenWithBottomBar() {
  return (
    <Screen className="-m-4">
      <ScreenContent scrollable>
        <Text variant="h2">Your email</Text>
        <Text variant="muted">We will send a code to this address.</Text>
        <Input placeholder="name@example.com" keyboardType="email-address" />
      </ScreenContent>
      <BottomBar separator>
        <BottomBarContent>
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Screen, ScreenContent } from "@/components/ui/screen"
import { Text } from "@/components/ui/text"

export default function ScreenWithBottomBar() {
  return (
    <Screen style={{ margin: -16 }}>
      <ScreenContent scrollable>
        <Text variant="h2">Your email</Text>
        <Text variant="muted">We will send a code to this address.</Text>
        <Input placeholder="name@example.com" keyboardType="email-address" />
      </ScreenContent>
      <BottomBar separator>
        <BottomBarContent>
import SwiftUI

struct ScreenBottomBarDemo: View {
  @State private var email = ""

  var body: some View {
    Screen {
      ScreenContent {
        Text("Your email").textVariant(.h2)
        Text("We will send a code to this address.").textVariant(.muted)
        TextField(String("name@example.com"), text: $email)
          .textFieldStyle(.input)
          .keyboardType(.emailAddress)
          .textInputAutocapitalization(.never)
      }
      BottomBar(separator: true) {
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import com.esuiss.ui.components.BottomBar
import com.esuiss.ui.components.BottomBarContent
import com.esuiss.ui.components.Button
import com.esuiss.ui.components.ButtonSize
import com.esuiss.ui.components.Input
import com.esuiss.ui.components.Screen

API Reference

Screen

The root view that pads for safe area insets.

PropTypeDefault
edgesreadonly ScreenEdge[]ALL_EDGES
variant"default" | "secondary""default"

Also accepts the props of ViewProps.

edges lists the sides that get safe area padding: any of top, right, bottom and left, all four by default. The status bar uses light-content in dark mode and dark-content in light mode, following the system appearance. The app must be wrapped in a SafeAreaProvider from react-native-safe-area-context. ScreenContext exposes the active edges to children.

ScreenContent

The padded body, optionally scrollable.

PropTypeDefault
scrollablebooleanfalse

Also accepts the props of ViewProps.

scrollable renders a KeyboardScrollView instead of a View, so it needs the Keyboard Scroll View component.

Screen

The root view that pads for safe area insets.

ParameterTypeDefault
edgesEdge.Set.all
backgroundBackground: .background | .muted.background
content() -> Content-

ScreenContent

The padded body, optionally scrollable.

ParameterTypeDefault
scrollBooltrue
paddedBooltrue
content() -> Content-

ScreenEdge

Values: Top, Bottom, Left, Right.

ScreenVariant

Values: Default, Secondary.

Screen

The root view that pads for safe area insets.

ParameterTypeDefault
modifierModifierModifier
edgesSet<ScreenEdge>AllScreenEdges
variantScreenVariant: Default | SecondaryScreenVariant.Default
content@Composable BoxScope.() -> Unit-

ScreenContent

The padded body, optionally scrollable.

ParameterTypeDefault
modifierModifierModifier
scrollableBooleanfalse
contentPaddingPaddingValuesPaddingValues(16.dp)
verticalArrangementArrangement.VerticalArrangement.spacedBy(16.dp)
content@Composable ColumnScope.() -> Unit-
NextScroll AreaPreviousResizable

On this page

  1. 01Installation
  2. 02Usage
  3. 03Examples
    • Secondary
    • Scrollable
    • Top edge only
    • With bottom bar
  4. 04API Reference
    • Screen
    • ScreenContent
    • Screen
    • ScreenContent
    • ScreenEdge
    • ScreenVariant
    • Screen
    • ScreenContent