Skip to content

Dotquilt API reference

Copy page

Every Dotquilt element with its attributes, properties, methods, events, slots, CSS parts and CSS custom properties, and the names the React, Vue, Svelte and Angular components give them. Set an option as an attribute in HTML, as a property from script, as a prop of a framework component, or several at once with update().

This page is generated from the description of the elements that the dotquilt package also ships as custom-elements.json and web-types.json, which editors read for autocomplete; a test checks that description against the running elements.

Element Class and component Import
<dotquilt-skeleton-block> SkeletonBlock registerSkeletonBlock from dotquilt/skeleton
<dotquilt-skeleton-line> SkeletonLine registerSkeletonLine from dotquilt/skeleton
<dotquilt-skeleton-circle> SkeletonCircle registerSkeletonCircle from dotquilt/skeleton
<dotquilt-skeleton-text> SkeletonText registerSkeletonText from dotquilt/skeleton
<dotquilt-typing-dots> TypingDots registerTypingDots from dotquilt/typing
<dotquilt-text-loader> TextLoader registerTextLoader from dotquilt/text
<dotquilt-chart-loader> ChartLoader registerChartLoader from dotquilt/chart
<dotquilt-table-loader> TableLoader registerTableLoader from dotquilt/table
<dotquilt-region> LoadingRegion registerLoadingRegion from dotquilt/region

Each element has a component of the same name in @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Its props are the element’s properties, with the same names, and Angular’s components use the element’s tag as their selector. The events become:

Event React Vue Svelte Angular
dotquilt-handoff-start onHandoffStart @handoff-start onHandoffStart (handoffStart)
dotquilt-handoff-end onHandoffEnd @handoff-end onHandoffEnd (handoffEnd)
dotquilt-handoff-cancel onHandoffCancel @handoff-cancel onHandoffCancel (handoffCancel)
dotquilt-error onLoaderError @loader-error onLoaderError (loaderError)

Each event is a CustomEvent. Import the types of its detail from dotquilt.

Sent with dotquilt-handoff-start, dotquilt-handoff-end and dotquilt-handoff-cancel.

Field Type Description
cycle string | undefined The cycle the handoff belongs to, if one was set.
handoffId number Counts the element’s handoffs. The start, end and cancel events of one handoff carry the same number.
animation string The handoff animation’s id, such as dotquilt/morph.
reason? string On dotquilt-handoff-end and dotquilt-handoff-cancel: complete when the animation ran to the end, otherwise why it stopped, such as immediate, restricted or superseded.

Sent with dotquilt-error.

Field Type Description
code string What went wrong, such as unknown-option, invalid-preset or animation-failed.
field string The option it concerns, such as speed or animations, or registration.

A rectangle of marks for images, charts and other blocks. On handoff the marks travel to the content’s real shape.

  • Tag: <dotquilt-skeleton-block>
  • Import: registerSkeletonBlock from dotquilt/skeleton; call it once to define the element.
  • Components: SkeletonBlock from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-skeleton-block.
  • Props: motion, mark, speed, pointerResponse, stylePolicy, preset and animations: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: Skeleton
Property Attribute Type Default Description
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the idle motion runs, from above 0 up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset SkeletonPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'skeleton'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: motion, mark, speed, pointerResponse, stylePolicy, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-skeleton-block::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.
--dotquilt-radius .375rem The block’s corners.

One line of text, drawn in marks.

  • Tag: <dotquilt-skeleton-line>
  • Import: registerSkeletonLine from dotquilt/skeleton; call it once to define the element.
  • Components: SkeletonLine from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-skeleton-line.
  • Props: motion, mark, speed, pointerResponse, stylePolicy, preset and animations: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: Skeleton
Property Attribute Type Default Description
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the idle motion runs, from above 0 up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset SkeletonPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'skeleton'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: motion, mark, speed, pointerResponse, stylePolicy, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-skeleton-line::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.
--dotquilt-radius .375rem The block’s corners.

A circle of marks for avatars and icons.

  • Tag: <dotquilt-skeleton-circle>
  • Import: registerSkeletonCircle from dotquilt/skeleton; call it once to define the element.
  • Components: SkeletonCircle from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-skeleton-circle.
  • Props: motion, mark, speed, pointerResponse, stylePolicy, preset and animations: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: Skeleton
Property Attribute Type Default Description
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the idle motion runs, from above 0 up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset SkeletonPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'skeleton'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: motion, mark, speed, pointerResponse, stylePolicy, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-skeleton-circle::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.
--dotquilt-radius .375rem The block’s corners.

A paragraph of lines, drawn in marks.

  • Tag: <dotquilt-skeleton-text>
  • Import: registerSkeletonText from dotquilt/skeleton; call it once to define the element.
  • Components: SkeletonText from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-skeleton-text.
  • Props: motion, mark, speed, pointerResponse, stylePolicy, preset, animations, lines and widths: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: Skeleton
