Tile band
A band of hand-painted tiles for a border or a section divider: Goan azulejo, the blue-and-white tiles of the Portuguese-era houses and churches, with a majolica sister in cobalt, lemon yellow and leaf green.
quiet warm playful for border, divider, section-break
Open the live demo
npx @susegad/cli add tile-band
Stands on: Core, Core: components, Engine, Tokens
The prompt
the prompt
A hand-painted border or section divider: for a restaurant's menu, a homestay's page, a shop's footer, an event page that wants to feel like Goa and not like a template.
Goan azulejo (the blue-and-white painted tiles of the Portuguese-era houses and churches) with its majolica cousin (cobalt, lemon yellow and leaf green). Geometric and floral only.
<link rel="stylesheet" href="susegad/components/tile-band/tile-band.css">
<script type="module" src="susegad/components/tile-band/tile-band.js"></script>
<sg-tile-band></sg-tile-band> <!-- decoration -->
<sg-tile-band tones="majolica" seed="church"><hr></sg-tile-band> <!-- a divider: the hr is the separator -->
<sg-tile-band orientation="vertical" style="height: 20rem"></sg-tile-band>
The prompt
Make a band of hand-painted tiles as a web component, for a border or a divider, in the tradition of Goan azulejo. Lay square tiles along the band, as many as fit whole (a wanted tile size from a CSS custom property, stretched a little so none is cut), either across the page or down it, and make the band as thick as one tile. Make a small family of tile motifs, geometric and floral only and never a figure or a religious symbol: a rosette of petals with quarter-circle fans in the corners, a quatrefoil of four lobes with a diamond in the middle, quarter-circle corners in concentric rings, and a vine that runs from the middle of one edge to the middle of the opposite edge so neighbouring vines join. Lay them from a seed: two motifs alternate, an accent tile of another turns up every six to nine, no two neighbours alike, and each tile is a little off, as a hand makes it. Offer two sets of pigments: blue and white, and majolica with lemon yellow and leaf green. Paint once on a canvas at the device pixel ratio and keep it; never run a frame loop. Give it three registers. Quiet: a cobalt hairline on the page, flat, line art only, no fills, following the theme. Warm: a hand-painted glaze that keeps its own colours by day and night: white glazed tiles, cobalt brushwork with a bleed of pigment under each stroke, glaze pooled at the edges, a sheen, a bevel and a fine crackle. Playful: the same, and when a pointer passes over a tile or a finger taps it, that tile turns a quarter-turn, swings a little past and settles, over about half a second, with a frame loop only for that half second. Under reduced motion nothing turns. With an hr inside it is a divider and says so; without one it is hidden from assistive technology.
Words to code
| When you say | Technique | What happens |
|---|---|---|
| as many as fit whole, square | fitTiles(length, wanted) | count = round(length / wanted), size = length / count; the element sets --sg-tile-fit so the band's thickness is exactly one tile. |
| a small family of motifs | pure core | motif(name) returns layers: path strings in a 100 by 100 tile, each a fill or a stroke with a pigment role (ink, blue, wash, lemon, leaf, ground). The four names are the whole family. |
| a vine that joins its neighbours | geometry | The stem runs from (0, 50) to (100, 50); a vine only turns by half-turns. |
| lay them from a seed | layBand(seed, count) | Two motifs alternate; an accent every 6 to 9; no neighbours alike; a longer band keeps the start of a shorter one. |
| a little off, as a hand makes it | per-tile numbers | Misregistration of up to 1.2 units and 1.1 degrees, a brush weight 0.88 to 1.14, a pooling and a tint, each tile's own crackle seed. |
| blue and white, and majolica | pigmentOf(role, tones) | A blue-and-white tile paints lemon as the pale wash and leaf as cobalt; majolica keeps them. |
| a bleed of pigment under each stroke | painter | Each path is stroked wide at 16 to 18 percent before it is filled and outlined. |
| crackle | crackle(seed) | A few fine wandering cracks from the edges that sometimes fork, drawn dark with a pale line beside. |
| paint once and keep it | one paint | A ResizeObserver repaints only when the length, wanted size, pixel ratio, look, tones, seed or direction changes; there is no loop. |
| down the page | orientation | Every motif is turned one more quarter, so vines climb. |
| a tile turns a quarter and settles | turnAngle(p) | An ease-out-back: it swings about 12 percent past 90 degrees and lands on exactly 90, while the art shrinks a little (lift) so its corners stay in the cell. |
Accessibility
- Decoration is
aria-hidden. With an<hr>inside it is the separator, and without JavaScript it is a cobalt hairline. - Nothing carries meaning; turning a tile is a flourish for pointer and touch only, not offered to the keyboard because there is nothing to operate.
- Reduced motion: no tile turns. High-contrast mode shows the
<hr>as a plain line instead of the canvas.
<sg-tile-band> is a band of hand-painted tiles for a border or a divider. It is a decoration component and not a scene: its box is the band (a length and a thickness the page chooses, along the page or down it), and it has no loop. It is painted once on a canvas and kept.
Markup
<sg-tile-band></sg-tile-band>
<sg-tile-band tones="majolica" seed="church"><hr></sg-tile-band>
<sg-tile-band orientation="vertical" style="height: 20rem"></sg-tile-band>
An <hr> inside makes it a divider: the <hr> is the separator for assistive technology and, without JavaScript, the cobalt hairline. Without one the band is aria-hidden.
Attributes and sizing
| Attribute | Values | Default |
|---|---|---|
tones | azulejo (blue and white), majolica (cobalt, lemon, leaf green) | azulejo |
seed | any text or number: the same seed lays the same tiles | azulejo |
orientation | horizontal, vertical | horizontal |
register | quiet, warm, playful | inherited |
--sg-tile-size is the tile you would like (default 4rem, 3.25rem on a phone). The band fits whole square tiles to its length and sets --sg-tile-fit to the size that makes them fit, which is also its thickness. A vertical band needs a height: give it one, or let a grid or flex parent stretch it (it has a minimum of 12rem).
The motifs
Four, geometric and floral only: a rosette (petals and corner fans), a quatrefoil (four lobes and a diamond), corners (quarter-circle rings) and a vine (a stem that runs edge to edge so neighbouring vines join). Two alternate along the band, an accent of another turns up every six to nine, and no two neighbours are alike. No figures and no religious symbols.
Registers
| Look | |
|---|---|
| quiet | a cobalt hairline on the page, flat: line art only, no fills, following the theme (lighter cobalt at night) |
| warm | a hand-painted glaze: white tiles that keep their colours by day and night, brushwork with a bleed under each stroke, glaze pooled at the edges, a sheen, a bevel, a fine crackle, and each tile a hair off true |
| playful | warm, and a tile turns a quarter when a pointer passes over it or a finger taps it, swings a little past and settles |
Under reduced motion nothing turns. The colours come from --sg-cobalt, --sg-wash, --sg-lemon, --sg-leaf and --sg-glaze (the azulejo palette defines them) and fall back to the same values on any other palette.
No idle frames
The band repaints only when something that changes the picture changes: its length, the wanted size, the pixel ratio, the register's look, the colours, the seed, the tones or the direction. A turn runs a requestAnimationFrame for about half a second and stops. An idle band records zero frames.
Registry
motif: { origin: "goa", tier: "everyday", gloss: "Azulejo: the painted tiles of Goa's Portuguese-era houses and churches; majolica is its Mediterranean cousin." }
Accessibility
How this component meets WCAG 2.2 level A and AA, criterion by criterion, how each was checked, and what your page still owns.
- Meets 5
- Not applicable 4
| Criterion | Status | How it was checked |
|---|---|---|
| 1.1.1 Non-text content | Meets | A band is decoration and is hidden from assistive technology: packages/components/tile-band/tile-band.check.mjs, "<register>: a decoration is aria-hidden; the divider keeps its <hr>". packages/components/tile-band/tile-band.js sets aria-hidden="true" on the element when it has no native <hr>, and the canvas is aria-hidden (skins/band.js). |
| 1.3.1 Info and relationships | Meets | A band used as a divider is a real <hr>, so it is a separator for assistive technology; with the band painted the <hr> stays but takes no room, and without JavaScript it is a hairline: tile-band.check.mjs, "with the band painted the hr is still there for assistive technology, but takes no room" and "without JavaScript the divider is a cobalt hairline (the hr), and nothing else is drawn". |
| 1.4.1 Use of color | Not applicable | The band carries no meaning, in colour or otherwise. |
| 1.4.3 Contrast (minimum) | Not applicable | The band holds no text. axe, 0 violations: tile-band.check.mjs, "axe, <theme>, all three registers", "axe, <palette> palette, <theme>" and "axe without JavaScript". |
| 1.4.4 Resize text | Meets | Manual test, 2026-10-07: demo with the root font size at 200 percent at 1280 px, three registers, nothing wider than the screen (throwaway Playwright script). The band is painted to whole square tiles at the size of its box and repainted when it changes (tile-band.check.mjs, "every band is painted with whole square tiles"). |
| 1.4.10 Reflow | Meets | tile-band.check.mjs: "at 390 px the page does not scroll sideways". Manual test, 2026-10-07: the demo at 320 CSS px, three registers, page width 320 (throwaway Playwright script). |
| 1.4.11 Non-text contrast | Not applicable | The band is pure decoration, hidden from assistive technology, and nothing in the page depends on seeing it. |
| 1.4.12 Text spacing | Not applicable | The band holds no text. Manual test, 2026-10-07: the WCAG text-spacing values injected on the demo, three registers, page width 320, no change (throwaway Playwright script). |
| 4.1.2 Name, role, value | Meets | The band has no name, role or state of its own to expose: the decoration is aria-hidden and the divider is an <hr> (tile-band.check.mjs, "a decoration is aria-hidden; the divider keeps its <hr>"). Turning a tile in playful is a flourish for pointer and touch, with nothing to operate, so it is not in the tab order. axe: 0 violations in every register, light and dark, in each palette and with JavaScript off (the same check file). |
The page author owns:
- Whether a band is a divider (an
<hr>inside it) or pure decoration, and keeping meaning out of it: nothing a reader needs may live only in a tile pattern. - Not relying on the playful tile turn to show anything; it answers a pointer or a touch and nothing else.
How it behaves
- Decoration is hidden from assistive technology; a divider is a real
<hr>. - Turning a tile is a flourish for pointer and touch; there is nothing to operate, so it is not in the tab order.
- High-contrast mode replaces the canvas with a plain line.