Widget example: CSS patterns

This example widget lets users choose a pattern from a selection and define colors and spacing.

Widget UI

The widget UI exposes the following properties and groups them in a single card.

Name
Id
Type
Description

Select Pattern

patternId

selection

Selection of pattern names

Back Color

backColorId

color

Background color

Front Color

frontColorId

color

Foreground color

Spacing

spacingId

number

Spacing between pattern repetitions

Widget UI
UI definition

Widget code

The widget loads and uses the tinycolor.js library to convert various color values (RGB, HEX, HSL, RGBA, or HSLA) to HEX color definition.

output.html

Pattern Widget UI in Composer

Last updated

Was this helpful?