> For the complete documentation index, see [llms.txt](https://swift-packages.gitbook.io/materialuikit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swift-packages.gitbook.io/materialuikit/components/fab.md).

# FAB

Represents a Material UI styled floating action button for primary actions.

### Overview

Displays a Material UI style floating action button (FAB) at the bottom trailing edge of the screen. Use this to provide prominent action buttons in your app.&#x20;

To use, apply the `floatingActionButton` modifier to any view, specifying the system image, title, and action. Optionally, set a custom corner radius.

### Modifers

Presents a FAB with a system symbol and title.

```swift
floatingActionButton(
    systemImage: String,
    titleKey: String,
    action: @escaping () -> Void
)
```

Presents a FAB with a system symbol and title, with a customizable corner radius.

```swift
floatingActionButton(
    systemImage: String,
    titleKey: String,
    cornerRadius: CGFloat,
    action: @escaping () -> Void
)
```

### Parameters

<table><thead><tr><th width="219">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>systemImage</code></td><td>The system symbol name for the button icon.</td></tr><tr><td><code>titleKey</code></td><td>The title key displayed on the button.</td></tr><tr><td><code>cornerRadius</code></td><td>The corner radius to apply to the button.</td></tr><tr><td><code>action</code></td><td>A closure to be executed when the button is tapped.</td></tr></tbody></table>

### Example

Displays a floating action button with a system icon and title.

```swift
var body: some View {
    Container {
        Text("Hello, World!")
    }
    .floatingActionButton(systemImage: "message.fill", titleKey: "New Chat") {
        print("FAB tapped!")
    }
}
```

<figure><picture><source srcset="/files/ekzlqzYVniIDXDL3Ttmo" media="(prefers-color-scheme: dark)"><img src="https://2931569195-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpwjDgYAa64eKF8AGmeE%2Fuploads%2FM5kY1RM5XiPESYddUeX5%2FFab%20light.png?alt=media&amp;token=cd2fdeea-b643-41c6-b397-1d922df60c9a" alt=""></picture><figcaption></figcaption></figure>

Displays a  floating action button with a system icon, title, and a customizable corner radius.

```swift
var body: some View {
    Container {
        Text("Hello, World!")
    }
    .floatingActionButton(systemImage: "message.fill", titleKey: "New Chat", cornerRadius: 10) {
        print("FAB tapped!")
    }
}
```

<figure><picture><source srcset="/files/YddjSpDd8TeF4N5sJASZ" media="(prefers-color-scheme: dark)"><img src="https://2931569195-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpwjDgYAa64eKF8AGmeE%2Fuploads%2FiWNr0UdsI7FGgGqMsiOF%2Ffab%20custom%20light.png?alt=media&amp;token=c6b21d25-cea1-4f25-8c60-e62a86b561d2" alt=""></picture><figcaption></figcaption></figure>
