Documentation navigation

Published API · 0.1.0-rc.1

themes · components/theme

Published themes API declarations for components/theme.

./components/theme

@wsagency/wseffect-themes · MIT · source · MIT license · WS-AGENCY-NOTICE

This entry point is published in @wsagency/wseffect-themes@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-themes/components/theme'

Exported declarations

defaults

defaults: Settings

Settings

export type Settings = typeof Settings.Type;

Settings

Settings: Schema.Struct<{
    readonly accentColor: Schema.Literals<readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky", "custom"]>;
    readonly grayColor: Schema.Literals<readonly ["auto", "gray", "mauve", "slate", "sage", "olive", "sand"]>;
    readonly radius: Schema.Literals<readonly ["none", "small", "medium", "large", "full"]>;
    readonly scaling: Schema.Literals<readonly ["90%", "95%", "100%", "105%", "110%"]>;
    readonly appearance: Schema.Literals<readonly ["inherit", "light", "dark"]>;
    readonly panelBackground: Schema.Literals<readonly ["solid", "translucent"]>;
    readonly hasBackground: Schema.Boolean;
}>

view

view: <Message>({ settings, isRoot, id }: ViewProps, children: ReadonlyArray<Html | string>, h: HtmlBuilder<Message>) => Html

ViewProps

export type ViewProps = Readonly<{
    settings: Partial<Settings>;
    isRoot: boolean;
    id?: string;
}>;

Rendered component example

Theme
Theme-aware content
Example usage
import * as Themes from '@wsagency/wseffect-themes'
import * as SliderRange from '@wsagency/wseffect-themes/components/slider/range'
import * as Option from 'effect/Option'
import { defineView } from '@wsagency/wseffect-foldkit/submodel'
import { inertHtml, type HtmlBuilder } from '@wsagency/wseffect-foldkit/html'

const example = (h: HtmlBuilder<unknown>) => Themes.Theme.view({ settings: { appearance: 'light' }, isRoot: false }, ['Theme-aware content'], h)