UI components library for Payload CMS providing React components, hooks, forms, and styling for building admin interfaces and extensible UI elements.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Comprehensive set of UI components for building admin interfaces including buttons, modals, tables, navigation, data display, and specialized admin functionality.
Flexible button component with icon support and multiple appearances.
interface ButtonProps {
children?: React.ReactNode;
type?: 'button' | 'submit' | 'reset';
appearance?: 'primary' | 'secondary' | 'danger' | 'success' | 'default';
size?: 'small' | 'medium' | 'large';
icon?: React.ReactNode;
iconStyle?: 'with-label' | 'without-label';
disabled?: boolean;
onClick?: (event: React.MouseEvent) => void;
className?: string;
id?: string;
round?: boolean;
}
function Button(props: ButtonProps): JSX.Element;Usage example:
import { Button, PlusIcon } from '@payloadcms/ui';
function AddButton() {
return (
<Button
appearance="primary"
icon={<PlusIcon />}
onClick={() => handleAdd()}
>
Add Item
</Button>
);
}Container card component for grouping related content.
interface CardProps {
children: React.ReactNode;
className?: string;
id?: string;
buttonAriaLabel?: string;
onClick?: () => void;
actions?: React.ReactNode;
}
function Card(props: CardProps): JSX.Element;Modal dialog component with overlay and focus management.
interface ModalProps {
children: React.ReactNode;
className?: string;
slug?: string;
size?: 'small' | 'medium' | 'large' | 'full';
}
function Modal(props: ModalProps): JSX.Element;
function useModal(): {
openModal: (slug: string) => void;
closeModal: (slug: string) => void;
closeAllModals: () => void;
currentModal: string | null;
};Tooltip overlay component for providing contextual help.
interface TooltipProps {
children: React.ReactNode;
className?: string;
show?: boolean;
delay?: number;
position?: 'top' | 'bottom' | 'left' | 'right';
}
function Tooltip(props: TooltipProps): JSX.Element;Alert and notification banner component.
interface BannerProps {
children: React.ReactNode;
type?: 'success' | 'error' | 'warning' | 'info';
icon?: React.ReactNode;
className?: string;
}
function Banner(props: BannerProps): JSX.Element;Dropdown popup component for contextual actions.
interface PopupProps {
children: React.ReactNode;
className?: string;
button?: React.ReactNode;
buttonType?: 'default' | 'custom';
horizontalAlign?: 'left' | 'center' | 'right';
verticalAlign?: 'top' | 'bottom';
size?: 'small' | 'medium' | 'large' | 'fit-content';
color?: 'light' | 'dark';
initActive?: boolean;
onToggleOpen?: (active: boolean) => void;
}
function Popup(props: PopupProps): JSX.Element;Main application header component.
interface AppHeaderProps {
className?: string;
children?: React.ReactNode;
}
function AppHeader(props: AppHeaderProps): JSX.Element;Layout spacing component for consistent gutters.
interface GutterProps {
children: React.ReactNode;
className?: string;
left?: boolean;
right?: boolean;
}
function Gutter(props: GutterProps): JSX.Element;Expandable and collapsible container component.
interface CollapsibleProps {
children: React.ReactNode;
className?: string;
header?: React.ReactNode;
initCollapsed?: boolean;
onToggle?: (collapsed: boolean) => void;
}
function Collapsible(props: CollapsibleProps): JSX.Element;
function useCollapsible(): {
collapse: (id: string) => void;
expand: (id: string) => void;
toggle: (id: string) => void;
isCollapsed: (id: string) => boolean;
};Hamburger menu icon component.
interface HamburgerProps {
isActive?: boolean;
className?: string;
onClick?: () => void;
}
function Hamburger(props: HamburgerProps): JSX.Element;Navigation toggle button component.
interface NavTogglerProps {
className?: string;
children?: React.ReactNode;
}
function NavToggler(props: NavTogglerProps): JSX.Element;Data table component with sorting and pagination support.
interface TableProps {
columns: Column[];
data: Record<string, unknown>[];
className?: string;
appearance?: 'condensed' | 'default';
}
interface Column {
accessor: string;
components?: {
Heading?: React.ComponentType<any>;
renderCell?: (props: CellProps) => JSX.Element;
};
active?: boolean;
label?: string;
name?: string;
}
interface CellProps {
field: Column;
colIndex: number;
rowData: Record<string, unknown>;
cellData: unknown;
}
function Table(props: TableProps): JSX.Element;Default table cell renderer component.
interface DefaultCellProps {
field: Column;
colIndex: number;
rowData: Record<string, unknown>;
cellData: unknown;
}
function DefaultCell(props: DefaultCellProps): JSX.Element;Table and list pagination component.
interface PaginationProps {
limit: number;
totalPages: number;
page: number;
hasPrevPage: boolean;
hasNextPage: boolean;
prevPage?: number;
nextPage?: number;
pagingCounter: number;
totalDocs: number;
onChange?: (page: number) => void;
}
function Pagination(props: PaginationProps): JSX.Element;Items per page selector component.
interface PerPageProps {
limit: number;
limits: number[];
modifySearchParams?: boolean;
onChange?: (limit: number) => void;
}
function PerPage(props: PerPageProps): JSX.Element;List view controls for search and filtering.
interface ListControlsProps {
children?: React.ReactNode;
className?: string;
}
function ListControls(props: ListControlsProps): JSX.Element;Enhanced select component based on react-select.
interface ReactSelectProps {
value?: Option | Option[];
options: Option[];
onChange?: (value: Option | Option[] | null) => void;
onInputChange?: (value: string) => void;
placeholder?: string;
isDisabled?: boolean;
isMulti?: boolean;
isClearable?: boolean;
isSearchable?: boolean;
filterOption?: (option: Option, inputValue: string) => boolean;
className?: string;
}
interface Option {
label: string;
value: string | number;
disabled?: boolean;
}
function ReactSelect(props: ReactSelectProps): JSX.Element;
const Select = ReactSelect; // AliasDate and time selection component.
interface DatePickerProps {
value?: Date;
onChange?: (date: Date | null) => void;
displayFormat?: string;
pickerAppearance?: 'default' | 'dayOnly' | 'timeOnly' | 'dayAndTime';
placeholder?: string;
readOnly?: boolean;
showTimeSelect?: boolean;
timeFormat?: string;
timeIntervals?: number;
minDate?: Date;
maxDate?: Date;
}
function DatePicker(props: DatePickerProps): JSX.Element;Search input component with filtering capabilities.
interface SearchFilterProps {
fieldName?: string;
fieldLabel?: string;
modifySearchQuery?: boolean;
onChange?: (value: string) => void;
placeholder?: string;
handleChange?: (value: string) => void;
}
function SearchFilter(props: SearchFilterProps): JSX.Element;Pill-based selection component for multiple choices.
interface PillSelectorProps {
selected?: SelectablePill[];
pills: SelectablePill[];
onSelect?: (pill: SelectablePill) => void;
onDeselect?: (pill: SelectablePill) => void;
className?: string;
}
interface SelectablePill {
label: string;
value: string;
selected?: boolean;
}
function PillSelector(props: PillSelectorProps): JSX.Element;Document action controls component.
interface DocumentControlsProps {
collection?: string;
global?: string;
id?: string | number;
data?: Record<string, unknown>;
hasPublishPermission?: boolean;
hasSavePermission?: boolean;
apiURL?: string;
action?: string;
isEditing?: boolean;
}
function DocumentControls(props: DocumentControlsProps): JSX.Element;Component for rendering document fields.
interface DocumentFieldsProps {
BeforeFields?: React.ComponentType<any>;
AfterFields?: React.ComponentType<any>;
fields: FieldConfig[];
readOnly?: boolean;
permissions?: Record<string, unknown>;
}
function DocumentFields(props: DocumentFieldsProps): JSX.Element;Slide-out document editor drawer.
interface DocumentDrawerProps {
slug?: string;
children?: React.ReactNode;
className?: string;
}
function useDocumentDrawer(): UseDocumentDrawer;
interface UseDocumentDrawer {
openDrawer: (slug: string) => void;
closeDrawer: (slug: string) => void;
toggleDrawer: (slug: string) => void;
isDrawerOpen: (slug: string) => boolean;
}
interface DocumentTogglerProps {
children: React.ReactNode;
className?: string;
disabled?: boolean;
drawerSlug: string;
}Locked document indicator component.
interface DocumentLockedProps {
className?: string;
user?: {
id: string;
email: string;
};
}
function DocumentLocked(props: DocumentLockedProps): JSX.Element;Document takeover dialog component.
interface DocumentTakeOverProps {
className?: string;
onTakeOver?: () => void;
}
function DocumentTakeOver(props: DocumentTakeOverProps): JSX.Element;File upload component with drag-and-drop support.
interface UploadProps {
className?: string;
relationTo: string;
value?: UploadValue;
onChange?: (value: UploadValue | null) => void;
disabled?: boolean;
}
interface UploadValue {
id: string;
filename: string;
mimeType: string;
filesize: number;
width?: number;
height?: number;
url?: string;
}
function Upload(props: UploadProps): JSX.Element;Drag-and-drop upload area component.
interface DropzoneProps {
className?: string;
accept?: string[];
maxFiles?: number;
onDrop?: (files: File[]) => void;
disabled?: boolean;
children?: React.ReactNode;
}
function Dropzone(props: DropzoneProps): JSX.Element;Image thumbnail display component.
interface ThumbnailProps {
className?: string;
src?: string;
alt?: string;
size?: 'small' | 'medium' | 'large';
fit?: 'crop' | 'contain' | 'cover';
}
function Thumbnail(props: ThumbnailProps): JSX.Element;File information display component.
interface FileDetailsProps {
file: {
filename: string;
mimeType: string;
filesize: number;
width?: number;
height?: number;
};
className?: string;
}
function FileDetails(props: FileDetailsProps): JSX.Element;Image size previews component.
interface PreviewSizesProps {
sizes?: ImageSize[];
className?: string;
}
interface ImageSize {
name: string;
width: number;
height: number;
url: string;
}
function PreviewSizes(props: PreviewSizesProps): JSX.Element;Document save button component.
interface SaveButtonProps {
className?: string;
disabled?: boolean;
processing?: boolean;
}
function SaveButton(props: SaveButtonProps): JSX.Element;Save draft button component.
interface SaveDraftButtonProps {
className?: string;
disabled?: boolean;
processing?: boolean;
}
function SaveDraftButton(props: SaveDraftButtonProps): JSX.Element;Publish document button component.
interface PublishButtonProps {
className?: string;
disabled?: boolean;
processing?: boolean;
}
function PublishButton(props: PublishButtonProps): JSX.Element;Bulk delete action component.
interface DeleteManyProps {
className?: string;
collection: string;
resetParams?: boolean;
}
function DeleteMany(props: DeleteManyProps): JSX.Element;Bulk publish action component.
interface PublishManyProps {
className?: string;
collection: string;
resetParams?: boolean;
}
function PublishMany(props: PublishManyProps): JSX.Element;Bulk edit action component.
interface EditManyProps {
className?: string;
collection: string;
resetParams?: boolean;
}
function EditMany(props: EditManyProps): JSX.Element;Status and tag pill component.
interface PillProps {
children: React.ReactNode;
className?: string;
backgroundColor?: string;
color?: string;
to?: string;
onClick?: () => void;
}
function Pill(props: PillProps): JSX.Element;Error status indicator component.
interface ErrorPillProps {
className?: string;
message?: string;
withMessage?: boolean;
}
function ErrorPill(props: ErrorPillProps): JSX.Element;Loading state indicators and overlays.
function LoadingOverlay(props: { className?: string }): JSX.Element;
function LoadingOverlayToggle(props: { className?: string; show?: boolean }): JSX.Element;
function FormLoadingOverlayToggle(props: { className?: string }): JSX.Element;Loading shimmer animation component.
interface ShimmerEffectProps {
className?: string;
height?: number;
width?: number;
}
function ShimmerEffect(props: ShimmerEffectProps): JSX.Element;
function StaggeredShimmers(props: { className?: string; count?: number }): JSX.Element;Height animation wrapper component.
interface AnimateHeightProps {
children: React.ReactNode;
className?: string;
height?: number | 'auto';
duration?: number;
}
function AnimateHeight(props: AnimateHeightProps): JSX.Element;Toast notification system using Sonner.
interface ToastOptions {
description?: string;
action?: {
label: string;
onClick: () => void;
};
duration?: number;
position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
}
const toast: {
success: (message: string, options?: ToastOptions) => void;
error: (message: string, options?: ToastOptions) => void;
warning: (message: string, options?: ToastOptions) => void;
info: (message: string, options?: ToastOptions) => void;
loading: (message: string, options?: ToastOptions) => void;
dismiss: (id?: string) => void;
};Usage example:
import { toast } from '@payloadcms/ui';
function handleSave() {
const loadingId = toast.loading('Saving document...');
try {
await saveDocument();
toast.dismiss(loadingId);
toast.success('Document saved successfully!');
} catch (error) {
toast.dismiss(loadingId);
toast.error('Failed to save document');
}
}View components for pre-built list and edit interfaces in Payload admin.
Standard collection list view component.
interface DefaultListViewProps {
collection: string;
className?: string;
}
function DefaultListView(props: DefaultListViewProps): JSX.Element;Standard document editor view component.
interface DefaultEditViewProps {
collection?: string;
global?: string;
id?: string | number;
className?: string;
}
function DefaultEditView(props: DefaultEditViewProps): JSX.Element;Document navigation steps component for multi-step editing.
interface SetDocumentStepNavProps {
steps: StepNavItem[];
currentStep: number;
}
interface StepNavItem {
label: string;
path: string;
completed?: boolean;
}
function SetDocumentStepNav(props: SetDocumentStepNavProps): JSX.Element;Document title management component.
interface SetDocumentTitleProps {
title?: string;
fallback?: string;
}
function SetDocumentTitle(props: SetDocumentTitleProps): JSX.Element;List view header with controls and actions.
interface ListHeaderProps {
collection: string;
hasCreatePermission?: boolean;
newDocumentURL?: string;
}
function ListHeader(props: ListHeaderProps): JSX.Element;
const CollectionListHeader = ListHeader; // AliasGrouping header controls for list views.
interface GroupByHeaderProps {
collection: string;
groupBy?: string;
onGroupByChange?: (field: string) => void;
}
function GroupByHeader(props: GroupByHeaderProps): JSX.Element;Multi-select controls for list views.
interface ListSelectionProps {
children?: React.ReactNode;
}
function ListSelection(props: ListSelectionProps): JSX.Element;Brand graphics and visual elements for Payload admin interfaces.
Payload logo icon component.
interface PayloadIconProps {
className?: string;
size?: number | string;
style?: React.CSSProperties;
}
function PayloadIcon(props: PayloadIconProps): JSX.Element;Full Payload logo component.
interface PayloadLogoProps {
className?: string;
size?: number | string;
style?: React.CSSProperties;
}
function PayloadLogo(props: PayloadLogoProps): JSX.Element;User account graphic component.
interface AccountProps {
className?: string;
size?: number | string;
}
function Account(props: AccountProps): JSX.Element;Default block placeholder image.
interface DefaultBlockImageProps {
className?: string;
}
function DefaultBlockImage(props: DefaultBlockImageProps): JSX.Element;File representation graphic component.
interface FileProps {
className?: string;
size?: number | string;
}
function File(props: FileProps): JSX.Element;Static assets available from the /assets export for favicons and images.
const payloadFavicon: string; // SVG favicon
const payloadFaviconDark: string; // Dark mode PNG favicon
const payloadFaviconLight: string; // Light mode PNG favicon
const staticOGImage: string; // Open Graph image PNGUsage example:
import {
payloadFavicon,
payloadFaviconDark,
staticOGImage
} from '@payloadcms/ui/assets';
function AppHead() {
return (
<head>
<link rel="icon" href={payloadFavicon} />
<meta property="og:image" content={staticOGImage} />
</head>
);
}interface ImageSize {
name: string;
width: number;
height: number;
url: string;
}
interface FieldConfig {
type: string;
name: string;
label?: string;
required?: boolean;
admin?: Record<string, unknown>;
}
interface StepNavItem {
label: string;
path: string;
completed?: boolean;
}Install with Tessl CLI
npx tessl i tessl/npm-payloadcms--ui