Property Attribute Type Default Description
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the idle motion runs, from above 0 up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset SkeletonPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'skeleton'> The idle and handoff animations, built-in or from defineAnimation().
lines lines number 3 How many lines, up to 50.
widths readonly number[] Each line’s length as a share of the width, from above 0 to 1. The last line is shorter by default.
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: motion, mark, speed, pointerResponse, stylePolicy, preset, animations, lines and widths.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-skeleton-text::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.
--dotquilt-radius .375rem The block’s corners.

A row of dots in a slow wave, for a reply being written. Hidden from assistive technology; announce the status yourself.

  • Tag: <dotquilt-typing-dots>
  • Import: registerTypingDots from dotquilt/typing; call it once to define the element.
  • Components: TypingDots from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-typing-dots.
  • Props: motion, mark, speed, count, stylePolicy and preset: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: TypingDots
Property Attribute Type Default Description
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the wave moves, up to 4.
count count number 3 How many dots, up to 8.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset TypingPreset A named bundle of options from definePreset(). Explicit options win over it.
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: motion, mark, speed, count, stylePolicy and preset.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-typing-dots::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 8px Each dot’s diameter.
--dotquilt-dot-gap 6px The space between dots.

A value in the making: scrambling characters in marks that lock into the real text when it arrives.

  • Tag: <dotquilt-text-loader>
  • Import: registerTextLoader from dotquilt/text; call it once to define the element.
  • Components: TextLoader from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-text-loader.
  • Props: state, cycle, delay, minDisplay, timing, motion, stylePolicy, mask, mark, speed, pointerResponse, preset and animations: the same names in React, Vue, Svelte and Angular. revealTargets is set on the element only.
  • Events: onHandoffStart, onHandoffEnd, onHandoffCancel and onLoaderError in React and Svelte; @handoff-start, @handoff-end, @handoff-cancel and @loader-error in Vue; (handoffStart), (handoffEnd), (handoffCancel) and (loaderError) in Angular.
  • Guide: TextLoader
Property Attribute Type Default Description
state state 'pending' | 'refreshing' | 'ready' 'ready' Whether the content is loading: pending shows the placeholder, refreshing keeps the content usable with a quiet cue, ready hands over.
cycle cycle string Names one load, so a stale answer can’t settle a newer one.
delay delay number 0 Milliseconds to wait before showing the placeholder, so fast loads don’t flicker. Up to 10000.
minDisplay min-display number 0 Once a placeholder shows, keep it at least this many milliseconds, so it never flashes. Up to 10000.
timing Timing The handoff’s length and curve. { duration: 0 } swaps at once, for errors.
revealTargets readonly RevealTarget[] Parts of the content that settle in turn under a custom handoff, or a TableLoader with a targetProvider. Set it on the element: the framework components have no such prop.
presentation 'pending' | 'refreshing' | 'ready' | 'handoff' Read-only. What is on screen right now, including a handoff in progress.
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
mask mask string The shape the placeholder shows. Defaults to the text itself.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the characters change, up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
preset TextPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'text'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: state, cycle, delay, minDisplay, timing, revealTargets, motion, stylePolicy, mask, mark, speed, pointerResponse, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-handoff-start HandoffDetail The handoff from the placeholder to the content begins.
dotquilt-handoff-end HandoffDetail The handoff finished. detail.reason is complete, or why it swapped at once.
dotquilt-handoff-cancel HandoffDetail A newer state or cycle replaced the handoff.
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.
Slot Holds React Vue Svelte Angular
(default) The real text. children default slot children content
placeholder Server-rendered mask markup; the element draws its own placeholder once styled. filled from mask filled from mask filled from mask filled from mask
refresh-indicator Your own cue while refreshing. not offered not offered not offered not offered

Style them with dotquilt-text-loader::part(content).

Part Description
content The layer holding the real text.
placeholder The placeholder layer.
refresh-indicator The refresh cue layer.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.

A field of marks that takes the shape of a chart, then hands over to the real one.

  • Tag: <dotquilt-chart-loader>
  • Import: registerChartLoader from dotquilt/chart; call it once to define the element.
  • Components: ChartLoader from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-chart-loader.
  • Props: variant, targetProvider, motion, mark, speed, pointerResponse, stylePolicy, preset and animations: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: ChartLoader
Property Attribute Type Default Description
variant variant 'line' | 'bar' | 'scatter' 'line' The kind of chart it stands in for.
targetProvider TargetProvider Where the real chart is, for the handoff.
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the ridge and glow move, up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset ChartPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'chart'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: variant, targetProvider, motion, mark, speed, pointerResponse, stylePolicy, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-chart-loader::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.

Rows of marks shaped like your columns, that gather into each cell’s real text on handoff.

  • Tag: <dotquilt-table-loader>
  • Import: registerTableLoader from dotquilt/table; call it once to define the element.
  • Components: TableLoader from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-table-loader.
  • Props: rows, rowHeight, columns, targetProvider, motion, mark, speed, pointerResponse, stylePolicy, preset and animations: the same names in React, Vue, Svelte and Angular.
  • Events: onLoaderError in React and Svelte; @loader-error in Vue; (loaderError) in Angular.
  • Guide: TableLoader
