# Bottom Bar

A bar pinned to the bottom of a screen for primary actions, which rises above the keyboard.

Bottom Bar 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.

Source: https://ui.suiss.app/docs/components/bottom-bar

**React Native, SwiftUI, Jetpack Compose**

![Preview](https://ui.suiss.app/previews/components-bottom-bar--default.light.webp)

```tsx
import { View } from "react-native"
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Text } from "@/components/ui/text"

function Page({ children }: { children: React.ReactNode }) {
  return (
    <View className="-m-4 flex-1">
      <View className="flex-1 gap-2 p-4">
        <Text variant="h3">Review order</Text>
        <Text variant="muted">2 items, delivery on Thursday.</Text>
      </View>
      {children}
    </View>
  )
}

export function BottomBarExample() {
  return (
    <Page>
      <BottomBar>
        <BottomBarContent>
          <Button size="lg" block>
            <Text>Continue</Text>
          </Button>
        </BottomBarContent>
      </BottomBar>
    </Page>
  )
}
```

```swift
import EsuissUI
import SwiftUI

struct BottomBarExample: View {
  var body: some View {
    BottomBarPage {
      BottomBar(separator: false) {
        BottomBarContent {
          Button("Continue") {}.buttonStyle(.variant(size: .lg, block: true))
        }
      }
    }
  }
}

struct BottomBarPage<Bar: View>: View {
  @ViewBuilder let bar: () -> Bar

  var body: some View {
    VStack(spacing: 0) {
      VStack(alignment: .leading, spacing: 8) {
        Text("Review order").textVariant(.h3)
        Text("2 items, delivery on Thursday.").textVariant(.muted)
      }
      .padding(16)
      .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
      bar()
    }
  }
}
```

```kotlin
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
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.Screen
import com.esuiss.ui.components.ScreenEdge
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun BottomBarPage(page: @Composable ColumnScope.() -> Unit, bar: @Composable () -> Unit) {
    Screen(edges = setOf(ScreenEdge.Top, ScreenEdge.Left, ScreenEdge.Right)) {
        Column(Modifier.fillMaxSize()) {
            Column(
                Modifier.weight(1f).fillMaxWidth().padding(16.dp),
                verticalArrangement = Arrangement.spacedBy(8.dp),
                content = page,
            )
            bar()
        }
    }
}

@Composable
fun BottomBarOrder(bar: @Composable () -> Unit) {
    BottomBarPage(
        page = {
            Text("Review order", variant = TextVariant.H3)
            Text("2 items, delivery on Thursday.", variant = TextVariant.Muted)
        },
        bar = bar,
    )
}

@Composable
fun BottomBarDefault() {
    BottomBarOrder {
        BottomBar {
            BottomBarContent {
                Button("Continue", onClick = {}, size = ButtonSize.Lg, block = true)
            }
        }
    }
}
```

`BottomBar` is an animated `View` that adds bottom padding equal to the safe-area inset, or to the keyboard height while the keyboard is open, and animates between them with the keyboard's own timing. `BottomBarContent` adds the standard padding and spacing for the buttons inside.

Use it for the main call to action of a screen, such as checkout or a form submit button.

## Installation

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss-rn/bottom-bar
```

See [Installation](https://ui.suiss.app/docs/installation) for the `components.json` setup. Or use the suiss/ui CLI:

```bash title="Terminal"
npx @esuiss/ui@latest add bottom-bar
```

**SwiftUI**

```bash title="Terminal"
npx @esuiss/ui@latest add bottom-bar --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx @esuiss/ui@latest add bottom-bar --platform kotlin
```

The CLI also adds what it builds on: [Screen](https://ui.suiss.app/docs/components/screen). On React Native it also adds the animated view `components/ui/animated-view.tsx`.

### Manual

**React Native**

**Uniwind**

1. Install the dependencies:

```bash title="Terminal"
npx expo install cn react-native-reanimated react-native-safe-area-context react-native-worklets
```

2. Add the pieces it builds on: [Screen](https://ui.suiss.app/docs/components/screen), and the primitives `components/primitives/keyboard.tsx`, and the animated view `components/ui/animated-view.tsx` from the next step.

3. Copy the animated view into `components/ui/animated-view.tsx`:

- `uniwind/components/ui/animated-view.tsx`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/uniwind/components/ui/animated-view.tsx)

4. Copy the source into `components/ui/bottom-bar.tsx`:

```tsx title="uniwind/components/ui/bottom-bar.tsx"
import { cn } from "cn"
import * as React from "react"
import { View, type ViewProps } from "react-native"
import {
  Easing,
  ReduceMotion,
  useAnimatedStyle,
  useSharedValue,
  withTiming,
} from "react-native-reanimated"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { useKeyboard } from "@/components/primitives/keyboard"
import { AnimatedView } from "@/components/ui/animated-view"
import { ScreenContext } from "@/components/ui/screen"

const EASING = Easing.bezier(0.17, 0.59, 0.4, 0.77)

function BottomBar({
  separator = false,
  className,
  style,
  ...props
}: ViewProps & {
  separator?: boolean
}) {
  const insets = useSafeAreaInsets()
  const screen = React.useContext(ScreenContext)
  const keyboard = useKeyboard()
  const consumed = screen?.edges.includes("bottom") ? insets.bottom : 0
  const target = Math.max(
    0,
    (keyboard.height > 0 ? keyboard.height : insets.bottom) - consumed
  )
  const padding = useSharedValue(target)

  React.useEffect(() => {
    padding.value = withTiming(target, {
      duration: keyboard.duration,
      easing: EASING,
      reduceMotion: ReduceMotion.System,
    })
  }, [target, keyboard.duration, padding])

  const animatedStyle = useAnimatedStyle(() => ({
    paddingBottom: padding.value,
  }))

  return (
    <AnimatedView
      className={cn(
        "bg-background",
        separator && "border-t border-border",
        className
      )}
      style={[animatedStyle, style]}
      {...props}
    />
  )
}

function BottomBarContent({ className, ...props }: ViewProps) {
  return <View className={cn("gap-2 px-4 py-3", className)} {...props} />
}

export { BottomBar, BottomBarContent }
```

5. Update the import paths to match your project.

**NativeWind**

1. Install the dependencies:

```bash title="Terminal"
npx expo install cn react-native-reanimated react-native-safe-area-context react-native-worklets
```

2. Add the pieces it builds on: [Screen](https://ui.suiss.app/docs/components/screen), and the primitives `components/primitives/keyboard.tsx`, and the animated view `components/ui/animated-view.tsx` from the next step.

3. Copy the animated view into `components/ui/animated-view.tsx`:

- `nativewind/components/ui/animated-view.tsx`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/nativewind/components/ui/animated-view.tsx)

4. Copy the source into `components/ui/bottom-bar.tsx`:

```tsx title="nativewind/components/ui/bottom-bar.tsx"
import { cn } from "cn"
import * as React from "react"
import { View, type ViewProps } from "react-native"
import {
  Easing,
  ReduceMotion,
  useAnimatedStyle,
  useSharedValue,
  withTiming,
} from "react-native-reanimated"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { useKeyboard } from "@/components/primitives/keyboard"
import { AnimatedView } from "@/components/ui/animated-view"
import { ScreenContext } from "@/components/ui/screen"

const EASING = Easing.bezier(0.17, 0.59, 0.4, 0.77)

function BottomBar({
  separator = false,
  className,
  style,
  ...props
}: ViewProps & {
  separator?: boolean
}) {
  const insets = useSafeAreaInsets()
  const screen = React.useContext(ScreenContext)
  const keyboard = useKeyboard()
  const consumed = screen?.edges.includes("bottom") ? insets.bottom : 0
  const target = Math.max(
    0,
    (keyboard.height > 0 ? keyboard.height : insets.bottom) - consumed
  )
  const padding = useSharedValue(target)

  React.useEffect(() => {
    padding.value = withTiming(target, {
      duration: keyboard.duration,
      easing: EASING,
      reduceMotion: ReduceMotion.System,
    })
  }, [target, keyboard.duration, padding])

  const animatedStyle = useAnimatedStyle(() => ({
    paddingBottom: padding.value,
  }))

  return (
    <AnimatedView
      className={cn(
        "bg-background",
        separator && "border-t border-border",
        className
      )}
      style={[animatedStyle, style]}
      {...props}
    />
  )
}

function BottomBarContent({ className, ...props }: ViewProps) {
  return <View className={cn("gap-2 px-4 py-3", className)} {...props} />
}

export { BottomBar, BottomBarContent }
```

5. Update the import paths to match your project.

**StyleSheet**

1. Install the dependencies:

```bash title="Terminal"
npx expo install react-native-reanimated react-native-safe-area-context react-native-worklets
```

2. Add the pieces it builds on: [Screen](https://ui.suiss.app/docs/components/screen), and the primitives `components/primitives/keyboard.tsx`, and the animated view `components/ui/animated-view.tsx` from the next step.

3. Copy the animated view into `components/ui/animated-view.tsx`:

- `stylesheet/components/ui/animated-view.tsx`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/stylesheet/components/ui/animated-view.tsx)

4. Copy the source into `components/ui/bottom-bar.tsx`:

```tsx title="stylesheet/components/ui/bottom-bar.tsx"
import * as React from "react"
import { StyleSheet, View, type ViewProps } from "react-native"
import {
  Easing,
  ReduceMotion,
  useAnimatedStyle,
  useSharedValue,
  withTiming,
} from "react-native-reanimated"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { useKeyboard } from "@/components/primitives/keyboard"
import { AnimatedView } from "@/components/ui/animated-view"
import { ScreenContext } from "@/components/ui/screen"
import { useTheme } from "@/components/ui/theme"

const EASING = Easing.bezier(0.17, 0.59, 0.4, 0.77)

const styles = StyleSheet.create({
  separator: { borderTopWidth: 1 },
  content: { gap: 8, paddingHorizontal: 16, paddingVertical: 12 },
})

function BottomBar({
  separator = false,
  style,
  ...props
}: ViewProps & {
  separator?: boolean
}) {
  const { colors } = useTheme()
  const insets = useSafeAreaInsets()
  const screen = React.useContext(ScreenContext)
  const keyboard = useKeyboard()
  const consumed = screen?.edges.includes("bottom") ? insets.bottom : 0
  const target = Math.max(
    0,
    (keyboard.height > 0 ? keyboard.height : insets.bottom) - consumed
  )
  const padding = useSharedValue(target)

  React.useEffect(() => {
    padding.value = withTiming(target, {
      duration: keyboard.duration,
      easing: EASING,
      reduceMotion: ReduceMotion.System,
    })
  }, [target, keyboard.duration, padding])

  const animatedStyle = useAnimatedStyle(() => ({
    paddingBottom: padding.value,
  }))

  return (
    <AnimatedView
      style={[
        { backgroundColor: colors.background },
        separator && [styles.separator, { borderColor: colors.border }],
        animatedStyle,
        style,
      ]}
      {...props}
    />
  )
}

function BottomBarContent({ style, ...props }: ViewProps) {
  return <View style={[styles.content, style]} {...props} />
}

export { BottomBar, BottomBarContent }
```

5. Update the import paths to match your project.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

```swift title="swift/Components/BottomBar.swift"
import SwiftUI

public struct BottomBar<Content: View>: View {
  let separator: Bool
  let content: Content

  @Environment(\.screenBackground) private var background

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

  public var body: some View {
    VStack(spacing: 0) {
      content
    }
    .frame(maxWidth: .infinity)
    .background(background.ignoresSafeArea(.container, edges: .bottom))
    .overlay(alignment: .top) {
      if separator {
        EsuissColor.border.frame(height: 1)
      }
    }
    .accessibilityElement(children: .contain)
  }
}

public struct BottomBarContent<Content: View>: View {
  let content: Content

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

  public var body: some View {
    VStack(spacing: 8) {
      content
    }
    .padding(.horizontal, 16)
    .padding(.vertical, 12)
    .frame(maxWidth: .infinity)
  }
}
```

- `swift/Components/KeyboardScrollView.swift`: see [Keyboard Scroll View](https://ui.suiss.app/docs/components/keyboard-scroll-view.md)

- `swift/Components/Screen.swift`: see [Screen](https://ui.suiss.app/docs/components/screen.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Set `minSdk` to 24 or higher and add the dependencies:

```kotlin title="build.gradle.kts"
implementation(platform("androidx.compose:compose-bom:2026.09.00"))
implementation("androidx.compose.foundation:foundation")
implementation("androidx.compose.ui:ui")
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

```kt title="kotlin/components/BottomBar.kt"
package com.esuiss.ui.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import com.esuiss.ui.theme.EsuissTheme

@Composable
fun BottomBar(
    modifier: Modifier = Modifier,
    separator: Boolean = false,
    content: @Composable ColumnScope.() -> Unit,
) {
    val colors = EsuissTheme.colors
    Column(
        modifier = modifier
            .fillMaxWidth()
            .background(colors.background)
            .then(
                if (separator) {
                    Modifier.drawBehind { drawRect(colors.border, Offset.Zero, Size(size.width, 1.dp.toPx())) }
                } else {
                    Modifier
                },
            )
            .windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Bottom + WindowInsetsSides.Horizontal))
            .padding(bottom = with(LocalDensity.current) { (LocalKeyboardAccessory.current?.height ?: 0).toDp() }),
        content = content,
    )
}

@Composable
fun BottomBarContent(
    modifier: Modifier = Modifier,
    horizontalAlignment: Alignment.Horizontal = Alignment.CenterHorizontally,
    content: @Composable ColumnScope.() -> Unit,
) {
    Column(
        modifier = modifier
            .fillMaxWidth()
            .padding(horizontal = 16.dp, vertical = 12.dp),
        verticalArrangement = Arrangement.spacedBy(8.dp),
        horizontalAlignment = horizontalAlignment,
        content = content,
    )
}
```

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/Screen.kt`: see [Screen](https://ui.suiss.app/docs/components/screen.md)

4. Update the `com.esuiss.ui` package names to match your project.

## Usage

```tsx
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
```

```tsx
<Page>
  <BottomBar>
    <BottomBarContent>
      <Button size="lg" block>
        <Text>Continue</Text>
      </Button>
    </BottomBarContent>
  </BottomBar>
</Page>
```

Place `BottomBar` as the last child of the screen so it sits below the scrolling content. Stack buttons in `BottomBarContent`, or add `flex-row` to place them side by side.

Set `separator` to draw a hairline above the bar. Inside a `Screen` that already handles the bottom safe-area edge, the inset is not added twice.

## Examples

### With separator

A hairline above the bar with `separator`.

![Preview](https://ui.suiss.app/previews/components-bottom-bar--with-separator.light.webp)

```tsx
import { View } from "react-native"
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Text } from "@/components/ui/text"

