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.

Selection bar

Selection bar

A dark bar that floats up from the bottom while items in a list are selected, holding the count and the actions for all of them. It leaves when the selection is empty.

Usage

Use it when

  • Bulk actions on a list or table people select from: archive 12 messages, grade 5 submissions, export 30 students.
  • Selection mode on phones, where a toolbar at the top would be out of reach.

Use something else when

  • Actions on a single item: use Dropdown menu. Use the item's "more" menu.
  • Confirming that a bulk action happened: use Toast.
  • Persistent page actions that do not depend on a selection: use Page header.
  • Saving a form: use Form layout. The form ends with its own actions.

Where it goes. Fixed at the bottom center of the window, 20 px from the bottom (more on phones with a home indicator), above the content and below dialogs. One per page. On a phone with a tab bar, lift it above the bar.

Examples

Bulk gradingSelect a submission or two: the bar rises from the bottom of this box. Clear the selection and it leaves. In a page it is fixed to the bottom of the window.
<div class="selbar" role="toolbar" aria-label="Selected submissions">
  <span class="selbar__count" aria-live="polite">3 selected</span>
  <button class="btn btn--md"><span class="ic" aria-hidden="true">edit</span>Grade</button>
  <button class="btn btn--md"><span class="ic" aria-hidden="true">download</span>Export</button>
  <button class="icon-btn" aria-label="Clear selection"><span class="ic" aria-hidden="true">close</span></button>
</div>
<!-- add .is-open while one or more items are selected -->
With a destructive actionShown open. The danger button is the one place btn--danger appears outside a confirm, because it opens an alert dialog or deletes with an Undo toast.
<div class="selbar is-open" role="toolbar" aria-label="Selected messages">
  <span class="selbar__count">12 selected</span>
  <button class="btn btn--md"><span class="ic" aria-hidden="true">inventory_2</span>Archive</button>
  <button class="btn btn--md btn--danger"><span class="ic" aria-hidden="true">delete</span>Delete</button>
  <button class="icon-btn" aria-label="Clear selection"><span class="ic" aria-hidden="true">close</span></button>
</div>

Anatomy

PartWhat it is
.selbar[role=toolbar]Required. The floating bar: inverse colors, 52 px tall, 16 px radius. aria-label it.
.selbar__countRequired. "3 selected", tabular figures. Put it in a live region so changes are announced.
.btnThe bulk actions, restyled for the inverse bar (38 px, quiet fill). btn--danger for a destructive one.
.icon-btnClear selection, last, with aria-label.
.selbar__labelOptional. Wrap a button's words in it (and give the button an aria-label) so under 520 px the bar keeps only the icons and fits the phone.
.rollOptional, inside the count: the number rolls as the selection changes (the selection hook sets it).

States

StateHow
.is-openVisible and interactive while at least one item is selected.
closedTransparent, 16 px lower and 2 % smaller, visibility: hidden after the exit.

Motion and microinteractions

  • Enter: opacity over --d-fast (160 ms) on --ease-enter; rises from translateY(16px) scale(0.98) on --spring-smooth over --d-smooth.
  • Exit: over --d-exit (180 ms) on --ease-exit, then hidden. Selecting again mid-exit reverses it, since it is a transition.
  • The count changes in place; pair it with rolling number for large counts if you like. Reduced motion: no rise, 120 ms fade.

Accessibility

  • role="toolbar" with an aria-label naming what is selected.
  • The count sits in an aria-live="polite" region so "3 selected" is announced as it changes.
  • Make it inert (or remove it) while closed so hidden buttons are not tabbable. Clearing the selection should return focus to the list.
  • Every item checkbox has its own label ("Select Rina Wijaya").

Do and don't

Do

  • Keep two or three actions plus clear.
  • Confirm the result with a toast and Undo where possible.

Don't

  • Show the bar when nothing is selected.
  • Put single-item actions or navigation in it.
  • Stack it with a second floating bar.

Behavior and code

Plain HTML. data-lds-selection="barId" on the list, table or grid that holds input[data-lds-select] checkboxes (and an optional input[data-lds-select-all]) opens and closes the bar, rolls a .roll inside .selbar__count, keeps the bar inert while closed, ticks a run on Shift-click and clears on Escape or [data-lds-select-clear]; see data table and file tile. Without the hook, toggle .is-open from your selection state and update the count. The bar uses position: fixed, so inside a transformed container it pins to that container instead (as in this demo).