Skip to content

components/game-feedback

FeedbackKind = "confirm" | "deny" | "hit" | "gain"

What happened: an order taken, an order refused, a hit, or something gained.


FeedbackLayerProps = HTMLAttributes<HTMLDivElement> > & object

Props accepted by FeedbackLayer.

optional paused?: boolean

Freeze every mark where it is, e.g. while the game is paused.


FeedbackMarkProps = Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object

Props accepted by FeedbackMark.

kind: FeedbackKind

x: number

Anchor in layer pixels.

y: number

optional label?: ReactNode

A short note, such as the host’s refusal reason.

optional amount?: number

A floating number, drawn signed in outlined pixel numerals.

optional life?: number

Total life in milliseconds; the host removes the mark when it ends.


FeedbackWordTone = "impact" | "gun" | "mech" | "wet" | "quiet" | "bite"

A generic feedback tone: game-neutral, so any cartridge can author with it. bite is for a creature’s bite, not any one game’s monster.


FeedbackWordSize = "s" | "m" | "l" | "xl"

Named display sizes for game feedback words.


FeedbackWordAccent = "jaw"

A two-phase accent that plays alongside the word: jaw claps two wedges shut once, then eases back open.


FeedbackWordMarkProps = Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object

Props accepted by FeedbackWordMark.

text: string

Comic lettering, at most 12 characters (e.g. “CRUNCH”, “BLAM”).

x: number

Anchor in layer pixels; the word sits bottom-centre above this point.

y: number

optional tone?: FeedbackWordTone

optional size?: FeedbackWordSize

optional accent?: FeedbackWordAccent

optional life?: number

Total life in milliseconds; the host removes the mark when it ends.

const FeedbackLayer: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> > & object & RefAttributes<HTMLDivElement>>>>

A click-through overlay for game feedback, placed over the world by the host. Marks inside it are positioned in the layer’s own pixels.


const FeedbackMark: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

One piece of game feedback at a point: a stepped flash ring, an optional floating number and an optional note. Reduced motion keeps the ring and note still and only fades them.


const FeedbackWordMark: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

One comic sound word at a point: punchy lettering that pops in with a little overshoot, drifts up, and fades. Reduced motion keeps it still at full strength until the host removes it.