function Page({ children }: { children: React.ReactNode }) {
  return (
    <View className="-m-4 flex-1">
      <View className="flex-1 gap-2 p-4">
        <Text variant="h3">Review order</Text>
        <Text variant="muted">2 items, delivery on Thursday.</Text>
      </View>
      {children}
    </View>
  )
}

export function BottomBarWithSeparatorExample() {
  return (
    <Page>
      <BottomBar separator>
        <BottomBarContent>
          <Button size="lg" block>
            <Text>Place order</Text>
          </Button>
        </BottomBarContent>
      </BottomBar>
    </Page>
  )
}
```

```swift
import EsuissUI
import SwiftUI

struct BottomBarWithSeparatorExample: View {
  var body: some View {
    BottomBarPage {
      BottomBar(separator: true) {
        BottomBarContent {
          Button("Place order") {}.buttonStyle(.variant(size: .lg, block: true))
        }
      }
    }
  }
}

struct BottomBarPage<Bar: View>: View {
  @ViewBuilder let bar: () -> Bar

  var body: some View {
    VStack(spacing: 0) {
      VStack(alignment: .leading, spacing: 8) {
        Text("Review order").textVariant(.h3)
        Text("2 items, delivery on Thursday.").textVariant(.muted)
      }
      .padding(16)
      .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
      bar()
    }
  }
}
```

```kotlin
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
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.Screen
import com.esuiss.ui.components.ScreenEdge
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun BottomBarPage(page: @Composable ColumnScope.() -> Unit, bar: @Composable () -> Unit) {
    Screen(edges = setOf(ScreenEdge.Top, ScreenEdge.Left, ScreenEdge.Right)) {
        Column(Modifier.fillMaxSize()) {
            Column(
                Modifier.weight(1f).fillMaxWidth().padding(16.dp),
                verticalArrangement = Arrangement.spacedBy(8.dp),
                content = page,
            )
            bar()
        }
    }
}

