Skip to content

Privacy and Security Settings Screen

Privacy and security settings screen for mobile apps with a two-factor authentication switch, active sessions with sign out, change password sheet and delete account confirmation.

Also known as: account security settings ui, app settings page, two factor authentication settings, active sessions list, delete account confirmation

Privacy and Security Settings Screen live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A privacy and security settings screen built with pure CSS and vanilla JavaScript: a security status card, a two-factor authentication switch, a change password bottom sheet with validation, an active sessions list with sign out, privacy toggles and a delete account confirmation dialog. It is an HTML mobile template for mobile sites and PWAs and can be packaged with Capacitor. Use it as the account security settings page of a social, banking, shopping or SaaS app.

How it works

The root .ps-app is a phone-width column (max 430px, centred on wide screens) with a sticky top bar, grouped .ps-card lists and a sticky .ps-tabs bar. Each setting is a .ps-row; toggles are real checkboxes with role="switch" styled as .ps-switch, wrapped in a label so the whole row is a large touch target.

The [data-ps-status] card reflects the 2-step verification and login alert switches. When either is turned off it switches to the amber .is-warn state and explains what to fix; a toast confirms the change.

In Active sessions, every [data-ps-session] row has a Sign out button. Signing out removes the row and updates the count. "Sign out of all other sessions" clears the rest and is disabled when only this device is left.

Change password opens [data-ps-sheet="password"], a native <dialog> bottom sheet that validates the current password, a new one of 8+ characters with a number, and the confirmation, with a strength meter and show/hide button. Delete account opens [data-ps-sheet="delete"]; the red button only works after typing the CONFIRM_WORD, then a success panel is shown.

Customization

  • --ps-accent and --ps-accent-soft on .ps-app: the slate blue of switches, icons, primary buttons and the active tab.
  • --ps-danger and --ps-danger-soft: the red used for sign out, the danger zone and the delete dialog.
  • --ps-ok and --ps-warn: the colours of the status card in the safe and warning states.
  • CONFIRM_WORD in script.js: the word users must type to delete the account.
  • strength() in script.js: the rules behind the password meter.
  • The setTimeout calls in the password and delete handlers: replace them with your fetch() calls; the sign out handler has a comment where the session API call goes.

Use cases

  • Social and community apps: two-factor authentication, private profile and activity status.
  • Banking and fintech apps: review signed-in devices and sign out of lost ones.
  • Online stores: let customers change their password and download their data.
  • SaaS and productivity PWAs: a clear, guarded path to delete an account.

Accessibility

Switches use native checkboxes with role="switch" and aria-describedby for their subtitles, so Space toggles them. Form errors are linked with aria-describedby and aria-invalid, and the first invalid field gets focus. Escape or the backdrop closes the sheets and focus returns to the row that opened them. The status card and toast are live regions, all rows are at least 64px high, and motion is reduced with prefers-reduced-motion.

Privacy and Security Settings Screen at a glance

Framework
Pure CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
fonts.googleapis.com, Bootstrap Icons
Layout
Mobile-first app screen, centred on wider screens
Category
Mobile Settings
License
Free for personal and commercial use

Questions about this template

Can I use the Privacy and Security Settings Screen code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load fonts.googleapis.com and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Can I turn this screen into an iOS or Android app?

Yes. It is plain HTML, CSS and JavaScript, so it works in a mobile website or progressive web app as it is. To ship it as a store app, put it in the web folder of a Capacitor or Cordova project and build it for iOS and Android; replace the sample data with calls to your own API.

How does it look on a desktop screen?

The screen is designed for phones. On wider screens it stays at phone width in the middle of the page, so it still looks like an app. The live demo opens at mobile width; use the Tablet and Desktop buttons to check other sizes.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap">
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Privacy and Security Settings Screen – Pure CSS mobile settings component screenshot
Privacy and Security Settings Screen · Pure CSS Mobile Settings

More Mobile Settings

App Settings Screen with Grouped Lists – Tailwind CSS mobile settings preview

App Settings Screen with Grouped Lists

App settings screen with an account card, grouped lists, notification switches, a theme select with dark mode, a language bottom sheet, privacy options, help links and sign out.

Notification Preferences Screen – Bootstrap 5 mobile settings preview

Notification Preferences Screen

Mobile notification settings screen with push, email and SMS switches per category, a pause-all toggle, quiet hours with a time range and days, and a save bar with unsaved state.

Subscription and Billing Screen – Bootstrap 6 mobile settings preview

Subscription and Billing Screen

Subscription management screen for mobile apps with current plan card, usage bars, plan switcher with proration, payment method update and an invoice list.