An edit profile screen built with Bootstrap 6: an HTML mobile template with an avatar picker bottom sheet (take photo, choose from library, remove), a name field, a username availability check, a bio character counter and a sticky save button. Use this profile settings UI in social apps, marketplaces and community PWAs, or package it as a native app with Capacitor.
How it works
The root .epa-app is a 430 px app column with a sticky top bar (.epa-bar) and a sticky save bar (.epa-actions). All fields sit in one <form class="epa-form" novalidate> and use the Bootstrap 6 .form-field wrapper.
- Avatar:
.epa-avatarshows the current photo, with a camera badge (.epa-cam) and a "Change photo" button. Both open a Bootstrap 6 Drawer (.epa-sheet) with three options. "Take photo" opens a hiddeninput type="file"withcapture="user", "Choose from library" opens a normal image picker, each previewed withURL.createObjectURL. "Remove photo" swaps in.epa-initials, built from the name. - Username: an
@prefix and a status icon (.epa-user-state). Typing runs a debounced check (format rules, then a simulated lookup in thetakenlist); taken names show suggestion chips. - Bio:
maxlength="150"with a live counter (.epa-count) that turns amber in the last 20 characters. - Save: validates the fields, focuses the first problem, then shows a spinner and a Bootstrap 6 Toast.
- Back: if there are unsaved edits, a Bootstrap 6 Dialog (
.epa-discard) asks before discarding them.
Customization
--epa-indigoon.epa-app: the accent for the camera badge, links, focus rings and the save button (with--bs-primary-bg).- Edit the
takenarray inscript.js, or replace the timeout incheckUsername()with afetch()to your username API. - Change
maxlengthon#epa-bioto allow a longer bio; the counter reads it automatically. - Add fields by copying a
.form-field.epa-fieldblock into an.epa-group. - Replace the timeout in the submit handler with a
fetch()that sendsnew FormData(form)and the selected photo. - Set
capture="environment"on.epa-file-camerato open the rear camera instead.
Use cases
- Social and community apps: profile photo, display name, handle and bio.
- Marketplaces: seller profiles with a website link and contact email.
- Dating and networking apps: a photo-first profile editor.
Accessibility
Every input has a visible label and the right autocomplete value (name, username, url, email). Messages are linked with aria-describedby, invalid fields get aria-invalid, and the username status is announced through aria-live="polite". The photo sheet and the discard prompt are native modal <dialog> elements: focus moves into them, Escape closes them, and focus returns to the trigger. All touch targets are at least 44 px.
Bootstrap 6 notes
Built on Bootstrap 6.0.0-alpha.1 (alpha APIs can still change). The photo sheet uses the new Drawer instead of Offcanvas, the discard prompt uses Dialog instead of Modal, suggestions use .chip, and buttons use btn-solid theme-primary, btn-subtle theme-secondary and btn-solid theme-danger. The sample portrait comes from Unsplash; replace it with your own image.