@Composable
fun BottomBarOrder(bar: @Composable () -> Unit) {
    BottomBarPage(
        page = {
            Text("Review order", variant = TextVariant.H3)
            Text("2 items, delivery on Thursday.", variant = TextVariant.Muted)
        },
        bar = bar,
    )
}

@Composable
fun BottomBarWithSeparator() {
    BottomBarOrder {
        BottomBar(separator = true) {
            BottomBarContent {
                Button("Place order", onClick = {}, size = ButtonSize.Lg, block = true)
            }
        }
    }
}
```

### Two actions

A primary and a plain button stacked.

![Preview](https://ui.suiss.app/previews/components-bottom-bar--two-actions.light.webp)

```tsx
import { View } from "react-native"
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Text } from "@/components/ui/text"

function Page({ children }: { children: React.ReactNode }) {
  return (
    <View className="-m-4 flex-1">
      <View className="flex-1 gap-2 p-4">
        <Text variant="h3">Review order</Text>
        <Text variant="muted">2 items, delivery on Thursday.</Text>
      </View>
      {children}
    </View>
  )
}

export function BottomBarTwoActionsExample() {
  return (
    <Page>
      <BottomBar separator>
        <BottomBarContent>
          <Button size="lg" block>
            <Text>Place order</Text>
          </Button>
          <Button size="lg" variant="plain" block>
            <Text>Save for later</Text>
          </Button>
        </BottomBarContent>
      </BottomBar>
    </Page>
  )
}
```

```swift
import EsuissUI
import SwiftUI

