Layout

Reference for Spiderly's layout components — application shell, panels, cards, and buttons.

SpiderlyLayout

Selector: spiderly-layout

Main application shell with sidebar or top menu navigation, user profile avatar, and content area.

Inputs

InputTypeDefaultDescription
menuSpiderlyMenuItem[][]Menu definition (see SpiderlyMenuItem)
isSideMenuLayoutbooleantruetrue = sidebar navigation; false = top menu navigation
maxWidthstring'1100px'CSS max-width for the main content area

Content Projection

Add custom actions to the header (positioned left of the profile avatar) using the ACTIONS attribute:

<spiderly-layout [menu]="menu" [isSideMenuLayout]="false">
  <div ACTIONS>
    <spiderly-button icon="pi pi-bell" [outlined]="true" (onClick)="showNotifications()"></spiderly-button>
  </div>
</spiderly-layout>

For step-by-step layout customization (theme colors, logo, favicon, side vs top menu), see the Frontend Customization guide.

SpiderlyMenuItem

Interface for menu items. Extends PrimeNG's MenuItem with permission support:

interface SpiderlyMenuItem extends MenuItem {
  hasPermission?: (permissionCodes: string[]) => boolean;
  showPartnerDialog?: boolean;
}

Key properties inherited from PrimeNG MenuItem:

PropertyTypeDescription
labelstringMenu item text
iconstringPrimeIcons class (e.g. 'pi pi-home')
routerLinkstring[]Angular route
itemsMenuItem[]Submenu children
visiblebooleanShow/hide the item
disabledbooleanDisable the item
badgestringBadge text

Permission-Based Visibility

Use hasPermission to show menu items only for users with specific permissions:

{
  label: this.translocoService.translate('AdminSettings'),
  icon: 'pi pi-cog',
  routerLink: ['/admin-settings'],
  hasPermission: (codes) => codes.includes('ADMIN'),
}

SpiderlyPanel

Selector: spiderly-panel

Collapsible content container with optional CRUD context menu. Used by generated detail pages for grouping form fields.

Requires SpiderlyPanelsModule import.

Inputs

InputTypeDefaultDescription
toggleablebooleanfalseWhether the panel can be collapsed
collapsedbooleanfalseInitial collapsed state
showPanelHeaderbooleantrueWhether to render the panel header
crudMenuMenuItem[]Context menu items shown in the panel header
showCrudMenubooleantrueWhether to show the CRUD context menu icon
showRemoveIconbooleanfalseWhether to show a remove/delete icon
indexnumberRow index (forwarded with menu/remove events)

Outputs

OutputPayloadDescription
onMenuIconClicknumberFires with the panel's index when the menu icon is clicked
onRemoveIconClicknullFires when the remove icon is clicked

Example

<spiderly-panel [toggleable]="true" [collapsed]="false">
  <ng-template #panelHeader>
    <span class="font-bold">Product Details</span>
  </ng-template>
  <ng-template #panelBody>
    <spiderly-textbox [control]="form.getControl('name')"></spiderly-textbox>
    <spiderly-number [control]="form.getControl('price')"></spiderly-number>
  </ng-template>
</spiderly-panel>

With CRUD Menu (SpiderlyFormArray)

Panels are commonly used with SpiderlyFormArray to render ordered lists with add/remove context menus:

<spiderly-panel
  *ngFor="let group of formArray.getFormGroups(); let i = index"
  [toggleable]="true"
  [crudMenu]="formArray.getCrudMenuForOrderedData()"
  [index]="i"
  (onMenuIconClick)="formArray.lastMenuIconIndexClicked = $event"
>
  <ng-template #panelBody>
    <spiderly-textbox [control]="group.getControl('name')"></spiderly-textbox>
  </ng-template>
</spiderly-panel>

SpiderlyCard

Selector: spiderly-card

Simple card container with an icon and title header.

Requires SpiderlyPanelsModule import.

InputTypeDefaultDescription
iconstring'pi pi-file-edit'PrimeIcons class for the card header
titlestringCard header title
<spiderly-card icon="pi pi-chart-bar" title="Sales Statistics">
  <!-- card content -->
</spiderly-card>

Buttons

All button components have a built-in 500ms click throttle to prevent double-submit.

spiderly-button

Selector: spiderly-button

Standard button. The most commonly used button component.

InputTypeDefaultDescription
labelstringButton label text
iconstringPrimeIcons class (e.g. 'pi pi-save')
severity'success' | 'info' | 'warn' | 'danger' | 'help' | 'primary' | 'secondary' | 'contrast'Button color
size'small' | 'large'Button size
outlinedbooleanfalseOutlined style
disabledbooleanfalseDisables the button
type'button' | 'submit' | 'reset''button'HTML button type
routerLinkstringIf provided, clicking navigates to this route instead of emitting onClick
OutputPayloadDescription
onClickEventFires (throttled) when clicked (only when no routerLink)
<spiderly-button
  label="Save"
  icon="pi pi-save"
  severity="success"
  (onClick)="save()"
></spiderly-button>

spiderly-split-button

Selector: spiderly-split-button

Button with a dropdown menu. Shares all inputs from spiderly-button except type.

InputTypeDefaultDescription
dropdownItemsMenuItem[]PrimeNG menu items for the dropdown
<spiderly-split-button
  label="Save"
  icon="pi pi-save"
  (onClick)="save()"
  [dropdownItems]="saveOptions"
></spiderly-split-button>
saveOptions: MenuItem[] = [
  { label: 'Save and Close', icon: 'pi pi-times', command: () => this.saveAndClose() },
  { label: 'Save as Draft', icon: 'pi pi-file', command: () => this.saveAsDraft() },
];

return-button

Selector: return-button

Back navigation button. Navigates to the parent route by default.

InputTypeDefaultDescription
navigateUrlstringExplicit URL to navigate to. If omitted, navigates to the parent route
<return-button></return-button>
<!-- or with explicit URL -->
<return-button navigateUrl="/product-list"></return-button>