Settings Layout
A settings page frame: section links in a side or top nav, and the settings content beside or below them.
<arc-settings-layout>Overview
SettingsLayout splits a settings page into a nav of section links ("Profile", "Security", "Billing") and a content area for the forms. nav-position="left", the default, puts the nav in a 220px sidebar on a raised background. nav-position="top" puts it in a bar above the content. Both use the same slots, so switching is one attribute.
For pages that aren't settings, use PageLayout.
Guidelines
Do
- Use `nav-position="left"` for more than four or five sections
- Use `nav-position="top"` for two or three sections
Don't
- Don't put the app's main navigation in the nav slot. It's for switching settings sections
- Don't put tables, charts or other heavy content in the nav. On a phone it's one scrolling row
Features
- `arc-settings-nav-item` links with an active state that follows the URL hash, so a shared link or the back button lands on the right section
- `sections` shows only the section whose `id` matches the active item, for a tabbed settings page
- Below 768px the nav becomes a scrolling row of tabs above the content, in either mode
- CSS parts `layout`, `nav` and `content`
Preview
Usage
Its events and state need JavaScript, so use the Web Component or a framework wrapper for those.
<arc-settings-layout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</arc-settings-layout>import { SettingsLayout } from '@arclux/arc-ui-react';
export default function Example() {
return (
<SettingsLayout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</SettingsLayout>
);
}<script setup>
import { SettingsLayout } from '@arclux/arc-ui-vue';
</script>
<template>
<SettingsLayout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</SettingsLayout>
</template><script>
import { SettingsLayout } from '@arclux/arc-ui-svelte';
</script>
<SettingsLayout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</SettingsLayout>import { Component } from '@angular/core';
import { SettingsLayout } from '@arclux/arc-ui-angular';
@Component({
imports: [SettingsLayout],
template: `
<arc-settings-layout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</arc-settings-layout>
`,
})
export class MyComponent {}import { SettingsLayout } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<SettingsLayout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</SettingsLayout>
);
}import { SettingsLayout } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<SettingsLayout nav-position="left">
<div slot="nav">Profile | Security</div>
<div>
<h2>Profile Settings</h2>
<p>Manage your account.</p>
</div>
</SettingsLayout>
);
}<!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-settings-layout — requires settings-layout.css + base.css (or arc-ui.css) -->
<div class="arc-settings-layout">
<div>
<div class="nav">
</div>
<div class="content">
SettingsLayout
</div>
</div>
</div><!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-settings-layout — self-contained, no external CSS needed -->
<style>
@media (max-width: 768px) {
.arc-settings-layout .settings-layout--left { display: flex;
flex-direction: column; }
}
@media (max-width: 768px) {
.arc-settings-layout .settings-layout--left .nav { border-right: none;
border-bottom: 1px solid rgb(24, 24, 30); }
}
</style>
<div class="arc-settings-layout" style="display: block; box-sizing: border-box">
<div>
<div class="nav" style="padding: 24px; background: rgb(13, 13, 18); border-right: 1px solid rgb(24, 24, 30); border-bottom: 1px solid rgb(24, 24, 30)">
</div>
<div style="padding: 40px; flex: 1">
SettingsLayout
</div>
</div>
</div>API
navPosition'left' | 'top''left'- Controls whether the navigation panel appears as a left sidebar (220px wide, CSS Grid) or a top bar (full-width, flexbox column). Below 768px either becomes a scrolling row of tabs.
sectionsbooleanfalse- Show only the content section whose
idmatches the active nav item (href="#profile"showsid="profile"), and hide the others withhidden. Off, every section stays on the page, as for one long page the nav scrolls through.
See also
- App ShellFull-page layout that puts a TopBar, a Sidebar and a scrolling content area into one frame, with a mobile sidebar toggle and an optional table-of-contents rail.
- SidebarA vertical list of navigation links in grouped sections that can collapse, with the current page highlighted.
- TabsA row of tab buttons that shows one of several panels at a time.
- FormWraps ARC UI inputs in a form that validates them on submit and fires arc-submit with their values.