FAB
Round: pinned to the corner, floating above content
Extended: icon + label for the headline action
Sizes: small (40) · standard (56) · large (72)
Speed-dial: expands to mini actions (Enter/Space · Esc to close)
Lowered / disabled: sheds its lift, stays visible
Last action: none yet · fired 0 times. The island is live.
// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform. Spec + live demo,// not yet exported from @dizyx/nockerl-react; promotion is tracked.)// A FAB FLOATS above content, pinned to a corner, so give it a positioned parent.
export function SessionFeed() { return ( <div style={{ position: 'relative' }}> {/* …the scrollable feed… */}
{/* Round (icon-only) FAB: the single most important action */} <Fab icon={<EditIcon />} label="New session" onClick={createSession} />
{/* Extended FAB with icon + label for the headline action */} <Fab icon={<PlusIcon />} label="New task" extendedLabel="New task" onClick={createTask} />
{/* Speed-dial that expands into mini secondary actions */} <FabSpeedDial label="Create" actions={[ { id: 'chat', label: 'New chat', icon: <ChatIcon />, onSelect: newChat }, { id: 'voice', label: 'Voice note', icon: <MicIcon />, onSelect: newVoice }, { id: 'upload', label: 'Upload file', icon: <UploadIcon />, onSelect: upload }, ]} /> </div> );}// Android: Jetpack Compose (canonical). The shipped Nockerl FAB is a corner-pinned// CircleShape Surface lifted at NockerlElevation.Level3 (the floating-chrome tier),// e.g. the scroll-to-bottom FAB in chat/ui/ChatScreen.kt. Standard M3 FAB builders// also accept the Nockerl shadow/colors via Modifier + containerColor.import androidx.compose.material3.ExtendedFloatingActionButtonimport androidx.compose.material3.FloatingActionButtonimport androidx.compose.material3.LargeFloatingActionButtonimport androidx.compose.material3.SmallFloatingActionButtonimport androidx.compose.foundation.shape.CircleShapeimport com.nockerl.app.core.theme.NockerlElevationimport com.nockerl.app.core.theme.nockerlShadow
// Round (icon-only), a solid accent circle in the prominent-action slot.FloatingActionButton( onClick = viewModel::createSession, shape = CircleShape, containerColor = colors.accentPrimary, contentColor = colors.onAccent, modifier = Modifier.nockerlShadow(NockerlElevation.Level3, CircleShape),) { Icon(Icons.Default.Edit, contentDescription = "New session") }
// Extended, with icon + label for the headline action (control radius, not a pill).ExtendedFloatingActionButton( onClick = viewModel::createTask, icon = { Icon(Icons.Default.Add, contentDescription = null) }, text = { Text("New task") },)
// Sizes: small (40) and large (72) flank the standard (56).SmallFloatingActionButton(onClick = ::fork) { Icon(Icons.Default.CallSplit, null) }LargeFloatingActionButton(onClick = ::fork) { Icon(Icons.Default.CallSplit, null) }// macOS: SwiftUI. Nockerl Voice ships no literal FAB; its closest equivalent is// the circular record / primary affordance. This is the INTENDED Nockerl style,// a corner-pinned circular primary applied as a ButtonStyle, overlaid on content.// (See the drift note below.)ZStack(alignment: .bottomTrailing) { sessionFeed
Button(action: createSession) { Image(systemName: "square.and.pencil") } .buttonStyle(.nockerlFab) // solid accent circle, Level3 shadow + catch-light .padding(16)
// Extended, with icon + label for the headline action. Button(action: createTask) { Label("New task", systemImage: "plus") } .buttonStyle(.nockerlFabExtended) // control radius, not a pill .padding(16)}Parameters
Section titled “Parameters”| Prop | Type | Default | Description |
|---|---|---|---|
icon * | ReactNode | The glyph. Centered in the circle; sized per size. | |
label * | string | Accessible name. Required for the round (icon-only) FAB, which has no visible text. The extended FAB also names itself from extendedLabel. | |
extendedLabel | string | Visible text → renders the extended (icon + label) FAB at the control radius. Omit for the round FAB. | |
onClick | () => void | Activate handler. Ignored while disabled. | |
size | 'small' | 'standard' | 'large' | 'standard' | Footprint: small 40 · standard 56 · large 72. (Round FAB only.) |
disabled | boolean | false | Lowered / inert: sheds its lift shadow and stays clearly visible (never faded to invisible). |
FabSpeedDial adds actions (an array of { id, label, icon, onSelect }) and reuses
label as the trigger name; it manages aria-expanded, Esc-to-close, and focus.
| Parameter | Type | Default | Description |
|---|---|---|---|
onClick * | () -> Unit | Invoked on tap. | |
modifier | Modifier | Modifier | Pass Modifier.nockerlShadow(NockerlElevation.Level3, CircleShape) for the floating lift, and align it to a corner in the parent. |
shape | Shape | FAB default | Use CircleShape for the round FAB; the extended builder uses the control radius. |
containerColor | Color | theme | Fill. The Nockerl prominent slot uses colors.accentPrimary. |
contentColor | Color | theme | Icon / label color. Pair the accent fill with colors.onAccent. |
content * | @Composable -> Unit | The icon (round) or, on ExtendedFloatingActionButton, supplied via the icon + text slots. |
Builders: FloatingActionButton (standard), SmallFloatingActionButton (40),
LargeFloatingActionButton (72), ExtendedFloatingActionButton (icon + label).
SwiftUI exposes the FAB as a ButtonStyle applied to a standard Button, overlaid
on content with ZStack(alignment: .bottomTrailing). State (isEnabled, isPressed)
comes from the environment + the style Configuration. There are no state parameters.
| Style | Type | Default | Description |
|---|---|---|---|
.nockerlFab | ButtonStyle | Solid accent circle, on-accent glyph, Level3 neutral shadow + top catch-light. Pressed → ~0.92 brightness + slight scale; disabled → card surface + muted glyph, lift removed. Intended, not yet shipped in Voice. | |
.nockerlFabExtended | ButtonStyle | Icon + label at the control radius (not a pill); otherwise identical fill / lift / states to .nockerlFab. Intended, not yet shipped. |