struct BottomBarTwoActionsExample: View {
  var body: some View {
    BottomBarPage {
      BottomBar(separator: true) {
        BottomBarContent {
          Button("Place order") {}.buttonStyle(.variant(size: .lg, block: true))
          Button("Save for later") {}.buttonStyle(.variant(.plain, size: .lg, block: true))
        }
      }
    }
  }
}

struct BottomBarPage<Bar: View>: View {
  @ViewBuilder let bar: () -> Bar

  var body: some View {
    VStack(spacing: 0) {
      VStack(alignment: .leading, spacing: 8) {
        Text("Review order").textVariant(.h3)
        Text("2 items, delivery on Thursday.").textVariant(.muted)
      }
      .padding(16)
      .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
      bar()
    }
  }
}
```

```kotlin
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
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.ButtonVariant
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenEdge
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun BottomBarPage(page: @Composable ColumnScope.() -> Unit, bar: @Composable () -> Unit) {
    Screen(edges = setOf(ScreenEdge.Top, ScreenEdge.Left, ScreenEdge.Right)) {
        Column(Modifier.fillMaxSize()) {
            Column(
                Modifier.weight(1f).fillMaxWidth().padding(16.dp),
                verticalArrangement = Arrangement.spacedBy(8.dp),
                content = page,
            )
            bar()
        }
    }
}

