Community project. This is not an official government website.

Run by volunteers. Lampung Design System is built by an open source community. No government agency runs or endorses it.

Official services use go.id. Government websites in Indonesia end in .go.id. Never enter your national ID number on a site you are unsure of.

Floating action

Floating action

One round accent button that floats over the content of a phone screen for the action people come to that screen to do (new message, add expense). It is the only resting control that casts a shadow.

Usage

Use it when

  • A phone screen whose main purpose is creating something in the list it shows: compose a message, log an expense, add a note.
  • The list scrolls long enough that a button at its top or bottom would often be out of reach.

Use something else when

  • Wide screens and desktop layouts: use Button. Put a btn--primary in the page header instead; a floating disc in the corner of a 1400 px window is easy to miss.
  • The screen has a primary action at the end of a form or flow: use Button. Use a full-width btn--primary btn--block in a sticky bar.
  • Two or more equally important actions: use Button group.
  • Actions that apply to selected items: use Selection bar.
  • A small icon action in a toolbar or card: use Icon button.

Where it goes. Bottom right of a phone screen, 16 to 20 px from the edges, above the tab bar (bottom = tab bar height + 16) and above the home indicator (env(safe-area-inset-bottom)). One per screen. It must not cover the last row: give the scrolling list bottom padding of at least the button height plus 32.

Examples

On a phone listFloats over the scrolling list, above the tab bar. Press it to feel the sink.

Messages

RKRina KusumaCan we move the study group to 4?
DBDatabase SystemsMidterm room changed to B204
APAdi PratamaSent the lab notes
<button class="icon-btn icon-btn--accent" aria-label="New message"
  style="position: fixed; right: 20px; bottom: calc(83px + 16px); width: 56px; height: 56px; box-shadow: var(--finish-primary), var(--shadow-md);">
  <span class="ic" aria-hidden="true">edit</span>
</button>

Anatomy

PartWhat it is
.icon-btn.icon-btn--accentRequired. Accent fill, white glyph, primary finish.
aria-labelRequired. The action ("New message").
styleSize and placement are not in the system yet: set width: 56px; height: 56px and position: absolute (or fixed) with right and bottom, plus box-shadow: var(--finish-primary), var(--shadow-md).

States

StateHow
hover--accent-hover on devices that can hover.
:activeSinks to scale(0.9) in 90 ms, back on --spring-snappy.
hidden while scrollingOptional: hide on scroll down, show on scroll up. Not built in; if you add it, slide it 24 px down with an opacity fade on --ease-exit over --d-exit, and back on --spring-smooth.

Motion and microinteractions

  • Press: scale(0.9) with a 90 ms transition, release on --spring-snappy over --d-snappy, like every icon button.
  • What it opens should grow from it: a sheet rising from the bottom on --spring-smooth, never a dialog popping in the middle.
  • It does not pulse, bounce or rotate at rest. Under reduced motion only the press remains (as a 120 ms change).

Accessibility

  • A real <button> with aria-label; the glyph is aria-hidden.
  • Place it in the DOM after the main content (or at the end of the screen region) so Tab reaches it after the list, matching where it sits.
  • It must not hide content: keep bottom padding under the list so the last row can scroll above it.
  • White on --accent holds 5.2:1 in both themes.

Do and don't

Do

  • Use one per screen, for the most frequent creation action.
  • Clear the tab bar and the home indicator.
  • Open a sheet from it on phones.

Don't

  • Use it on desktop layouts or inside cards.
  • Add a speed-dial of several floating buttons.
  • Give any other resting control a shadow to look like it.