Documentation navigation

Published API · 0.1.0-rc.1

foldkit-ui · meter

Published foldkit-ui API declarations for meter.

./meter

@wsagency/wseffect-foldkit-ui · MIT · source · MIT license · WS-AGENCY-NOTICE · THIRD-PARTY-NOTICES

This entry point is published in @wsagency/wseffect-foldkit-ui@0.1.0-rc.1. Import it from the package subpath shown below; the signatures and documentation are read from the installed package declarations.

import * as Wseffect from '@wsagency/wseffect-foldkit-ui/meter'

Exported declarations

labelId

Returns the label element id, derived from the meter's base id.

labelId: (id: string) => string

MeterAttributes

Attribute groups provided to a Meter view.

export type MeterAttributes<Message> = Readonly<{
    meter: ReadonlyArray<Attribute<Message>>;
    label: ReadonlyArray<Attribute<Message>>;
    fill: ReadonlyArray<Attribute<Message>>;
}>;

view

Renders an accessible meter as a stateless controlled view.

view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html

ViewConfig

export type ViewConfig<Message> = Readonly<{
    id: string;
    value: number;
    min?: number;
    max?: number;
    low?: number;
    high?: number;
    optimum?: number;
    valueText?: string | ((value: number, max: number) => string);
    ariaLabel?: string;
    ariaLabelledBy?: string;
    toView: (attributes: MeterAttributes<Message>) => Html;
}>;