Liking cljdoc? Tell your friends :D

x-organic-shape

An organic, blob-like shape container. Use it as a decorative visual accent or as a content wrapper with a fluid, natural boundary.

Tag

<x-organic-shape></x-organic-shape>

Attributes

AttributeTypeDefaultDescription
shapestring"blob-1"Preset shape name. One of: blob-1, blob-2, blob-3, pebble, leaf, droplet, cloud, wave.
pathstringCustom CSS clip-path value. Overrides shape when present.
animationstring"none"Animation style. One of: none, morph, pulse, float, spin. Respects prefers-reduced-motion. morph is disabled when path is set.
ratiostring"1/1"CSS aspect-ratio value (e.g. "4/3", "16/9", "auto").
widthstringCSS width value (e.g. "200px", "50%", "10rem").
heightstringCSS height value (e.g. "150px", "50%", "10rem").

Properties

PropertyTypeReflects Attribute
shapestringshape
pathstringpath
animationstringanimation
ratiostringratio
widthstringwidth
heightstringheight

Events

None.

Slots

SlotDescription
defaultContent placed inside the shape, clipped to its boundary.

CSS Custom Properties

PropertyDefaultDescription
--x-organic-shape-fillrgba(99,102,241,0.12)Background fill. Accepts any CSS color or gradient.
--x-organic-shape-stroketransparentOutline/stroke color.
--x-organic-shape-stroke-width0Stroke width.
--x-organic-shape-opacity1Component opacity.
--x-organic-shape-shadownoneDrop shadow via filter: drop-shadow(). Follows the clip shape.
--x-organic-shape-animate-duration8sAnimation cycle duration.
--x-organic-shape-animate-timingease-in-outAnimation timing function.
--x-organic-shape-animate-directionnormalAnimation direction (normal, reverse, alternate, alternate-reverse).
--x-organic-shape-animate-delay0sAnimation start delay. Useful for staggering multiple shapes.

CSS Parts

PartDescription
shapeThe inner container that carries the clip-path, background, and aspect-ratio.

Accessibility

  • Decorative (no slotted content): Sets role="presentation" and aria-hidden="true".
  • Container (has slotted content): Removes decorative attributes. Slotted content retains its own semantics.
  • Detection is automatic via slotchange.

Preset Shapes

NameDescription
blob-1Asymmetric amoeba (default)
blob-2Rounder, more symmetrical blob
blob-3Elongated organic mass
pebbleSmooth, slightly irregular oval
leafPointed ends, curved sides
dropletTeardrop shape
cloudBumpy top, flatter bottom
waveUndulating horizontal band

Animation Styles

ValueEffect
noneNo animation (default)
morphShape morphs between two clip-path states. Only works with presets (disabled when path is set).
pulseGentle scale up/down breathing effect.
floatSlow vertical drift up and down.
spinContinuous rotation (uses linear timing regardless of --x-organic-shape-animate-timing).

All animations respect prefers-reduced-motion: reduce.

Usage Examples

Decorative accent

<x-organic-shape
  shape="blob-2"
  width="200px"
  style="--x-organic-shape-fill: rgba(139,92,246,0.2);">
</x-organic-shape>

Morphing blob

<x-organic-shape shape="pebble" animation="morph"></x-organic-shape>

Pulsing shape

<x-organic-shape shape="leaf" animation="pulse" width="160px"></x-organic-shape>

Floating decoration

<x-organic-shape
  shape="cloud"
  animation="float"
  width="200px"
  style="--x-organic-shape-animate-duration: 5s;">
</x-organic-shape>

Custom animation timing

<x-organic-shape
  shape="blob-1"
  animation="morph"
  width="180px"
  style="
    --x-organic-shape-animate-duration: 3s;
    --x-organic-shape-animate-direction: alternate-reverse;
    --x-organic-shape-animate-delay: 1s;
  ">
</x-organic-shape>

Content container

<x-organic-shape
  shape="droplet"
  width="240px"
  style="--x-organic-shape-fill: linear-gradient(135deg, #667eea, #764ba2);">
  <div style="padding: 32px; color: white; text-align: center;">
    Hello World
  </div>
</x-organic-shape>

Custom path

<x-organic-shape path="circle(50%)" width="160px"></x-organic-shape>

With stroke and shadow

<x-organic-shape
  shape="leaf"
  width="180px"
  style="
    --x-organic-shape-fill: rgba(34,197,94,0.12);
    --x-organic-shape-stroke: rgba(34,197,94,0.5);
    --x-organic-shape-stroke-width: 2px;
    --x-organic-shape-shadow: drop-shadow(0 4px 12px rgba(34,197,94,0.3));
  ">
</x-organic-shape>

Background decoration (click-through)

<div style="position: relative;">
  <x-organic-shape
    shape="blob-1"
    animation="float"
    style="
      position: absolute; top: -40px; right: -40px;
      width: 300px; pointer-events: none;
      --x-organic-shape-fill: rgba(99,102,241,0.08);
    ">
  </x-organic-shape>
  <div style="position: relative; z-index: 1;">
    Your content here
  </div>
</div>

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close