@Composable
fun BottomBarOrder(bar: @Composable () -> Unit) {
    BottomBarPage(
        page = {
            Text("Review order", variant = TextVariant.H3)
            Text("2 items, delivery on Thursday.", variant = TextVariant.Muted)
        },
        bar = bar,
    )
}

@Composable
fun BottomBarTwoActions() {
    BottomBarOrder {
        BottomBar(separator = true) {
            BottomBarContent {
                Button("Place order", onClick = {}, size = ButtonSize.Lg, block = true)
                Button("Save for later", onClick = {}, size = ButtonSize.Lg, variant = ButtonVariant.Plain, block = true)
            }
        }
    }
}
```

### Side by side

Back and Next buttons in a row.

![Preview](https://ui.suiss.app/previews/components-bottom-bar--side-by-side.light.webp)

```tsx
import { View } from "react-native"
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Text } from "@/components/ui/text"

function Page({ children }: { children: React.ReactNode }) {
  return (
    <View className="-m-4 flex-1">
      <View className="flex-1 gap-2 p-4">
        <Text variant="h3">Review order</Text>
        <Text variant="muted">2 items, delivery on Thursday.</Text>
      </View>
      {children}
    </View>
  )
}

export function BottomBarSideBySideExample() {
  return (
    <Page>
      <BottomBar separator>
        <BottomBarContent className="flex-row">
          <Button size="lg" variant="secondary" block className="flex-1">
            <Text>Back</Text>
          </Button>
          <Button size="lg" block className="flex-1">
            <Text>Next</Text>
          </Button>
        </BottomBarContent>
      </BottomBar>
    </Page>
  )
}
```

```swift
import EsuissUI
import SwiftUI

