/
Documentation

Components List

All 37 pre-styled components available in @syncbooks/addon-sdk/components.

Import: import { ComponentName } from '@syncbooks/addon-sdk/components'

Form Components

ComponentDescription
ButtonPrimary action button with variants (default, outline, ghost, destructive, link) and sizes (sm, md, lg). Supports loading state.
InputText input with label, placeholder, and error message support.
TextareaMulti-line text input with label and error support.
SelectDropdown select with options array, placeholder, and error.
CheckboxCheckbox input with label.
SwitchToggle switch with label. Controlled component.
RadioGroupRadio button group with options, horizontal/vertical layout.
SearchInputSearch input with built-in debounce (300ms default), search icon.
CurrencyInputNumber input formatted as currency with symbol prefix (GH₵).
DateInputNative date picker with label and error support.
FileInputDrag-and-drop file upload with click-to-browse fallback, file type/size validation.

Smart Components

ComponentDescription
ResourcePickerSearchable dropdown that fetches records from SyncBooks API. Works with customers, products, invoices, vendors, employees, projects.
PermissionGateConditionally renders children based on granted scopes. Supports single scope, array of scopes, and fallback UI.
FormDeclarative form with validation, loading state, submit error handling. Render props pattern.

Layout Components

ComponentDescription
PageLayoutStandard page structure with title, description, actions slot, breadcrumb, and footer.
CardContainer with border and shadow. Sub-components: CardHeader, CardTitle, CardDescription, CardContent, CardFooter.
TabsTab navigation with content panels. Accepts array of { id, label, content } objects.
DividerHorizontal rule with optional centered text.
DrawerSlide-in panel (left or right) with header, scrollable content, and footer. Closes on Escape or backdrop click.

Data Components

ComponentDescription
DataTableFull-featured table with columns, search, pagination, loading skeleton, empty state, row click handler. The most-used component.
TableBasic table with sub-components: TableHeader, TableBody, TableRow, TableHead, TableCell.
List / ListItemStyled list with icon, title, subtitle, and action slot per item.
StatCardMetric card showing label, value, optional trend percentage, and subtext.
BadgeInline label with variants: default, success, warning, error, outline.
StatusBadgePre-colored badge for common statuses (draft, sent, paid, overdue, active, cancelled, etc.).
AvatarUser avatar — shows image or generates initials fallback. Sizes: sm, md, lg.
ProgressProgress bar with label, percentage, color variants, and sizes.
PaginationPrevious/Next page controls with current page display.

Feedback Components

ComponentDescription
AlertBanner with variants: info (blue), success (green), warning (amber), error (red). Optional title.
SpinnerAnimated loading spinner. Sizes: sm, md, lg.
Skeleton / SkeletonRow / SkeletonCardAnimated placeholder for loading states. Pre-made variants for table rows and cards.
EmptyStateCentered placeholder for empty data — icon, title, description, action button.
ErrorBoundaryCatches JavaScript errors in children and shows fallback UI with retry button.
LoadingOverlayFull-screen semi-transparent loading indicator with message.
TooltipHover tooltip with configurable position (top, bottom, left, right).

Overlay Components

ComponentDescription
DialogModal dialog with sub-components: DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter.
ConfirmDialogPre-built confirmation modal for destructive actions. Props: title, description, confirmLabel, variant, loading.

For detailed usage examples of each component, see UI Components guide.