Integration

Plain JavaScript

Attach a frame, a divider or an image to any element. Each controller picks the right artwork for its size and can be updated or removed later. No framework required.

npm i @ranx729/medieval-ornaments

Borders: frames and dividers

Every pattern works as a divider in either direction. Patterns with approved corners also work as frames. Changes call update() on the same controllers.

Border

A frame for your content

Your markup stays yours: changing the border keeps this text and the input below.


    

Images: decorations and illustrations

Whole images keep their proportions. Choose one of the sizes published for the selected image; it is shown at that file’s pixel size.

Image
Size


    

Import a single design

For a fixed selection, import each design directly. Your bundle then contains only that design’s metadata, and the design option is not needed.

import { createDivider }
  from '@ranx729/medieval-ornaments/designs/red-berry-vine';
import '@ranx729/medieval-ornaments/styles.css';

createDivider(document.querySelector('.divider'));
A winged pig
import { createOrnamentImage }
  from '@ranx729/medieval-ornaments/designs/flying-pig';

createOrnamentImage(document.querySelector('img'), {
  size: 128, loading: 'lazy', decoding: 'async'
});

Compose whole images

Some decorations are parts of a composition. These gold rules place fixed-size end and centre images over a continuous CSS rule that grows with the available width.

Illuminated acanthus

Matching gold-capped terminals and a centerpiece form a flexible red-and-gold divider. Use the fleuron, rosette and horizontal flourish between sections, or the leafy sprigs beside headings and in margins.

Learn more