> For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt.

# API inventory

**Components:** [`Page`](https://wallarm.github.io/design-system/components/page.md), [`PageHeader`](https://wallarm.github.io/design-system/components/page.md), [`PageHeaderGroup`](https://wallarm.github.io/design-system/components/page.md), [`PageTitle`](https://wallarm.github.io/design-system/components/page.md), [`PageDescription`](https://wallarm.github.io/design-system/components/page.md), [`PageActions`](https://wallarm.github.io/design-system/components/page.md), [`PageToolbar`](https://wallarm.github.io/design-system/components/page.md), [`PageContent`](https://wallarm.github.io/design-system/components/page.md)


+51 more

[`Button`](https://wallarm.github.io/design-system/components/button.md), [`SearchInput`](https://wallarm.github.io/design-system/components/search-input.md), [`SegmentedTabs`](https://wallarm.github.io/design-system/components/segmented-tabs.md), [`SegmentedTabsList`](https://wallarm.github.io/design-system/components/segmented-tabs.md), [`SegmentedTabsTrigger`](https://wallarm.github.io/design-system/components/segmented-tabs.md), [`NumericBadge`](https://wallarm.github.io/design-system/components/numeric-badge.md), [`ResizablePanelGroup`](https://wallarm.github.io/design-system/components/resizable.md), [`ResizablePanel`](https://wallarm.github.io/design-system/components/resizable.md), [`ResizableHandle`](https://wallarm.github.io/design-system/components/resizable.md), [`ScrollArea`](https://wallarm.github.io/design-system/components/scroll-area.md), [`ScrollAreaViewport`](https://wallarm.github.io/design-system/components/scroll-area.md), [`ScrollAreaContent`](https://wallarm.github.io/design-system/components/scroll-area.md), [`ScrollAreaScrollbar`](https://wallarm.github.io/design-system/components/scroll-area.md), [`TreeView`](https://wallarm.github.io/design-system/components/tree-view.md), [`TreeViewItem`](https://wallarm.github.io/design-system/components/tree-view.md), [`HttpMethod`](https://wallarm.github.io/design-system/components/http-method.md), [`ParameterPath`](https://wallarm.github.io/design-system/components/parameter-path.md), [`ResponseCode`](https://wallarm.github.io/design-system/components/response-code.md), [`Badge`](https://wallarm.github.io/design-system/components/badge.md), [`Tag`](https://wallarm.github.io/design-system/components/tag.md), [`Attribute`](https://wallarm.github.io/design-system/components/attribute.md), [`AttributeLabel`](https://wallarm.github.io/design-system/components/attribute.md), [`AttributeValue`](https://wallarm.github.io/design-system/components/attribute.md), [`Heading`](https://wallarm.github.io/design-system/components/heading.md), [`Text`](https://wallarm.github.io/design-system/components/text.md), [`HStack`](https://wallarm.github.io/design-system/components/stack.md), [`VStack`](https://wallarm.github.io/design-system/components/stack.md), [`Separator`](https://wallarm.github.io/design-system/components/separator.md), [`Tabs`](https://wallarm.github.io/design-system/components/tabs.md), [`TabsList`](https://wallarm.github.io/design-system/components/tabs.md), [`TabsTrigger`](https://wallarm.github.io/design-system/components/tabs.md), [`TabsContent`](https://wallarm.github.io/design-system/components/tabs.md), [`Table`](https://wallarm.github.io/design-system/components/table.md), [`DropdownMenu`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuTrigger`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuContent`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuItem`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuItemText`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuSeparator`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`Tooltip`](https://wallarm.github.io/design-system/components/tooltip.md), [`TooltipTrigger`](https://wallarm.github.io/design-system/components/tooltip.md), [`TooltipContent`](https://wallarm.github.io/design-system/components/tooltip.md), [`FormatNumber`](https://wallarm.github.io/design-system/components/format-number.md), [`FormatDateTime`](https://wallarm.github.io/design-system/components/format-date-time.md), [`Skeleton`](https://wallarm.github.io/design-system/components/skeleton.md), [`EmptyState`](https://wallarm.github.io/design-system/components/empty-state.md), [`EmptyStateIllustration`](https://wallarm.github.io/design-system/components/empty-state.md), [`EmptyStateMessage`](https://wallarm.github.io/design-system/components/empty-state.md), [`EmptyStateTitle`](https://wallarm.github.io/design-system/components/empty-state.md), [`EmptyStateDescription`](https://wallarm.github.io/design-system/components/empty-state.md), [`EmptyStateActions`](https://wallarm.github.io/design-system/components/empty-state.md)

An API discovery screen: every host and endpoint found in traffic sits in a tree on the left, and the selected endpoint opens in an inspector on the right. It is a master-detail layout inside one `Page`, split by `ResizablePanelGroup` instead of a drawer, because the reader moves through many endpoints in a row.

## What it shows

- The [Resource list page](https://wallarm.github.io/design-system/patterns/resource-list-page.md) frame, with the split in place of the `Table` in `PageContent`.
- A resizable split: a bordered `rounded-12` frame with no padding of its own, each panel scrolling on its own `ScrollArea`.
- `TreeView` as the master list: hosts are branches with a `NumericBadge`, endpoints are selectable rows with `HttpMethod`, the path and a risk score trailing on the right.
- The inspector is the [Detail drawer](https://wallarm.github.io/design-system/patterns/detail-drawer.md) composition in a panel instead of a `Drawer`. Nothing selected is the [Complex drawer](https://wallarm.github.io/design-system/patterns/complex-drawer.md) detail pane: centred secondary text.
- Domain primitives: `ParameterPath` for where a parameter lives, `ResponseCode` for status codes, `Badge` colors for risk and sensitive data, `FormatNumber` and `FormatDateTime` for traffic and timestamps.
- No results and a failed load in the tree follow [Empty states](https://wallarm.github.io/design-system/patterns/empty-states.md).

## Examples

An endpoint open in the inspector; search, tabs and host rows all work.

The whole screen with an endpoint open. Search and the status tabs filter the tree; hosts
expand and collapse; selecting an endpoint fills the inspector with its risk, sensitive data,
traffic and a parameters table built from `ParameterPath`. Drag the handle to resize.

```tsx
import { useState } from 'react';
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
import { Badge } from '@wallarm-org/design-system/Badge';
import { Button } from '@wallarm-org/design-system/Button';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
import { FormatNumber } from '@wallarm-org/design-system/FormatNumber';
import { Heading } from '@wallarm-org/design-system/Heading';
import { HttpMethod } from '@wallarm-org/design-system/HttpMethod';
import { ChevronDown, ChevronsDownUp, ChevronsUpDown, Download, FilterX, Globe, SearchX } from '@wallarm-org/design-system/icons';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
import { ParameterPath } from '@wallarm-org/design-system/ParameterPath';
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@wallarm-org/design-system/Resizable';
import { ResponseCode } from '@wallarm-org/design-system/ResponseCode';
import { ScrollArea, ScrollAreaContent, ScrollAreaScrollbar, ScrollAreaViewport } from '@wallarm-org/design-system/ScrollArea';
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
import { Separator } from '@wallarm-org/design-system/Separator';
import { HStack, VStack } from '@wallarm-org/design-system/Stack';
import { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Tag } from '@wallarm-org/design-system/Tag';
import { Text } from '@wallarm-org/design-system/Text';
import { Tooltip, TooltipContent, TooltipTrigger } from '@wallarm-org/design-system/Tooltip';
import { TreeView, TreeViewItem } from '@wallarm-org/design-system/TreeView';

export const Default = () => {
  const [query, setQuery] = useState('');
  const [status, setStatus] = useState('all');
  const [openIds, setOpenIds] = useState<string[]>(HOST_IDS);
  const [selectedId, setSelectedId] = useState<string | null>('pay-cards-post');
  const [tab, setTab] = useState('parameters');

  const search = query.trim().toLowerCase();
  const matchesSearch = (host: ApiHost, endpoint: Endpoint) =>
    host.host.includes(search) || endpoint.path.toLowerCase().includes(search);
  const searched = HOSTS.map(host => ({
    ...host,
    endpoints: host.endpoints.filter(endpoint => matchesSearch(host, endpoint)),
  }));
  const counts = {
    all: searched.flatMap(host => host.endpoints).length,
    sensitive: searched.flatMap(host => host.endpoints).filter(e => e.sensitive.length > 0).length,
    new: searched.flatMap(host => host.endpoints).filter(e => e.isNew).length,
  };
  const visibleHosts = searched
    .map(host => ({
      ...host,
      endpoints: host.endpoints.filter(
        endpoint =>
          status === 'all' ||
          (status === 'sensitive' && endpoint.sensitive.length > 0) ||
          (status === 'new' && endpoint.isNew),
      ),
    }))
    .filter(host => host.endpoints.length > 0);

  const visibleEndpointCount = visibleHosts.flatMap(host => host.endpoints).length;

  const endpoint = ALL_ENDPOINTS.find(item => item.id === selectedId) ?? null;
  const risk = endpoint ? getRisk(endpoint.risk) : null;

  const toggleHost = (id: string) =>
    setOpenIds(prev => (prev.includes(id) ? prev.filter(v => v !== id) : [...prev, id]));
  // Hosts are branches: a click on a host row toggles it instead of selecting it.
  const handleSelectionChange = (ids: string[]) => {
    const [id] = ids;
    if (id && HOST_IDS.includes(id)) {
      toggleHost(id);
      return;
    }
    setSelectedId(id ?? null);
    setTab('parameters');
  };
  const handleHostOpenChange = (id: string) => () => toggleHost(id);
  const handleExpandAll = () => setOpenIds(HOST_IDS);
  const handleCollapseAll = () => setOpenIds([]);
  // A new search reopens every host so matches are never hidden in a collapsed branch.
  const handleSearchChange = (value: string) => {
    setQuery(value);
    setOpenIds(HOST_IDS);
  };
  const handleReset = () => {
    setQuery('');
    setStatus('all');
  };
  const handleViewRequests = () => onViewRequests(endpoint);
  const handleMarkReviewed = () => onMarkReviewed(endpoint);
  const handleAddToPolicy = () => onAddToPolicy(endpoint);
  const handleHide = () => onHideEndpoint(endpoint);

  const renderParameter = ({ row }: TableCellContext<Parameter, unknown>) => (
    <ParameterPath segments={row.original.segments} />
  );
  const renderRequired = ({ row }: TableCellContext<Parameter, unknown>) =>
    row.original.required ? 'Required' : 'Optional';
  const renderSensitive = ({ row }: TableCellContext<Parameter, unknown>) =>
    row.original.sensitive ? (
      <Badge type='secondary' color={SENSITIVE_COLOR[row.original.sensitive]}>
        {row.original.sensitive}
      </Badge>
    ) : (
      '—'
    );
  const renderCode = ({ row }: TableCellContext<EndpointResponse, unknown>) => (
    <ResponseCode code={row.original.code} />
  );
  const renderShare = ({ row }: TableCellContext<EndpointResponse, unknown>) => (
    <FormatNumber value={row.original.share} type='percent' />
  );

  const parameterColumns: TableColumnDef<Parameter>[] = [
    { id: 'parameter', header: 'Parameter', size: 300, cell: renderParameter },
    { accessorKey: 'type', header: 'Type', size: 120 },
    { id: 'required', header: 'Presence', size: 120, cell: renderRequired },
    { id: 'sensitive', header: 'Sensitive data', size: 160, cell: renderSensitive },
  ];
  const responseColumns: TableColumnDef<EndpointResponse>[] = [
    { id: 'code', header: 'Status', size: 160, cell: renderCode },
    { id: 'share', header: 'Share of responses', size: 200, cell: renderShare },
  ];

  return (
    <Page name='api-inventory' fullSize fixedHeight data-testid='api-inventory-page'>
      <PageHeader>
        <PageHeaderGroup className='flex-1'>
          <PageTitle>API inventory</PageTitle>
          <PageDescription>
            Hosts and endpoints discovered from live traffic, with the parameters and sensitive data
            each one carries.
          </PageDescription>
        </PageHeaderGroup>
        <PageActions>
          <Button variant='secondary' color='neutral' size='medium' onClick={onExport}>
            <Download />
            Export
          </Button>
          <Button size='medium' onClick={onUploadSpec} data-testid='api-inventory-upload'>
            Upload specification
          </Button>
        </PageActions>
      </PageHeader>

      <PageToolbar>
        <SearchInput
          value={query}
          onChange={handleSearchChange}
          placeholder='Search host or path'
          className='w-[320px]'
          data-testid='api-inventory-search'
        />
        <SegmentedTabs value={status} onChange={setStatus} data-testid='api-inventory-status'>
          <SegmentedTabsList>
            <SegmentedTabsTrigger value='all'>
              All <NumericBadge>{counts.all}</NumericBadge>
            </SegmentedTabsTrigger>
            <SegmentedTabsTrigger value='sensitive'>
              Sensitive data <NumericBadge>{counts.sensitive}</NumericBadge>
            </SegmentedTabsTrigger>
            <SegmentedTabsTrigger value='new'>
              New <NumericBadge>{counts.new}</NumericBadge>
            </SegmentedTabsTrigger>
          </SegmentedTabsList>
        </SegmentedTabs>
      </PageToolbar>

      <PageContent>
        <div className='h-full overflow-hidden rounded-12 border border-border-primary'>
          <ResizablePanelGroup data-testid='api-inventory-split'>
            <ResizablePanel id='tree' defaultSize='32%' minSize='22%' maxSize='50%'>
              <div className='flex h-full flex-col'>
                <HStack justify='between' align='center' className='h-40 shrink-0 px-12'>
                  <Text size='xs' weight='medium' color='secondary'>
                    {pluralize(visibleHosts.length, 'host')} ·{' '}
                    {pluralize(visibleEndpointCount, 'endpoint')}
                  </Text>
                  <HStack gap={2}>
                    <Tooltip>
                      <TooltipTrigger asChild>
                        <Button
                          variant='ghost'
                          color='neutral'
                          size='small'
                          aria-label='Expand all hosts'
                          onClick={handleExpandAll}
                        >
                          <ChevronsUpDown />
                        </Button>
                      </TooltipTrigger>
                      <TooltipContent>Expand all</TooltipContent>
                    </Tooltip>
                    <Tooltip>
                      <TooltipTrigger asChild>
                        <Button
                          variant='ghost'
                          color='neutral'
                          size='small'
                          aria-label='Collapse all hosts'
                          onClick={handleCollapseAll}
                        >
                          <ChevronsDownUp />
                        </Button>
                      </TooltipTrigger>
                      <TooltipContent>Collapse all</TooltipContent>
                    </Tooltip>
                  </HStack>
                </HStack>
                <Separator />
                <ScrollArea className='min-h-0 flex-1'>
                  <ScrollAreaViewport>
                    <ScrollAreaContent className='min-w-0! py-4'>
                      {visibleHosts.length > 0 ? (
                        <TreeView
                          selectable
                          selectedIds={selectedId ? [selectedId] : []}
                          onSelectionChange={handleSelectionChange}
                          aria-label='Hosts and endpoints'
                          data-testid='api-inventory-tree'
                        >
                          {visibleHosts.map(host => (
                            <TreeViewItem
                              key={host.id}
                              id={host.id}
                              open={openIds.includes(host.id)}
                              onOpenChange={handleHostOpenChange(host.id)}
                              data-testid={`api-inventory-host-${host.id}`}
                            >
                              <Globe />
                              {host.host}
                              <NumericBadge>{host.endpoints.length}</NumericBadge>
                              {host.endpoints.map(item => (
                                <TreeViewItem
                                  key={item.id}
                                  id={item.id}
                                  data-testid={`api-inventory-endpoint-${item.id}`}
                                >
                                  <span className='flex w-64 shrink-0'>
                                    <HttpMethod method={item.method} size='small' />
                                  </span>
                                  {item.path}
                                  <Badge
                                    variant='dotted'
                                    type='text-color'
                                    size='small'
                                    color={getRisk(item.risk).color}
                                  >
                                    {item.risk.toFixed(1)}
                                  </Badge>
                                </TreeViewItem>
                              ))}
                            </TreeViewItem>
                          ))}
                        </TreeView>
                      ) : (
                        <div className='flex justify-center py-48'>
                          <EmptyState
                            type='collection-empty'
                            data-testid='api-inventory-no-results'
                          >
                            <EmptyStateIllustration>
                              <SearchX />
                            </EmptyStateIllustration>
                            <EmptyStateMessage>
                              <EmptyStateTitle>No results found</EmptyStateTitle>
                              <EmptyStateDescription>
                                Nothing matches your search or status.
                              </EmptyStateDescription>
                            </EmptyStateMessage>
                            <EmptyStateActions>
                              <Button
                                size='medium'
                                variant='outline'
                                color='neutral'
                                onClick={handleReset}
                              >
                                <FilterX />
                                Reset filters
                              </Button>
                            </EmptyStateActions>
                          </EmptyState>
                        </div>
                      )}
                    </ScrollAreaContent>
                  </ScrollAreaViewport>
                  <ScrollAreaScrollbar />
                </ScrollArea>
              </div>
            </ResizablePanel>

            <ResizableHandle />

            <ResizablePanel id='inspector' defaultSize='68%' minSize='40%'>
              {endpoint && risk ? (
                <ScrollArea className='h-full' data-testid='api-inventory-inspector'>
                  <ScrollAreaViewport>
                    <ScrollAreaContent className='min-w-0!'>
                      <HStack
                        justify='between'
                        align='start'
                        gap={16}
                        className='px-24 pt-20 pb-16'
                      >
                        <VStack gap={6} className='min-w-0'>
                          <HStack gap={8} align='center'>
                            <HttpMethod method={endpoint.method} size='large' />
                            <Heading
                              as='h2'
                              size='lg'
                              weight='medium'
                              truncate
                              data-testid='api-inventory-title'
                            >
                              {endpoint.path}
                            </Heading>
                          </HStack>
                          <HStack gap={6} align='center'>
                            <Text size='sm' color='secondary'>
                              {HOST_BY_ENDPOINT.get(endpoint.id)}
                            </Text>
                            {endpoint.isNew && (
                              <Badge type='secondary' color='blue' size='small'>
                                New
                              </Badge>
                            )}
                          </HStack>
                        </VStack>
                        <DropdownMenu>
                          <DropdownMenuTrigger asChild>
                            <Button
                              variant='outline'
                              color='neutral'
                              size='small'
                              data-testid='api-inventory-actions'
                            >
                              Actions <ChevronDown />
                            </Button>
                          </DropdownMenuTrigger>
                          <DropdownMenuContent>
                            <DropdownMenuItem onSelect={handleMarkReviewed}>
                              <DropdownMenuItemText>Mark as reviewed</DropdownMenuItemText>
                            </DropdownMenuItem>
                            <DropdownMenuItem onSelect={handleAddToPolicy}>
                              <DropdownMenuItemText>Add to API policy</DropdownMenuItemText>
                            </DropdownMenuItem>
                            <DropdownMenuItem onSelect={handleViewRequests}>
                              <DropdownMenuItemText>Go to requests</DropdownMenuItemText>
                            </DropdownMenuItem>
                            <DropdownMenuSeparator />
                            <DropdownMenuItem variant='destructive' onSelect={handleHide}>
                              <DropdownMenuItemText>Hide endpoint</DropdownMenuItemText>
                            </DropdownMenuItem>
                          </DropdownMenuContent>
                        </DropdownMenu>
                      </HStack>

                      <div
                        className='grid grid-cols-2 gap-x-8 gap-y-6 px-24 pb-16'
                        data-testid='api-inventory-attributes'
                      >
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>Risk score</AttributeLabel>
                          <AttributeValue>
                            <HStack gap={8} align='center'>
                              <Badge variant='dotted' type='secondary' color={risk.color}>
                                {risk.label}
                              </Badge>
                              <Text size='sm'>{endpoint.risk.toFixed(1)} of 10</Text>
                            </HStack>
                          </AttributeValue>
                        </Attribute>
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>Requests, 24h</AttributeLabel>
                          <AttributeValue>
                            <FormatNumber value={endpoint.requests} unit='requests' />
                          </AttributeValue>
                        </Attribute>
                        <Attribute
                          orientation='horizontal'
                          isEmpty={endpoint.sensitive.length === 0}
                        >
                          <AttributeLabel>Sensitive data</AttributeLabel>
                          <AttributeValue>
                            <HStack gap={4} wrap='wrap'>
                              {endpoint.sensitive.map(item => (
                                <Badge key={item} type='secondary' color={SENSITIVE_COLOR[item]}>
                                  {item}
                                </Badge>
                              ))}
                            </HStack>
                          </AttributeValue>
                        </Attribute>
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>First seen</AttributeLabel>
                          <AttributeValue>
                            <FormatDateTime
                              value={endpoint.firstSeen}
                              format='datetime'
                              layout='inline'
                            />
                          </AttributeValue>
                        </Attribute>
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>Authentication</AttributeLabel>
                          <AttributeValue>
                            {endpoint.auth === 'None' ? (
                              <Badge variant='dotted' type='secondary' color='red'>
                                Unauthenticated
                              </Badge>
                            ) : (
                              <Tag>{endpoint.auth}</Tag>
                            )}
                          </AttributeValue>
                        </Attribute>
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>Last seen</AttributeLabel>
                          <AttributeValue>
                            <FormatDateTime
                              value={endpoint.lastSeen}
                              format='datetime'
                              layout='inline'
                            />
                          </AttributeValue>
                        </Attribute>
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>Status codes</AttributeLabel>
                          <AttributeValue>
                            <HStack gap={4}>
                              {endpoint.responses.map(response => (
                                <ResponseCode key={response.code} code={response.code} />
                              ))}
                            </HStack>
                          </AttributeValue>
                        </Attribute>
                        <Attribute orientation='horizontal'>
                          <AttributeLabel>Application</AttributeLabel>
                          <AttributeValue>
                            <Tag>{endpoint.application}</Tag>
                          </AttributeValue>
                        </Attribute>
                      </div>

                      <Tabs value={tab} onChange={setTab} data-testid='api-inventory-tabs'>
                        <TabsList>
                          <TabsTrigger value='parameters'>
                            Parameters <NumericBadge>{endpoint.parameters.length}</NumericBadge>
                          </TabsTrigger>
                          <TabsTrigger value='responses'>
                            Responses <NumericBadge>{endpoint.responses.length}</NumericBadge>
                          </TabsTrigger>
                        </TabsList>
                        <TabsContent value='parameters'>
                          <div className='px-16 pt-8 pb-16'>
                            <Table
                              aria-label='Parameters'
                              data={endpoint.parameters}
                              columns={parameterColumns}
                              getRowId={getParameterId}
                              data-testid='api-inventory-parameters'
                            >
                              {endpoint.parameters.length === 0 && (
                                <EmptyState type='collection-empty'>
                                  <EmptyStateMessage>
                                    <EmptyStateTitle>No parameters</EmptyStateTitle>
                                    <EmptyStateDescription>
                                      Requests to this endpoint carry no query, body or header
                                      parameters.
                                    </EmptyStateDescription>
                                  </EmptyStateMessage>
                                </EmptyState>
                              )}
                            </Table>
                          </div>
                        </TabsContent>
                        <TabsContent value='responses'>
                          <div className='px-16 pt-8 pb-16'>
                            <Table
                              aria-label='Responses'
                              data={endpoint.responses}
                              columns={responseColumns}
                              getRowId={getResponseId}
                              data-testid='api-inventory-responses'
                            />
                          </div>
                        </TabsContent>
                      </Tabs>
                    </ScrollAreaContent>
                  </ScrollAreaViewport>
                  <ScrollAreaScrollbar />
                </ScrollArea>
              ) : (
                <div
                  className='flex h-full items-center justify-center'
                  data-testid='api-inventory-inspector-empty'
                >
                  <Text size='sm' color='secondary'>
                    Select an endpoint to view details
                  </Text>
                </div>
              )}
            </ResizablePanel>
          </ResizablePanelGroup>
        </div>
      </PageContent>
    </Page>
  );
};
```

Nothing selected yet: the inspector names the choice that fills it.

Nothing is selected yet: the tree is ready and the inspector names the choice that fills it,
with no action of its own.

```tsx
import { useState } from 'react';
import { Badge } from '@wallarm-org/design-system/Badge';
import { Button } from '@wallarm-org/design-system/Button';
import { HttpMethod } from '@wallarm-org/design-system/HttpMethod';
import { Download, Globe } from '@wallarm-org/design-system/icons';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@wallarm-org/design-system/Resizable';
import { ScrollArea, ScrollAreaContent, ScrollAreaScrollbar, ScrollAreaViewport } from '@wallarm-org/design-system/ScrollArea';
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
import { Separator } from '@wallarm-org/design-system/Separator';
import { HStack } from '@wallarm-org/design-system/Stack';
import { Text } from '@wallarm-org/design-system/Text';
import { TreeView, TreeViewItem } from '@wallarm-org/design-system/TreeView';

export const NothingSelected = () => {
  const [query, setQuery] = useState('');
  const [status, setStatus] = useState('all');

  const counts = {
    all: ALL_ENDPOINTS.length,
    sensitive: ALL_ENDPOINTS.filter(endpoint => endpoint.sensitive.length > 0).length,
    new: ALL_ENDPOINTS.filter(endpoint => endpoint.isNew).length,
  };

  return (
    <Page name='api-inventory' fullSize fixedHeight data-testid='api-inventory-page'>
      <PageHeader>
        <PageHeaderGroup className='flex-1'>
          <PageTitle>API inventory</PageTitle>
          <PageDescription>
            Hosts and endpoints discovered from live traffic, with the parameters and sensitive data
            each one carries.
          </PageDescription>
        </PageHeaderGroup>
        <PageActions>
          <Button variant='secondary' color='neutral' size='medium' onClick={onExport}>
            <Download />
            Export
          </Button>
          <Button size='medium' onClick={onUploadSpec} data-testid='api-inventory-upload'>
            Upload specification
          </Button>
        </PageActions>
      </PageHeader>

      <PageToolbar>
        <SearchInput
          value={query}
          onChange={setQuery}
          placeholder='Search host or path'
          className='w-[320px]'
          data-testid='api-inventory-search'
        />
        <SegmentedTabs value={status} onChange={setStatus} data-testid='api-inventory-status'>
          <SegmentedTabsList>
            <SegmentedTabsTrigger value='all'>
              All <NumericBadge>{counts.all}</NumericBadge>
            </SegmentedTabsTrigger>
            <SegmentedTabsTrigger value='sensitive'>
              Sensitive data <NumericBadge>{counts.sensitive}</NumericBadge>
            </SegmentedTabsTrigger>
            <SegmentedTabsTrigger value='new'>
              New <NumericBadge>{counts.new}</NumericBadge>
            </SegmentedTabsTrigger>
          </SegmentedTabsList>
        </SegmentedTabs>
      </PageToolbar>

      <PageContent>
        <div className='h-full overflow-hidden rounded-12 border border-border-primary'>
          <ResizablePanelGroup data-testid='api-inventory-split'>
            <ResizablePanel id='tree' defaultSize='32%' minSize='22%' maxSize='50%'>
              <div className='flex h-full flex-col'>
                <HStack align='center' className='h-40 shrink-0 px-12'>
                  <Text size='xs' weight='medium' color='secondary'>
                    {HOSTS.length} hosts · {ALL_ENDPOINTS.length} endpoints
                  </Text>
                </HStack>
                <Separator />
                <ScrollArea className='min-h-0 flex-1'>
                  <ScrollAreaViewport>
                    <ScrollAreaContent className='min-w-0! py-4'>
                      <TreeView
                        selectable
                        aria-label='Hosts and endpoints'
                        data-testid='api-inventory-tree'
                      >
                        {HOSTS.map(host => (
                          <TreeViewItem key={host.id} defaultOpen>
                            <Globe />
                            {host.host}
                            <NumericBadge>{host.endpoints.length}</NumericBadge>
                            {host.endpoints.map(item => (
                              <TreeViewItem key={item.id} id={item.id}>
                                <span className='flex w-64 shrink-0'>
                                  <HttpMethod method={item.method} size='small' />
                                </span>
                                {item.path}
                                <Badge
                                  variant='dotted'
                                  type='text-color'
                                  size='small'
                                  color={getRisk(item.risk).color}
                                >
                                  {item.risk.toFixed(1)}
                                </Badge>
                              </TreeViewItem>
                            ))}
                          </TreeViewItem>
                        ))}
                      </TreeView>
                    </ScrollAreaContent>
                  </ScrollAreaViewport>
                  <ScrollAreaScrollbar />
                </ScrollArea>
              </div>
            </ResizablePanel>

            <ResizableHandle />

            <ResizablePanel id='inspector' defaultSize='68%' minSize='40%'>
              <div
                className='flex h-full items-center justify-center'
                data-testid='api-inventory-inspector-empty'
              >
                <Text size='sm' color='secondary'>
                  Select an endpoint to view details
                </Text>
              </div>
            </ResizablePanel>
          </ResizablePanelGroup>
        </div>
      </PageContent>
    </Page>
  );
};
```

The inventory failed to load: the error and "Try again" take the tree's place.

The inventory failed to load: the header and toolbar stay, the tree panel shows the error in
place of the hosts with "Try again", and the inspector has nothing to show.

```tsx
import { Button } from '@wallarm-org/design-system/Button';
import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
import { CloudOff, Download, RefreshCcw } from '@wallarm-org/design-system/icons';
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@wallarm-org/design-system/Resizable';
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
import { Text } from '@wallarm-org/design-system/Text';

export const LoadError = () => (
  <Page name='api-inventory' fullSize fixedHeight data-testid='api-inventory-page'>
    <PageHeader>
      <PageHeaderGroup className='flex-1'>
        <PageTitle>API inventory</PageTitle>
        <PageDescription>
          Hosts and endpoints discovered from live traffic, with the parameters and sensitive data
          each one carries.
        </PageDescription>
      </PageHeaderGroup>
      <PageActions>
        <Button variant='secondary' color='neutral' size='medium' onClick={onExport}>
          <Download />
          Export
        </Button>
        <Button size='medium' onClick={onUploadSpec} data-testid='api-inventory-upload'>
          Upload specification
        </Button>
      </PageActions>
    </PageHeader>

    <PageToolbar>
      <SearchInput
        placeholder='Search host or path'
        className='w-[320px]'
        data-testid='api-inventory-search'
      />
      <SegmentedTabs defaultValue='all' data-testid='api-inventory-status'>
        <SegmentedTabsList>
          <SegmentedTabsTrigger value='all'>All</SegmentedTabsTrigger>
          <SegmentedTabsTrigger value='sensitive'>Sensitive data</SegmentedTabsTrigger>
          <SegmentedTabsTrigger value='new'>New</SegmentedTabsTrigger>
        </SegmentedTabsList>
      </SegmentedTabs>
    </PageToolbar>

    <PageContent>
      <div className='h-full overflow-hidden rounded-12 border border-border-primary'>
        <ResizablePanelGroup data-testid='api-inventory-split'>
          <ResizablePanel id='tree' defaultSize='32%' minSize='22%' maxSize='50%'>
            <div className='flex justify-center py-48'>
              <EmptyState data-testid='api-inventory-error'>
                <EmptyStateIllustration>
                  <CloudOff />
                </EmptyStateIllustration>
                <EmptyStateMessage>
                  <EmptyStateTitle>Couldn't load endpoints</EmptyStateTitle>
                  <EmptyStateDescription>
                    The server didn't respond. Try again in a moment.
                  </EmptyStateDescription>
                </EmptyStateMessage>
                <EmptyStateActions>
                  <Button
                    size='medium'
                    variant='outline'
                    color='neutral'
                    onClick={onRetryInventory}
                  >
                    <RefreshCcw />
                    Try again
                  </Button>
                </EmptyStateActions>
              </EmptyState>
            </div>
          </ResizablePanel>

          <ResizableHandle />

          <ResizablePanel id='inspector' defaultSize='68%' minSize='40%'>
            <div className='flex h-full items-center justify-center'>
              <Text size='sm' color='secondary'>
                Select an endpoint to view details
              </Text>
            </div>
          </ResizablePanel>
        </ResizablePanelGroup>
      </div>
    </PageContent>
  </Page>
);
```

First load: skeletons where the tree, attributes and parameters will be.

First load: the real header and toolbar stay, the tree and the inspector fill with skeletons,
and the parameters table shows placeholder rows. Never a `Loader` in place of the screen.

```tsx
import { Attribute } from '@wallarm-org/design-system/Attribute';
import { Button } from '@wallarm-org/design-system/Button';
import { Download } from '@wallarm-org/design-system/icons';
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@wallarm-org/design-system/Resizable';
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
import { Skeleton } from '@wallarm-org/design-system/Skeleton';
import { VStack } from '@wallarm-org/design-system/Stack';
import { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';

export const Loading = () => {
  const parameterColumns: TableColumnDef<Parameter>[] = [
    { id: 'parameter', header: 'Parameter', size: 300 },
    { accessorKey: 'type', header: 'Type', size: 120 },
    { id: 'required', header: 'Presence', size: 120 },
    { id: 'sensitive', header: 'Sensitive data', size: 160 },
  ];

  return (
    <Page name='api-inventory' fullSize fixedHeight data-testid='api-inventory-page'>
      <PageHeader>
        <PageHeaderGroup className='flex-1'>
          <PageTitle>API inventory</PageTitle>
          <PageDescription>
            Hosts and endpoints discovered from live traffic, with the parameters and sensitive data
            each one carries.
          </PageDescription>
        </PageHeaderGroup>
        <PageActions>
          <Button variant='secondary' color='neutral' size='medium' onClick={onExport}>
            <Download />
            Export
          </Button>
          <Button size='medium' onClick={onUploadSpec} data-testid='api-inventory-upload'>
            Upload specification
          </Button>
        </PageActions>
      </PageHeader>

      <PageToolbar>
        <SearchInput
          placeholder='Search host or path'
          className='w-[320px]'
          disabled
          data-testid='api-inventory-search'
        />
        <SegmentedTabs defaultValue='all' data-testid='api-inventory-status'>
          <SegmentedTabsList>
            <SegmentedTabsTrigger value='all'>All</SegmentedTabsTrigger>
            <SegmentedTabsTrigger value='sensitive'>Sensitive data</SegmentedTabsTrigger>
            <SegmentedTabsTrigger value='new'>New</SegmentedTabsTrigger>
          </SegmentedTabsList>
        </SegmentedTabs>
      </PageToolbar>

      <PageContent>
        <div className='h-full overflow-hidden rounded-12 border border-border-primary'>
          <ResizablePanelGroup data-testid='api-inventory-split'>
            <ResizablePanel id='tree' defaultSize='32%' minSize='22%' maxSize='50%'>
              <VStack gap={12} className='px-12 py-12' data-testid='api-inventory-tree-loading'>
                {SKELETON_ROWS.map(row => (
                  <Skeleton key={row} width='100%' height='16px' />
                ))}
              </VStack>
            </ResizablePanel>

            <ResizableHandle />

            <ResizablePanel id='inspector' defaultSize='68%' minSize='40%'>
              <VStack gap={16} className='px-24 pt-20 pb-16'>
                <Skeleton width='320px' height='24px' />
                <Skeleton width='160px' height='16px' />
              </VStack>
              <div className='grid grid-cols-2 gap-x-8 gap-y-6 px-24 pb-16'>
                {SKELETON_ATTRIBUTES.map(item => (
                  <Attribute key={item} orientation='horizontal' loading />
                ))}
              </div>
              <Tabs defaultValue='parameters' data-testid='api-inventory-tabs'>
                <TabsList>
                  <TabsTrigger value='parameters'>Parameters</TabsTrigger>
                  <TabsTrigger value='responses'>Responses</TabsTrigger>
                </TabsList>
                <TabsContent value='parameters'>
                  <div className='px-16 pt-8 pb-16'>
                    <Table
                      aria-label='Parameters'
                      data={[]}
                      columns={parameterColumns}
                      getRowId={getParameterId}
                      isLoading
                      skeletonCount={6}
                      data-testid='api-inventory-parameters'
                    />
                  </div>
                </TabsContent>
              </Tabs>
            </ResizablePanel>
          </ResizablePanelGroup>
        </div>
      </PageContent>
    </Page>
  );
};
```

## Related

- [Resource list page](https://wallarm.github.io/design-system/patterns/resource-list-page.md)
- [Detail drawer](https://wallarm.github.io/design-system/patterns/detail-drawer.md)
- [Complex drawer](https://wallarm.github.io/design-system/patterns/complex-drawer.md)
- [Entity table](https://wallarm.github.io/design-system/patterns/entity-table.md)
- [Empty states](https://wallarm.github.io/design-system/patterns/empty-states.md)
- [Filtering](https://wallarm.github.io/design-system/patterns/filtering.md)
