One shared note variable
Changing the selection can leak one account’s draft into another. Key the data by record identity.
Pair a stable hierarchy with a focused detail view.
Build an account workspace with a persistent account list, a resizable detail pane and a draft note per account. Switching accounts or hiding navigation does not erase the note.
Use this for repeated inspections within a stable workspace. If each destination is a separate task with a shareable URL, add application routing; Splitter itself is a layout component, not a router.
Draft note: follow up Friday
drafts["atlas"]Pane size, selected record and draft data are three separate pieces of state.
Real BluKavantUI components, with a small application controller. Data and save responses are simulated in this page; reload resets the example.
Loading the interactive recipe…
Resizes and collapses two supplied content areas.
Owns the active account, record loading and per-account drafts.
Store ActiveAccountId in application state. Navigation changes that ID; the detail pane displays the associated record.
Use a map keyed by account ID. Save typing to that draft, not to a shared textarea value that gets reused for every account.
Collapse the pane without discarding the selected record or replacing the draft store. Keep a visible Show accounts control.
The example switches Splitter.IsVertical at 640px. For a full mobile workflow, use separate list/detail routes or a navigation Drawer, while retaining the same selected ID and draft store.
| State / contract | Implementation |
|---|---|
| Selected record | activeAccountId: string. Route or local Screen variable; unrelated to the pane percentage. |
| Draft store | Map<accountId, note>. This example is memory-only for the current visit. Decide explicitly whether production drafts survive navigation or reload. |
| Layout state | PrimarySize and IsCollapsed. LayoutChanged reports both; persist only if restoring the preference is useful. |
| Async detail loading | Cancel or ignore responses for an account that is no longer active. Never put Northstar’s late response into Atlas’s pane. |
Call mount(host, accounts). The recipe creates both content nodes once and keeps the textarea mounted. Its draft Map belongs to the consumer function. The returned destroy() removes the component and the media-query listener; move drafts into your route/store layer if they must outlive this screen.
Install Community and the required Pro add-on for Grid or Kanban recipes, import @blukavantui/community/styles.css, and use a connected host element. The companion CSS styles the surrounding fields, navigation and status messages.
Keep the recipe and shared.ts together; TypeScript resolves the recipe’s ./shared.js import. Add class="recipe-demo" to your host. Supply your records and backend callback as the mount arguments. The downloads use Community 1.0.0 and Pro 1.0.0 imports; the live demo retains its previously verified SDK 0.9.0 runtime.
import { createSplitter } from '@blukavantui/community/splitter';
import { node, button, status } from './shared.js';
export interface Account { id: string; name: string; summary: string }
export function mount(host: HTMLElement, accounts: Account[]) {
if (!accounts.length) throw new Error('Supply at least one account.');
const navigation = node('nav', '', 'recipe-navigation'); navigation.setAttribute('aria-label', 'Accounts');
const detail = node('section', '', 'recipe-detail'), heading = node('h3');
const summary = node('p'), label = node('label', 'Private draft note'), note = node('textarea');
note.rows = 4; label.append(note); detail.append(heading, summary, label);
const toolbar = node('div', '', 'recipe-toolbar'), panes = node('div'); host.append(toolbar, panes);
const message = status(host);
// Keep record drafts in application state, separate from pane size and visibility.
const drafts = new Map<string, string>(); let active = accounts[0].id, collapsed = false;
const mobile = matchMedia('(max-width: 640px)');
const splitter = createSplitter(panes, {
PrimaryContent: navigation, SecondaryContent: detail, PrimarySize: 30,
MinPrimarySize: 20, MaxPrimarySize: 65, IsCollapsible: true,
IsVertical: mobile.matches, Height: mobile.matches ? '610px' : '370px',
PrimaryLabel: 'Accounts', SecondaryLabel: 'Account details',
}, { LayoutChanged: (_size, isCollapsed) => { collapsed = isCollapsed; updateToggle(); } });
const toggle = button('Hide accounts', () => { collapsed = !collapsed; splitter.update({ IsCollapsed: collapsed }); updateToggle(); });
toolbar.append(toggle);
function updateToggle() { toggle.textContent = collapsed ? 'Show accounts' : 'Hide accounts'; toggle.setAttribute('aria-expanded', String(!collapsed)); }
function show(account: Account) {
active = account.id; heading.textContent = account.name; summary.textContent = account.summary;
note.value = drafts.get(active) || '';
for (const el of navigation.querySelectorAll('button')) el.setAttribute('aria-current', el.dataset.key === active ? 'true' : 'false');
message.textContent = `Viewing ${account.name}. Notes are temporary drafts for this visit.`;
}
for (const account of accounts) {
const link = button(account.name, () => show(account)); link.dataset.key = account.id; navigation.append(link);
}
note.oninput = () => { drafts.set(active, note.value); };
const resize = () => splitter.update({ IsVertical: mobile.matches, Height: mobile.matches ? '610px' : '370px' });
mobile.addEventListener('change', resize); show(accounts[0]); updateToggle();
return { destroy() { mobile.removeEventListener('change', resize); splitter.destroy(); host.replaceChildren(); } };
}
Use BluKavantUi_Community_Layout → Splitter. Put an account list in Primary and the detail form in Secondary. This complete layout recipe is Community on both Web and OutSystems.
| Binding / handler | Implementation |
|---|---|
| Screen state | Create ActiveAccountId, PaneSize (Decimal), NavigationCollapsed (Boolean), and a draft list keyed by account ID. |
| Placeholders | Place your navigation widgets in Primary and detail widgets in Secondary. Bind note inputs to the active record’s draft value. |
| OnLayoutChanged | Assign PrimarySize to PaneSize and IsCollapsed to NavigationCollapsed; bind those variables back to the Block inputs. |
| Account selection | Store the current draft, assign the new ActiveAccountId, load its draft, then fetch authorized details if needed. |
| Small viewport | Set IsVertical based on your responsive layout decision, or use a list/detail navigation flow. Keep a visible way back to the account list. |
Add these native Blocks to your consumer Screen, bind the listed events and connect your application actions. The interactive example above runs the web implementation.
Open the full native Splitter API →Changing the selection can leak one account’s draft into another. Key the data by record identity.
Resizing should only change layout. Recreating fields can lose caret position and unsaved text.
Keep keyboard resizing/collapse available and provide a labeled restore control.
Use the linked component accessibility notes when reviewing focus, keyboard behavior and status announcements in your implementation.