Search the documentation

Type to search page titles, component names and descriptions.

    Page Patterns

    RecordPage

    One durable subject on a full page.

    import { RecordActions, RecordRail, RecordSummary, RecordPage } from 'faifo-design'

    RecordPage is the full page of one record: create, edit, inspect or advance its workflow. RecordSummary is its identity header, RecordActions its actions and RecordRail the neutral aside of facts beside the record.

    #When to use

    • Use it for a record the reader works on for a while or returns to by URL.
    • The rail sits beside a wide record column and stacks by the page's own width, so a navigation sidebar beside it counts.
    • Pass sections to the rail directly; do not wrap them in another stack or card.

    #Examples

    Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.

    #Record shell

    A durable subject with record identity, tabs, form content and a right-hand facts rail.

    Acme · Main branch
    Customers / Mùa Hạ Riverside

    Mùa Hạ Riverside

    Active

    Main information

    Tags

    Recent orders

    OrderCustomerTotalState
    SO-1042Công ty Ánh Dương18.450.000 ₫Ready
    SO-1041Khách sạn Mùa Hạ6.800.000 ₫Review
    SO-1039Nguyễn Minh Châu2.150.000 ₫Blocked
    Show codeHide code
    import { JSXChild, TemplateResult } from '@ketvietlab/ketjs-view'
    import { ActionGroup, AppBrand, AppNavigation, AppShell, AppTopbar, Badge, Button, DataTable, Icon, Metric, NavigationToggle, Progress, RecordForm, RecordPage, Stack, Surface, Tabs } from 'faifo-design'
    // exampleApplications: a catalogue fixture, packages/faifo-design/src/catalogue/application-switcher.ts
    
    type OrderRow = {
      id: string
      customer: string
      total: string
      state: 'Ready' | 'Review' | 'Blocked'
    }
    
    const orders: OrderRow[] = [
      { id: 'SO-1042', customer: 'Công ty Ánh Dương', total: '18.450.000 ₫', state: 'Ready' },
      { id: 'SO-1041', customer: 'Khách sạn Mùa Hạ', total: '6.800.000 ₫', state: 'Review' },
      { id: 'SO-1039', customer: 'Nguyễn Minh Châu', total: '2.150.000 ₫', state: 'Blocked' },
    ]
    
    const toneOf = (state: OrderRow['state']) =>
      state === 'Ready' ? ('positive' as const) : state === 'Review' ? ('warning' as const) : ('danger' as const)
    
    type DemoLayout = 'collection' | 'record' | 'flow' | 'canvas'
    
    const demoNavItems = (active: DemoLayout) => [
      {
        label: 'Collection',
        href: '#app-shell',
        leading: <Icon name="table" />,
        active: active === 'collection',
        count: 148,
      },
      { label: 'Record', href: '#record-page', leading: <Icon name="file-text" />, active: active === 'record' },
      {
        label: 'Flow',
        href: '#workspace-flow',
        leading: <Icon name="git-branch" />,
        active: active === 'flow',
        count: 7,
      },
      {
        label: 'Canvas',
        href: '#workspace-canvas',
        leading: <Icon name="layout-grid" />,
        active: active === 'canvas',
      },
    ]
    
    const DemoSidebar = (props: {
      id: string
      active: DemoLayout
      externalTrigger?: boolean
    }): TemplateResult => (
      <AppNavigation
        id={`demo-navigation-${props.id}`}
        externalTrigger={props.externalTrigger}
        label="Faifo workspace"
        identity={<AppBrand label="Faifo" href="#app-shell" />}
        context="Operations workspace"
        menuLabel="Workspace menu"
        tools={{
          searchLabel: 'Search menu',
          searchPlaceholder: 'Find a function…',
          emptyLabel: 'No matching function.',
          collapseLabel: 'Collapse menu',
        }}
        groups={[
          {
            id: `demo-primary-${props.active}`,
            label: 'Workspace',
            items: demoNavItems(props.active).map((item) => ({
              ...item,
              id: `${props.active}-${item.href.slice(1)}`,
            })),
          },
          {
            id: `demo-manage-${props.active}`,
            label: 'Manage',
            exclusive: false,
            items: [
              {
                id: `${props.active}-settings`,
                label: 'Settings',
                href: '#app-navigation',
                leading: <Icon name="settings" />,
              },
              {
                id: `${props.active}-reports`,
                label: 'Reports',
                expanded: true,
                leading: <Icon name="layout-dashboard" />,
                children: [
                  { id: `${props.active}-sales-report`, label: 'Sales', href: '#data-table', count: 7 },
                  {
                    id: `${props.active}-stock-report`,
                    label: 'Inventory',
                    href: '#metric',
                    leading: <Icon name="inbox" />,
                  },
                  {
                    id: `${props.active}-report-settings`,
                    label: 'Cấu hình',
                    expanded: true,
                    children: [
                      { id: `${props.active}-terms`, label: 'Điều khoản thanh toán', href: '#navigation-terms' },
                      {
                        id: `${props.active}-long-label`,
                        label: 'Phương thức thanh toán dành cho nhà cung cấp quốc tế',
                        href: '#navigation-long',
                      },
                    ],
                  },
                ],
              },
            ],
          },
        ]}
        footer="Signed in · Duy Kieu"
      />
    )
    
    const DemoRail = (props: {
      title: string
      detail: string
      progress?: number
      items?: readonly JSXChild[]
    }): TemplateResult => (
      <div data-ui="shell-demo-rail">
        <p data-ui="catalogue-kicker">Context</p>
        <strong>{props.title}</strong>
        <p>{props.detail}</p>
        {props.progress !== undefined && <Progress label={props.title} value={props.progress} />}
        {props.items !== undefined && <Stack gap="compact" items={props.items} />}
      </div>
    )
    
    const DemoShell = (props: {
      id: string
      active: DemoLayout
      main: JSXChild
      railTitle?: string
      railDetail?: string
      railProgress?: number
      railItems?: readonly JSXChild[]
    }): TemplateResult => (
      <AppShell
        applications={{
          ...exampleApplications,
          ...(exampleApplications.settings
            ? { settings: { ...exampleApplications.settings, id: `${props.id}-settings` } }
            : {}),
          items: [
            ...exampleApplications.items,
            { id: 'phone', label: 'Phone', icon: 'phone', unavailableLabel: 'Coming soon' },
            { id: 'chat', label: 'Chat', icon: 'message-circle', unavailableLabel: 'Coming soon' },
          ],
        }}
        mode="embedded"
        location={
          <AppTopbar
            location={<span>Acme · Main branch</span>}
            navigation={
              <NavigationToggle controls={`demo-navigation-${props.id}-drawer`} label="Open navigation" />
            }
            search={{
              id: `demo-global-search-${props.id}`,
              action: '#app-shell',
              triggerLabel: 'Search everywhere',
              closeLabel: 'Close',
              label: 'Global search',
              placeholder: 'Search…',
              submitLabel: 'Search',
            }}
          />
        }
        sidebar={<DemoSidebar id={props.id} active={props.active} />}
        main={props.main}
        rightRail={
          props.railTitle !== undefined ? (
            <DemoRail
              title={props.railTitle}
              detail={props.railDetail ?? ''}
              progress={props.railProgress}
              items={props.railItems}
            />
          ) : undefined
        }
      />
    )
    
    const OrdersTable = (props: { grouped?: boolean; title?: string } = {}): TemplateResult => (
      <DataTable
        title={props.title}
        rows={props.grouped ? ([] as OrderRow[]) : orders}
        id={(row) => row.id}
        rowHref={(row) => `#${row.id}`}
        responsive="stack"
        selection={{ selectedIds: ['SO-1042'] }}
        groups={
          props.grouped
            ? [
                {
                  id: 'ready',
                  label: 'Ready to invoice',
                  count: 2,
                  rows: orders.slice(0, 2),
                  pager: { label: '2 shown in Ready', nextHref: '#data-table' },
                },
                {
                  id: 'blocked',
                  label: 'Needs decision',
                  count: 1,
                  rows: orders.slice(2),
                },
              ]
            : undefined
        }
        columns={[
          {
            key: 'id',
            label: 'Order',
            cell: (row) => row.id,
            priority: 'primary',
            kind: 'identifier',
            sort: { href: '#data-table', direction: 'descending' },
          },
          { key: 'customer', label: 'Customer', cell: (row) => row.customer },
          { key: 'total', label: 'Total', cell: (row) => row.total, align: 'end', kind: 'currency' },
          {
            key: 'state',
            label: 'State',
            cell: (row) => <Badge label={row.state} tone={toneOf(row.state)} />,
            kind: 'status',
          },
        ]}
      />
    )
    
    export const Example = () => (
      <DemoShell
        id="record-page"
        active="record"
        main={
          <RecordPage
            variant="operational"
            context="Customers / Mùa Hạ Riverside"
            title="Mùa Hạ Riverside"
            status={<Badge label="Active" tone="positive" />}
            actions={
              <ActionGroup
                actions={[
                  <Button label="Save" variant="primary" size="compact" />,
                  <Button label="Archive" variant="tertiary" size="compact" />,
                ]}
              />
            }
            navigation={
              <Tabs
                label="Customer record"
                items={[
                  { id: 'details', label: 'Details', href: '#record-page', active: true },
                  { id: 'orders', label: 'Orders', href: '#record-page', count: 6 },
                  { id: 'activity', label: 'Activity', href: '#record-page', count: 8 },
                ]}
              />
            }
            body={
              <Stack
                items={[
                  <Surface
                    title="Main information"
                    body={
                      <RecordForm
                        action="#record-page"
                        fields={[
                          {
                            id: 'layout-partner-name',
                            span: 'full',
                            name: 'name',
                            label: 'Name',
                            value: 'Mùa Hạ Riverside',
                          },
                          {
                            id: 'layout-partner-email',
                            span: 'full',
                            name: 'email',
                            label: 'Email',
                            type: 'email',
                            value: 'hello@muaha.example',
                          },
                          {
                            id: 'layout-partner-tags',
                            name: 'tags',
                            label: 'Tags',
                            type: 'checkbox-group',
                            span: 'full',
                            options: [
                              { value: 'vip', label: 'VIP', checked: true },
                              { value: 'hospitality', label: 'Hospitality', checked: true },
                            ],
                          },
                        ]}
                        submitLabel="Save"
                      />
                    }
                  />,
                  <OrdersTable title="Recent orders" />,
                ]}
              />
            }
            aside={
              <Stack
                items={[
                  <Metric label="Credit limit" value="80m ₫" detail="42m ₫ available" />,
                  <Progress label="Onboarding complete" value={84} tone="positive" />,
                ]}
              />
            }
            asideLabel="Customer context"
          />
        }
      />
    )

    #Record with a leading rail

    A rail of blockers that leads the record once the page stacks; a wide page keeps it beside the record.

    Acme · Main branch

    Order SO-1042

    Awaiting payment

    Main information

    Customer, delivery and lines.

    History

    Created, quoted, sent.

    Show codeHide code
    import { JSXChild, TemplateResult } from '@ketvietlab/ketjs-view'
    import { AppBrand, AppNavigation, AppShell, AppTopbar, Badge, Button, Icon, NavigationToggle, Progress, RecordPage, Stack, Surface, Text } from 'faifo-design'
    // exampleApplications: a catalogue fixture, packages/faifo-design/src/catalogue/application-switcher.ts
    
    type DemoLayout = 'collection' | 'record' | 'flow' | 'canvas'
    
    const demoNavItems = (active: DemoLayout) => [
      {
        label: 'Collection',
        href: '#app-shell',
        leading: <Icon name="table" />,
        active: active === 'collection',
        count: 148,
      },
      { label: 'Record', href: '#record-page', leading: <Icon name="file-text" />, active: active === 'record' },
      {
        label: 'Flow',
        href: '#workspace-flow',
        leading: <Icon name="git-branch" />,
        active: active === 'flow',
        count: 7,
      },
      {
        label: 'Canvas',
        href: '#workspace-canvas',
        leading: <Icon name="layout-grid" />,
        active: active === 'canvas',
      },
    ]
    
    const DemoSidebar = (props: {
      id: string
      active: DemoLayout
      externalTrigger?: boolean
    }): TemplateResult => (
      <AppNavigation
        id={`demo-navigation-${props.id}`}
        externalTrigger={props.externalTrigger}
        label="Faifo workspace"
        identity={<AppBrand label="Faifo" href="#app-shell" />}
        context="Operations workspace"
        menuLabel="Workspace menu"
        tools={{
          searchLabel: 'Search menu',
          searchPlaceholder: 'Find a function…',
          emptyLabel: 'No matching function.',
          collapseLabel: 'Collapse menu',
        }}
        groups={[
          {
            id: `demo-primary-${props.active}`,
            label: 'Workspace',
            items: demoNavItems(props.active).map((item) => ({
              ...item,
              id: `${props.active}-${item.href.slice(1)}`,
            })),
          },
          {
            id: `demo-manage-${props.active}`,
            label: 'Manage',
            exclusive: false,
            items: [
              {
                id: `${props.active}-settings`,
                label: 'Settings',
                href: '#app-navigation',
                leading: <Icon name="settings" />,
              },
              {
                id: `${props.active}-reports`,
                label: 'Reports',
                expanded: true,
                leading: <Icon name="layout-dashboard" />,
                children: [
                  { id: `${props.active}-sales-report`, label: 'Sales', href: '#data-table', count: 7 },
                  {
                    id: `${props.active}-stock-report`,
                    label: 'Inventory',
                    href: '#metric',
                    leading: <Icon name="inbox" />,
                  },
                  {
                    id: `${props.active}-report-settings`,
                    label: 'Cấu hình',
                    expanded: true,
                    children: [
                      { id: `${props.active}-terms`, label: 'Điều khoản thanh toán', href: '#navigation-terms' },
                      {
                        id: `${props.active}-long-label`,
                        label: 'Phương thức thanh toán dành cho nhà cung cấp quốc tế',
                        href: '#navigation-long',
                      },
                    ],
                  },
                ],
              },
            ],
          },
        ]}
        footer="Signed in · Duy Kieu"
      />
    )
    
    const DemoRail = (props: {
      title: string
      detail: string
      progress?: number
      items?: readonly JSXChild[]
    }): TemplateResult => (
      <div data-ui="shell-demo-rail">
        <p data-ui="catalogue-kicker">Context</p>
        <strong>{props.title}</strong>
        <p>{props.detail}</p>
        {props.progress !== undefined && <Progress label={props.title} value={props.progress} />}
        {props.items !== undefined && <Stack gap="compact" items={props.items} />}
      </div>
    )
    
    const DemoShell = (props: {
      id: string
      active: DemoLayout
      main: JSXChild
      railTitle?: string
      railDetail?: string
      railProgress?: number
      railItems?: readonly JSXChild[]
    }): TemplateResult => (
      <AppShell
        applications={{
          ...exampleApplications,
          ...(exampleApplications.settings
            ? { settings: { ...exampleApplications.settings, id: `${props.id}-settings` } }
            : {}),
          items: [
            ...exampleApplications.items,
            { id: 'phone', label: 'Phone', icon: 'phone', unavailableLabel: 'Coming soon' },
            { id: 'chat', label: 'Chat', icon: 'message-circle', unavailableLabel: 'Coming soon' },
          ],
        }}
        mode="embedded"
        location={
          <AppTopbar
            location={<span>Acme · Main branch</span>}
            navigation={
              <NavigationToggle controls={`demo-navigation-${props.id}-drawer`} label="Open navigation" />
            }
            search={{
              id: `demo-global-search-${props.id}`,
              action: '#app-shell',
              triggerLabel: 'Search everywhere',
              closeLabel: 'Close',
              label: 'Global search',
              placeholder: 'Search…',
              submitLabel: 'Search',
            }}
          />
        }
        sidebar={<DemoSidebar id={props.id} active={props.active} />}
        main={props.main}
        rightRail={
          props.railTitle !== undefined ? (
            <DemoRail
              title={props.railTitle}
              detail={props.railDetail ?? ''}
              progress={props.railProgress}
              items={props.railItems}
            />
          ) : undefined
        }
      />
    )
    
    export const Example = () => (
      <DemoShell
        id="record-page-leading-rail"
        active="record"
        main={
          <RecordPage
            variant="operational"
            title="Order SO-1042"
            status={<Badge label="Awaiting payment" tone="warning" />}
            actions={<Button label="Confirm order" variant="primary" size="compact" />}
            body={
              <Stack
                items={[
                  <Surface
                    title="Main information"
                    body={<Text as="p">Customer, delivery and lines.</Text>}
                  />,
                  <Surface title="History" body={<Text as="p">Created, quoted, sent.</Text>} />,
                ]}
              />
            }
            aside={
              <Surface
                title="Needs attention"
                body={
                  <Stack
                    divided
                    items={[
                      <Stack
                        gap="compact"
                        items={[
                          <Text variant="headingSm">No payment yet</Text>,
                          <Text as="p" variant="bodySm" tone="muted">
                            Take a deposit before the order ships.
                          </Text>,
                          <Button label="Record payment" size="compact" />,
                        ]}
                      />,
                      <Stack
                        gap="compact"
                        items={[
                          <Text variant="headingSm">No carrier</Text>,
                          <Text as="p" variant="bodySm" tone="muted">
                            Choose a carrier for the delivery date.
                          </Text>,
                          <Button label="Choose carrier" size="compact" />,
                        ]}
                      />,
                    ]}
                  />
                }
              />
            }
            asideLabel="Needs attention"
            asideWhenStacked="before"
          />
        }
      />
    )

    #Record summary, actions and rail

    One identity header and one neutral aside prevent nested-card drift.

    SO-1042

    An Việt Trading

    Ngọc LinhOwner
    Ready
    Delivery
    08/09/2026
    Total
    18.450.000 ₫
    Show codeHide code
    import { ActionMenu, Button, Grid, Person, RecordActions, RecordRail, RecordSummary, Stack, Status } from 'faifo-design'
    
    export const Example = () => (
      <Grid
        columns={2}
        items={[
          <Stack
            items={[
              <RecordSummary
                title="SO-1042"
                subtitle="An Việt Trading"
                person={{ name: 'Ngọc Linh', detail: 'Owner' }}
                status={{ label: 'Ready', tone: 'positive' }}
                facts={[
                  { id: 'date', label: 'Delivery', value: '08/09/2026' },
                  { id: 'total', label: 'Total', value: '18.450.000 ₫' },
                ]}
              />,
              <RecordActions
                actions={[
                  <Button label="Confirm" variant="primary" />,
                  <ActionMenu id="record-more" label="More" items={[]} />,
                ]}
              />,
            ]}
          />,
          <RecordRail
            sections={[
              {
                id: 'owner',
                title: 'Owner',
                body: <Person name="Ngọc Linh" detail="Sales operations" />,
              },
              { id: 'health', title: 'Health', body: <Status label="On track" tone="positive" /> },
            ]}
          />,
        ]}
      />
    )

    #Contract

    #Facts and the rail on a record page

    A long record page reads its facts in DescriptionLists inside Sections and keeps what blocks the record (unpaid balance, missing guarantee, unassigned room) in the aside rail:

    <RecordPage
      title="Order SO-1042"
      aside={<Surface title="Needs attention" body={blockers} />}
      asideLabel="Needs attention"
      asideWhenStacked="before"
      body={<Section title="Delivery" body={<DescriptionList columns="auto" items={delivery} />} />}
    />
    • DescriptionList.columns="auto" fits as many 12rem columns as the list's own width holds, at most four: three beside the rail on a 1440px screen, four on a wider one, two on a tablet, one on a phone. The empty tracks of a short list stay, so every list of the same width on the page shares its columns. Use it for the facts of a page and of a large record modal, whose groups stack at the dialog's full width (two fixed columns leave half of that row empty); a small or default dialog and a card keep a fixed columns count.
    • RecordPage.asideWhenStacked="before" puts the rail first once the page stacks into one column, between the header and the record, in the document as well as on screen, so its commands come before the record's in keyboard order. A wide page still draws it in the rail column. The default after keeps the rail below the record; use before only for a rail of things to act on, not for reference facts.
    • A record whose body holds a FaifoGrid (a document's lines, such as a sales order's) keeps the wide measure instead of narrowing to 40rem beside the rail: the rail stacks once the page is narrower than 91.5rem (the 68.75rem measure, the record's insets and the rail), so on a 1440px screen with the navigation open every line column shows without scrolling. The stacked page keeps the measure and the rail follows (or, with before, leads) the record in that column. Nothing to set: the page reads it from the grid's faifo-grid-island host. Size the grid's columns to fit that measure (68.75rem less the surface's inset) with its handle.
    • RecordPage.asideBreakpoint="wide" asks for the same measure without a grid, or before the grid has rendered; native record definitions forward it as pageAsideBreakpoint (a sales order sets it, with pageAsideWhenStacked="after").
    • A rail entry that points at the card where it is fixed (a missing fact held per variant) links to that card's Surface.id as #id; every entry of one list is then the same compact tertiary LinkButton, so the list keeps one edge.

    #API

    Generated from the package source. A property without a description has none in the source yet.

    #RecordActionsComponent

    PropertyDescriptionTypeDefault
    label–string'Record actions'
    actionsrequired–readonly JSXChild[]–

    #RecordRailComponent

    PropertyDescriptionTypeDefault
    label–string'Record context'
    sectionsrequired–readonly RecordRailSection[]–

    #RecordSummaryComponent

    PropertyDescriptionTypeDefault
    titlerequired–JSXChild–
    subtitle–JSXChild–
    person–PersonProps–
    status–{ label: string; tone?: Tone; detail?: string }–
    facts–readonly (KeyValueProps & { id: string })[]–

    #RecordPageComponent

    One durable subject: create, edit, inspect or advance its workflow.

    PropertyDescriptionTypeDefault
    titlerequired–string–
    bodyrequired–JSXChild–
    context–JSXChild–
    variant–'operational'–
    width–'default' | 'wide'–
    scope–string | null–
    status–JSXChild–
    actions–JSXChild–
    meta–JSXChild–
    pathWhere the record stands in its process (a StagePath). It belongs to the record's identity, so it is the header's last row and the header owns its spacing; controller is for a working editor below it.JSXChild–
    controller–JSXChild–
    navigation–JSXChild–
    aside–JSXChild–
    asideLabel–string | null–
    asideWhenStackedWhere the rail goes once the page stacks into one column. after (default) follows the record; before leads it, for a rail of blockers the reader must see first. A leading rail also comes first in the document, so focus and reading order match what a narrow screen shows; a wide page still places it in the rail column.'after' | 'before'–
    asideBreakpointKeep a wide editing region: stack the rail through 91.5rem of page width.'wide'–
    slots–RecordPageSlots–

    #Types

    #RecordRailSection

    PropertyDescriptionTypeDefault
    idrequired–string–
    titlerequired–string–
    bodyrequired–JSXChild–
    actions–JSXChild–

    #RecordSummaryProps

    The properties of RecordSummary, listed above.

    #RecordPageProps

    The properties of RecordPage, listed above.

    #RecordPageSlots

    PropertyDescriptionTypeDefault
    headerrequired–string–
    bodyrequired–string–
    fragmentTitle–string–

    #Hooks

    The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.

    • record-page
    • record-page-context
    • record-page-header
    • record-page-title-row
    • record-page-heading
    • record-page-title
    • record-page-subline
    • record-page-status
    • record-page-actions
    • record-page-meta
    • record-page-path
    • record-page-controller
    • record-page-navigation
    • record-page-layout
    • record-page-body
    • record-page-aside
    • record-summary
    • record-summary-main
    • record-actions
    • record-rail