Skip to content
Klarhimmel UI

Operations, access detail

Operations, access detail previewOperations, access detail preview

Install

npx shadcn add @klarhimmel/app-access-detail
DetailsAbout, usage, props and more

An access record with a copyable code, explicit validity, permissions and recorded history; unknown permissions remain distinct from an empty list.

Import

Import

import Block from '@/components/klarhimmel/blocks/app-access-detail';
Also called
  • app/access-detail
Category
Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

Notes

When to use it

Inspect one authorized access record with its code, validity, permissions and locally recorded history. Use app-data-table for the list from which the host selects that record.

Writing for it

- Pass only the code the current viewer is authorized to see. Write the validity explicitly, including the end time; this presentation block does not determine whether a credential is active. - Use null permissions when they could not be read, an empty array when no doors are allowed, and a populated array for confirmed access. Keep sourceNote explicit about the history coverage.

Watch out for

The copy affordance only copies the supplied string. It never creates credentials, renews validity or writes a journal event; those operations and their authorization belong in the host application.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppAccessDetail from '@/components/klarhimmel/blocks/app-access-detail';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppAccessDetail props={{
          "eyebrow": "Selected access",
          "title": "Name the access",
          "description": "Say what these details cover and what to confirm before the code is shared.",
          "code": "XXXX-0000",
          "copyLabel": "Copy the access code",
          "validity": "Valid 00 Jan–00 Jan, until 00:00",
          "note": "Say where the codes and validity come from and what this block does not do.",
          "permissionsTitle": "Opens",
          "permissions": [
            "Name the first place",
            "Name the second place",
            "Name the third place"
          ],
          "unknownPermissions": "Say that permissions could not be read and what not to assume.",
          "emptyPermissions": "Say that nothing is opened.",
          "historyTitle": "Recorded history",
          "history": [
            {
              "time": "1 Jan · 00:00",
              "event": "Say what happened and who did it"
            },
            {
              "time": "1 Jan · 00:00",
              "event": "Say the next thing that happened"
            }
          ],
          "emptyHistory": "Say that no events are recorded.",
          "source": "Name the source",
          "sourceNote": "Say what the history covers and what it leaves out of the full record.",
          "action": {
            "label": "Open the settings",
            "href": "https://example.com/access"
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
eyebrowstring'Selected access'Text, up to 60 characters.
titlestring'Name the access'Text, up to 120 characters.
descriptionstring'Say what these details cover and wh…'Text, up to 300 characters.
codestring'XXXX-0000'Text, up to 40 characters.
copyLabelstring'Copy the access code'Text, up to 60 characters.
validitystring'Valid 00 Jan–00 Jan, until 00:00'Text, up to 120 characters.
notestring'Say where the codes and validity co…'Text, up to 200 characters.
permissionsTitlestring'Opens'Text, up to 60 characters.
permissionsstring[]3 itemsSee the type.
unknownPermissionsstring'Say that permissions could not be r…'Text, up to 160 characters.
emptyPermissionsstring'Say that nothing is opened.'Text, up to 160 characters.
historyTitlestring'Recorded history'Text, up to 60 characters.
history{ time, event }[]2 itemsList of up to 8. Each item: time, event.
emptyHistorystring'Say that no events are recorded.'Text, up to 160 characters.
sourcestring'Name the source'Text, up to 100 characters.
sourceNotestring'Say what the history covers and wha…'Text, up to 200 characters.
actionLink{…}See the type.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.