struct BottomBarSideBySideExample: View {
  var body: some View {
    BottomBarPage {
      BottomBar(separator: true) {
        BottomBarContent {
          HStack(spacing: 8) {
            Button("Back") {}.buttonStyle(.variant(.secondary, size: .lg, block: true))
            Button("Next") {}.buttonStyle(.variant(size: .lg, block: true))
          }
        }
      }
    }
  }
}

struct BottomBarPage<Bar: View>: View {
  @ViewBuilder let bar: () -> Bar

  var body: some View {
    VStack(spacing: 0) {
      VStack(alignment: .leading, spacing: 8) {
        Text("Review order").textVariant(.h3)
        Text("2 items, delivery on Thursday.").textVariant(.muted)
      }
      .padding(16)
      .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
      bar()
    }
  }
}
```

```kotlin
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
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.ButtonVariant
import com.esuiss.ui.components.Screen
import com.esuiss.ui.components.ScreenEdge
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun BottomBarPage(page: @Composable ColumnScope.() -> Unit, bar: @Composable () -> Unit) {
    Screen(edges = setOf(ScreenEdge.Top, ScreenEdge.Left, ScreenEdge.Right)) {
        Column(Modifier.fillMaxSize()) {
            Column(
                Modifier.weight(1f).fillMaxWidth().padding(16.dp),
                verticalArrangement = Arrangement.spacedBy(8.dp),
                content = page,
            )
            bar()
        }
    }
}

@Composable
fun BottomBarOrder(bar: @Composable () -> Unit) {
    BottomBarPage(
        page = {
            Text("Review order", variant = TextVariant.H3)
            Text("2 items, delivery on Thursday.", variant = TextVariant.Muted)
        },
        bar = bar,
    )
}

