Search the documentation

Type to search page titles, component names and descriptions.

    Layout

    Surface, Section and Disclosure

    Working regions on the canvas and the groups inside them.

    import { Disclosure, Section, Surface } from 'faifo-design'

    Surface is a working region on the page canvas: one panel with one border level. Section is a titled group inside it. Disclosure keeps secondary detail behind one line that still says something at a glance.

    #When to use

    • Use one Surface per working region. Do not nest a framed panel inside another to add emphasis.
    • Use Section to title a group inside a surface or a page; it does not draw a second frame.
    • Use Disclosure for detail most readers skip. Put what the closed line should say in meta.

    #Examples

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

    #Surface and section

    Layout components establish rhythm without domain assumptions.

    Operations

    Daily overview

    The section owns hierarchy; its body remains application data.

    Orders

    148

    +12.4% vs previous 7 days

    +12 today

    Review queue

    7

    +3 since yesterday

    Oldest 42 min

    Blocked

    2

    Credential required

    Archived

    1 204

    No state to report

    Show codeHide code
    import { Grid, Icon, LinkButton, Metric, Section } from 'faifo-design'
    
    export const Example = () => (
      <Section
        eyebrow="Operations"
        title="Daily overview"
        description="The section owns hierarchy; its body remains application data."
        actions={<LinkButton label="View report" href="#patterns" size="compact" />}
        body={
          <Grid
            columns={4}
            items={[
              <Metric
                label="Orders"
                value="148"
                detail="+12 today"
                tone="positive"
                change={{ label: '+12.4% vs previous 7 days', direction: 'up', tone: 'positive' }}
                icon={<Icon name="shopping-bag" />}
              />,
              <Metric
                label="Review queue"
                value="7"
                detail="Oldest 42 min"
                tone="warning"
                href="#surface-section"
                change={{ label: '+3 since yesterday', direction: 'up', tone: 'danger' }}
              />,
              <Metric label="Blocked" value="2" detail="Credential required" tone="danger" />,
              <Metric label="Archived" value="1 204" detail="No state to report" />,
            ]}
          />
        }
      />
    )

    #Disclosure

    Secondary detail stays available without dominating the primary workflow.

    Permission provenance
    sales.order.approvesales.order.read
    Show codeHide code
    import { Code, Disclosure, Stack } from 'faifo-design'
    
    export const Example = () => (
      <Disclosure
        summary="Permission provenance"
        body={
          <Stack
            gap="compact"
            items={[
              <Code value="sales.order.approve" context="managed-template" />,
              <Code value="sales.order.read" context="managed-template" />,
            ]}
          />
        }
      />
    )

    #Peer groups with disclosed fields

    One divided Stack owns the hairlines between groups, including a Disclosure. Surface and flat presentation remove child frames while preserving the parent divider.

    Call

    Result

    Reached the customer
    Additional information

    Next contact

    Tomorrow at 09:00
    Show codeHide code
    import { Disclosure, Field, Section, Stack, Surface } from 'faifo-design'
    
    export const Example = () => (
      <Surface
        title="Call"
        body={
          <Stack
            divided
            items={[
              <Section title="Result" body="Reached the customer" />,
              <Disclosure
                summary="Additional information"
                body={<Field id="peer-note" name="note" label="Internal note" type="textarea" />}
              />,
              <Section title="Next contact" body="Tomorrow at 09:00" />,
            ]}
          />
        }
      />
    )

    #API

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

    #DisclosureComponent

    Detail behind one line. meta is what the line says about it at a glance (a status, a level), kept beside the label so a closed list still reads.

    PropertyDescriptionTypeDefault
    summaryrequired–string–
    meta–JSXChild–
    leadingWhat the line starts with, before its label: a small image or icon of the item (a variant's photo).JSXChild–
    bodyrequired–JSXChild–
    open–boolean–

    #SectionComponent

    PropertyDescriptionTypeDefault
    titlerequired–string–
    bodyrequired–JSXChild–
    description–string | null–
    eyebrow–string | null–
    actions–JSXChild–
    idNames the section by its title. Give one when sections repeat the same fields (one per guest, one per line): a field's label alone ("Name") then does not say whose it is.string | null–

    #SurfaceComponent

    PropertyDescriptionTypeDefault
    bodyrequired–JSXChild–
    title–string–
    descriptionOne line under the title. A dashboard block keeps its heading, context and content in one card.string | null–
    actions–JSXChild–
    tone–'default' | 'subtle' | 'raised''default'
    padding–'none' | 'compact' | 'default''default'
    idThe card's anchor, for a link elsewhere on the page that points at it (#id).string–