Repository navigation
Blocks Text Path
Block name: designsetgo/text-path
Version: 1.0.0
Category: DesignSetGo
Keywords: text, svg, path, curve
The Text Path Block flows a line of text along an SVG path — a wave, arc, circle, oval, spiral, or a custom SVG path you upload. It is a static block (saved markup, not server-rendered), with an optional gentle scrolling animation along the path.
Key Features:
- Six built-in path shapes, plus custom SVG path upload (validated server-side)
- Adjustable font size, rotation, start offset, word spacing, and padding away from the path
- Optional visible guide line, with its own color/opacity/thickness
- Optional looping motion animation, forward or reverse, that respects
prefers-reduced-motion - Optional link wrapping the whole graphic
- LTR/RTL text direction
- Insert the Text Path block.
- Type your text in the Text field (Settings panel).
- Choose a Path shape — Wave, Arc, Circle, Line, Oval, Spiral, or Custom SVG.
- Adjust Font size, Rotation, and other Style controls until the text sits where you want it on the path.
- Optionally turn on Show path while positioning text, then turn it off before publishing.
-
Text: the string drawn on the path (
text, default"Text on a path"). -
Path: Wave, Arc, Circle, Line, Oval, Spiral, or Custom SVG (
pathType, defaultwave). Choosing Custom SVG reveals a Choose SVG path upload button.-
Arc size (Arc only): 0 (flat) to 100 (full curve) (
arcSize, default100).
-
Arc size (Arc only): 0 (flat) to 100 (full curve) (
-
Show path: draws the underlying path as a visible guide line, useful while positioning text (
showPath, defaultfalse). -
Direction: Left to right / Right to left (
direction, defaultltr) — sets the SVG<text>element'sdirection. -
Link: an optional URL (
url) wraps the whole graphic in an<a>; a nested Open in new tab toggle setstarget(target, defaultfalse).
-
Font size: 1–400px (
pathFontSize, default54). -
Rotation: -180° to 180° in the inspector; clamped to -360°–360° at render (
rotation, default0). -
Start offset: -100 to 100 (
startOffset, default0) — where along the path the text begins, as a percentage of path length. -
Word spacing: -40 to 100 (
wordSpacing, default0). -
Path padding: -200 to 200 (
pathPadding, default0) — moves text perpendicular to the path (adyoffset); negative moves the opposite direction. -
Path width: 25–100% (
pathWidth, default100) — scales the rendered graphic's width. -
Path alignment: Left / Center / Right (
pathAlignment, defaultleft) — horizontal position of the graphic within the block. -
Guide opacity / Guide line thickness (shown only when Show path is on): 0–1 (
guideOpacity, default0.35) and 0–24px (guideStrokeWidth, default2). -
Animate text: enables looping motion along the path (
motion, defaultfalse), revealing:-
Motion duration: 2–120 seconds (
motionDuration, default12). -
Motion direction: Forward / Reverse (
motionDirection, defaultforward).
-
Motion duration: 2–120 seconds (
A Path colors dropdown in the sidebar's Color panel exposes Guide line color (guideColor) always, and Circle background color (circleBackgroundColor) only when Path is set to Circle — it fills the circle behind the text.
Anchor; text color; spacing (margin, padding); typography (font size, line height, font family, font weight, letter spacing).
Uploading a custom SVG sends the file to POST /designsetgo/v1/text-path/extract (requires upload_files), which parses it server-side with DOMDocument and returns only a viewBox and a single <path> d string — never the original markup. The parser rejects:
- Files over 12 KB, or documents containing a DOCTYPE or entity declaration
- Any
<script>or<foreignObject>element anywhere in the document - A missing or non-positive
viewBox - Path data using any command outside
M L H V C S Q T A Z(upper or lower case), or malformed argument counts/separators
The first path element in the document that passes validation is used; everything else in the file is discarded. See REST-API-REFERENCE.md for the endpoint reference.
When Animate text is on, the frontend view script (view.js) scrolls the text along the path continuously:
- Motion pauses automatically when the browser tab is hidden (
visibilitychange) and resumes when it becomes visible again. - Motion never starts at all when the visitor's OS/browser reports
prefers-reduced-motion: reduce. - On a closed path (e.g. Circle), the text loops continuously. On an open path (e.g. Wave, Line), the motion bounces back and forth between the path's ends rather than jumping.
- The editor previews the same animation on canvas (via the shared
motion.jsmodule) so the Animate toggle isn't a "trust me" setting.
- The SVG has
role="img"witharia-labelset to the block's text, so screen readers get the text content directly rather than trying to parse the path/text elements. - Motion honors
prefers-reduced-motion: reduce(see above) — no separate toggle is needed for vestibular-disorder accessibility. - A decorative Show path guide line should generally be turned off before publishing unless it's part of the design.
-
Icon (
designsetgo/icon) — see ICON.md for the plugin's icon library, used elsewhere for icon-based graphics.
- Static block: markup is produced by
save.js/edit.jsfrom the sharedTextPathGraphiccomponent and stored in post content; there is norender.php. -
uniqueIdis auto-generated per block instance (useUniqueBlockId) and de-duplicated on paste/duplicate — a duplicate ID found elsewhere in the editor is cleared automatically, since the ID becomes the SVG<path>element'sidand a collision would make two blocks'<textPath>references point at the same path. - The
relattribute is defined inblock.jsonand exposed in the inspector's reset behavior, butsave.jsalways writes a hardcodedrel="noopener noreferrer"on the link regardless of its value — the attribute is not currently read anywhere. - Path presets (
wave,arc,circle,line,oval,spiral) and the client-side SVG-path validator live insrc/utils/svg-paths.js, shared between this block and the custom-upload flow. - Has a deprecation (
deprecated.js) for a pre-motion markup version. - Covered by
src/blocks/text-path/test/block.test.js,save.test.js, andview.test.js.
Auto-generated from
docs/blocks/TEXT-PATH.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2