Property Attribute Type Default Description
rows rows number 5 How many rows to show, up to 100.
rowHeight row-height number 32 Row height in pixels.
columns readonly TableColumn[] What each column holds (text, number, badge or date) and its share of the width. Up to 20; three text columns by default.
targetProvider TableTargetProvider Where the real cells are, for the rows handoff.
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills the marks.
mark mark 'dot' | 'dash' | 'square' 'dot' The shape of each mark. Dashes suit text lines and table rows; squares stay crisp at small sizes.
speed speed number 1 How fast the glow moves, up to 4.
pointerResponse pointer-response 'none' | 'lift' 'none' lift lights the marks around the pointer while the placeholder shows, on devices with a fine pointer.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset TablePreset A named bundle of options from definePreset(). Explicit options win over it.
animations Animations<'table'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: rows, rowHeight, columns, targetProvider, motion, mark, speed, pointerResponse, stylePolicy, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.

Style them with dotquilt-table-loader::part(surface).

Part Description
surface The drawn marks.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.

Wraps content that loads: shows its placeholder while pending, keeps the content inert and hidden from assistive technology, then hands over to it.

  • Tag: <dotquilt-region>
  • Import: registerLoadingRegion from dotquilt/region; call it once to define the element.
  • Components: LoadingRegion from @dotquilt/react, @dotquilt/vue, @dotquilt/svelte and @dotquilt/angular. Angular’s selector is dotquilt-region.
  • Props: state, cycle, delay, minDisplay, timing, revealTargets, motion, stylePolicy, preset and animations: the same names in React, Vue, Svelte and Angular.
  • Events: onHandoffStart, onHandoffEnd, onHandoffCancel and onLoaderError in React and Svelte; @handoff-start, @handoff-end, @handoff-cancel and @loader-error in Vue; (handoffStart), (handoffEnd), (handoffCancel) and (loaderError) in Angular.
  • Guide: LoadingRegion
Property Attribute Type Default Description
state state 'pending' | 'refreshing' | 'ready' 'ready' Whether the content is loading: pending shows the placeholder, refreshing keeps the content usable with a quiet cue, ready hands over.
cycle cycle string Names one load, so a stale answer can’t settle a newer one.
delay delay number 0 Milliseconds to wait before showing the placeholder, so fast loads don’t flicker. Up to 10000.
minDisplay min-display number 0 Once a placeholder shows, keep it at least this many milliseconds, so it never flashes. Up to 10000.
timing Timing The handoff’s length and curve. { duration: 0 } swaps at once, for errors.
revealTargets readonly RevealTarget[] Parts of the content that settle in turn under a custom handoff, or a TableLoader with a targetProvider.
presentation 'pending' | 'refreshing' | 'ready' | 'handoff' Read-only. What is on screen right now, including a handoff in progress.
motion motion 'system' | 'paused' 'system' system follows the visitor’s reduced-motion setting; paused stills every loader inside.
stylePolicy StylePolicy How the element adds its styles: inline <style> (with an optional CSP nonce) or an external stylesheet. Set it before the element connects; the nonce attribute sets it too.
preset RegionPreset A named bundle of options from definePreset(). Explicit options win over it.
animations Pick<Animations<'region'>, 'handoff'> The idle and handoff animations, built-in or from defineAnimation().
nonce string A CSP nonce for the element’s inline styles, read when it connects.
data-dotquilt-style-href string Loads the element’s styles from this stylesheet instead of inline, read when it connects (for a strict style-src).
Method Description
update(patch) Sets several options at once, as one change. Keys that are not options of this element are reported as unknown-option. Keys: state, cycle, delay, minDisplay, timing, revealTargets, motion, stylePolicy, preset and animations.
refresh() Measures and draws again, after a change the element cannot observe on its own.
Event detail Description
dotquilt-handoff-start HandoffDetail The handoff from the placeholder to the content begins.
dotquilt-handoff-end HandoffDetail The handoff finished. detail.reason is complete, or why it swapped at once.
dotquilt-handoff-cancel HandoffDetail A newer state or cycle replaced the handoff.
dotquilt-error LoaderErrorDetail An option was invalid or an animation failed. detail.code says which, detail.field names the property.
Slot Holds React Vue Svelte Angular
(default) Your content. children default slot children content
placeholder The loader shown while pending. placeholder prop #placeholder slot placeholder snippet dotquiltPlaceholder element
refresh-indicator Your own cue while refreshing, in place of the row of marks. refreshIndicator prop #refresh-indicator slot refreshIndicator snippet dotquiltRefreshIndicator element

Style them with dotquilt-region::part(content).

Part Description
content The layer holding your content.
placeholder The placeholder layer.
refresh-indicator The refresh cue layer.
refresh-thread The row of marks above the top edge while refreshing.
Property Default Description
--dotquilt-color light-dark(#6e7889, #a3afc2) The resting marks.
--dotquilt-accent-color light-dark(#4f8f93, #8dc4c5) The idle glow and the chart handoff.
--dotquilt-dot-size 4.4px Each dot’s diameter.
--dotquilt-dot-gap 4.6px The space between dots.
--dotquilt-refresh-gap 6px How far above a refreshing region its row of marks sits.