@taktdev/components
v1.0.1
Published
WordPress Gutenberg components to be used on themes
Readme
Takt WordPress Components
A collection of reusable React components for building custom Gutenberg authoring experiences as part of Takt's WordPress ensemble. These components are designed to streamline editor development and provide advanced UI features for block and panel creation.
Components Overview
Below is a brief description of each component included in this package:
AdvancedRichText
An enhanced RichText component for Gutenberg blocks, supporting custom formatting, tag filtering, and optional line break disabling.
Props:
value(required): stringonChange(required): functionallowedFormats(optional): string[]disableLineBreaks(optional): boolean- ...all
RichTextProps from@wordpress/block-editor
Appender
A wrapper for the default Gutenberg block appender, allowing for custom styling and positioning when adding new blocks.
Props:
className(optional): stringclientId(optional): stringstyle(optional): object
Button
A flexible button component with support for different variations (primary, secondary, tertiary), link integration, and advanced controls for editing button properties in the editor.
Props:
link(optional): { title, url, postId?, postType?, opensInNewTab?, label? }className(optional): stringonChange(optional): functionplaceholder(optional): stringfocusOnMount(optional): string | booleanvariation(optional): 'primary' | 'secondary' | 'tertiary'allowVariationChange(optional): booleanbefore(optional): ReactNodeafter(optional): ReactNodevalidateLink(optional): booleanautoUpdateLink(optional): booleanmergeRef(optional): boolean- ...all anchor element attributes except
onChange
FilteredServerSideRender
A server-side render component with additional filtering and query options, useful for rendering dynamic block previews with custom query selectors and attributes.
Props:
block(optional): stringattributes(optional): objecturlQueryArgs(optional): objecthttpMethod(optional): 'GET' | 'POST'url(optional): stringEmptyResponsePlaceholder(optional): React.ComponentType | nullLoadingResponsePlaceholder(optional): React.ComponentType | nullquerySelector(optional): stringclientId(optional): stringclassName(optional): stringserverSideRenderRef(optional): anypreventInteraction(optional): boolean
ImageDropUploader
A drag-and-drop image uploader for Gutenberg, supporting image selection, upload, and focal point editing.
Props:
image(optional): ImageProps | numberonSelect(optional): functionallowedTypes(optional): string[]className(optional): stringimageClassName(optional): stringimageStyle(optional): objectplaceholderClassName(optional): string
ImageOrInlineSvg
Displays an image by ID or attachment, with special handling for inline SVGs (fetches and injects SVG markup for SVG images).
Props:
imageId(optional): numberattachment(optional): Attachment- ...all standard
<img>attributes
Link
A link component with advanced controls for editing link properties, including support for post links, new tab toggling, and custom labels.
Props:
children(optional): ReactNodebefore(optional): ReactNodeafter(optional): ReactNodelink(optional): { title, url, postId?, postType?, opensInNewTab?, label? }className(optional): stringtitleClassName(optional): stringonChange(optional): functiontagName(optional): stringallowedFormats(optional): []placeholder(optional): stringanchor(optional): HTMLElementfocusOnMount(optional): string | booleanvalidateLink(optional): booleanautoUpdateLink(optional): booleanopenPopupOnClick(optional): booleanpopupVisible(optional): booleanshowPopupTitleField(optional): boolean
MediaUploadPanel
A media upload panel with optional focal point picker, designed for selecting and editing images or other media within block controls.
Props:
media(optional): ImageProps | numberlabel(optional): stringonSelect(optional): functionallowedTypes(optional): string[]enableFocalPoint(optional): boolean
MultiLineRichText
A multi-line RichText input that parses and manages multiple items, useful for lists or repeatable text fields in blocks.
Props:
value(required): stringonChange(required): functionclassName(optional): stringitemClassName(optional): stringwrapperTag(optional): string (JSX tag)itemTag(optional): string (JSX tag)allowedFormats(optional): string[]placeholder(optional): stringalwaysShowPlaceholder(optional): boolean
PopoverExternalLink
A popover input for external links, phone numbers, or emails, with protocol handling and inline editing UI.
Props:
children(optional): ReactNodevalue(optional): stringonChange(optional): functionlabel(optional): stringplaceholder(optional): stringclassName(optional): stringtype(optional): 'link' | 'phone' | 'email'includeProtocol(optional): boolean
PostSelectorSortable
A sortable post selector component for choosing and reordering posts of any type, with support for thumbnails and custom limits.
Props:
value(required): number[] | numberonChange(required): functionpostTypes(optional): string[]limit(optional): number | stringtitle(optional): stringonDocumentPanel(optional): booleanforceReturnAsArray(optional): booleandisplayThumbnails(optional): boolean
TaxonomySelect
A taxonomy selector with multi-select and sorting, allowing users to pick and order taxonomy terms (categories, tags, etc.) in the editor.
Props:
title(optional): stringvalue(required): number[]taxonomy(optional): stringonChange(optional): functionselectedFirst(optional): booleandisplaySearch(optional): booleanlimitHeight(optional): booleanHierarchical(optional): boolean
For detailed usage and props, see the source code for each component in the src/ directory.