@Composable
fun BottomBarSideBySide() {
    BottomBarOrder {
        BottomBar(separator = true) {
            BottomBarContent {
                Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
                    Button("Back", onClick = {}, modifier = Modifier.weight(1f), size = ButtonSize.Lg, variant = ButtonVariant.Secondary, block = true)
                    Button("Next", onClick = {}, modifier = Modifier.weight(1f), size = ButtonSize.Lg, block = true)
                }
            }
        }
    }
}
```

### Above keyboard

The bar moving up with the keyboard while an input is focused.

![Preview](https://ui.suiss.app/previews/components-bottom-bar--above-keyboard.light.webp)

```tsx
import { View } from "react-native"
import { BottomBar, BottomBarContent } from "@/components/ui/bottom-bar"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Text } from "@/components/ui/text"

export function BottomBarAboveKeyboardExample() {
  return (
    <View className="-m-4 flex-1">
      <View className="flex-1 gap-3 p-4">
        <Text variant="h3">Promo code</Text>
        <Input placeholder="Enter code" autoFocus autoCapitalize="characters" />
      </View>
      <BottomBar separator>
        <BottomBarContent>
          <Button size="lg" block>
            <Text>Apply</Text>
          </Button>
        </BottomBarContent>
      </BottomBar>
    </View>
  )
}
```

```swift
import EsuissUI
import SwiftUI

struct BottomBarKeyboardDemo: View {
  @State private var code = ""
  @FocusState private var focused: Bool

  var body: some View {
    VStack(spacing: 0) {
      VStack(alignment: .leading, spacing: 12) {
        Text("Promo code").textVariant(.h3)
        TextField("Promo code", text: $code, prompt: Text("Enter code"))
          .textFieldStyle(.input)
          .textInputAutocapitalization(.characters)
          .focused($focused)
      }
      .padding(16)
      .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
      BottomBar(separator: true) {
        BottomBarContent {
          Button("Apply") {}.buttonStyle(.variant(size: .lg, block: true))
        }
      }
    }
    .onAppear { focused = true }
  }
}
```

```kotlin
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.unit.dp
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
import com.esuiss.ui.components.ScreenEdge
import com.esuiss.ui.components.Text
import com.esuiss.ui.components.TextVariant

@Composable
fun BottomBarPage(page: @Composable ColumnScope.() -> Unit, bar: @Composable () -> Unit) {
    Screen(edges = setOf(ScreenEdge.Top, ScreenEdge.Left, ScreenEdge.Right)) {
        Column(Modifier.fillMaxSize()) {
            Column(
                Modifier.weight(1f).fillMaxWidth().padding(16.dp),
                verticalArrangement = Arrangement.spacedBy(8.dp),
                content = page,
            )
            bar()
        }
    }
}

@Composable
fun BottomBarAboveKeyboard() {
    var code by rememberSaveable { mutableStateOf("") }
    val focus = remember { FocusRequester() }
    LaunchedEffect(Unit) { focus.requestFocus() }
    BottomBarPage(
        page = {
            Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
                Text("Promo code", variant = TextVariant.H3)
                Input(
                    code,
                    { code = it },
                    Modifier.focusRequester(focus),
                    placeholder = "Enter code",
                    keyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.Characters),
                )
            }
        },
        bar = {
            BottomBar(separator = true) {
                BottomBarContent {
                    Button("Apply", onClick = {}, size = ButtonSize.Lg, block = true)
                }
            }
        },
    )
}
```

## API Reference

### BottomBar

Bottom container that follows the safe area and keyboard.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `separator` | `boolean` | `false` | Draws a top border. Defaults to `false`. |

Also accepts the props of `ViewProps`.

### BottomBarContent

Padded area for the actions.

Also accepts the props of `ViewProps`.

## Accessibility

- The bar adds no role; each action inside provides its own.

## Notes

- The padding animation respects the system Reduce Motion setting.
- Uses `bg-background` and `border-border` tokens; light and dark follow the system appearance.

