Actions

Fab

The screen’s primary action, floating above the content.

iOSSwiftUI Button, round and prominentAndroidCompose FloatingActionButtonRenders in a Screen or an Island
Fab on iOS
iOSSwiftUI Button, round and prominent
Fab on Android
AndroidCompose FloatingActionButton

Import

ts
import {Fab} from '@hzblj/kara-ui'

Props

A floating action button — Material's FloatingActionButton on Android, a 56pt accent circle (a plain SwiftUI Button) on iOS. It renders inline; pinning it to a corner is up to the screen.

PropTypeDescription
name*IconName

The icon, one of the app's, drawn in content.on.bg.

onPress() => void

Called when the button is pressed.

testIDstring

Test identifier, forwarded to the native view on iOS — Android ignores it.

name*
IconName

The icon, one of the app's, drawn in content.on.bg.

onPress
() => void

Called when the button is pressed.

testID
string

Test identifier, forwarded to the native view on iOS — Android ignores it.

Platform notes

  • A real screen pins it to the bottom trailing corner; the component itself sits wherever it is laid out.