Published API · 0.1.0-rc.1
themes · components/button Published themes API declarations for components/button.
./components/button @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/button'Exported declarations PropsProps: Schema.Struct<{
readonly size: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly string[]> | Schema.String, Schema.Struct<{
[k: string]: Schema.optional<Schema.Literals<readonly string[]> | Schema.String>;
}>]>>;
readonly variant: Schema.optional<Schema.Literals<readonly ["classic", "solid", "soft", "surface", "outline", "ghost-offset", "ghost"]>>;
readonly color: Schema.optional<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 radius: Schema.optional<Schema.Literals<readonly ["none", "small", "medium", "large", "full"]>>;
readonly highContrast: Schema.optional<Schema.Boolean>;
readonly disabled: Schema.optional<Schema.Boolean>;
readonly loading: Schema.optional<Schema.Boolean>;
readonly type: Schema.optional<Schema.Literals<readonly ["button", "submit", "reset"]>>;
}>viewview: <Message>(props: ViewProps<Message>, children: ReadonlyArray<Html | string>, h: HtmlBuilder<Message>) => HtmlViewPropsexport type ViewProps<Message> = typeof Props.Type & Readonly<{
onClick?: Message;
'data-state'?: string;
}>;Props Props exported by @wsagency/wseffect-themes/components/button · Props · source Name Type Required Choices Description size"1" | "2" | "3" | "4" | Responsive<"1" | "2" | "3" | "4">No — — variant"classic" | "solid" | "soft" | "surface" | "outline" | "ghost-offset" | "ghost"No "classic", "solid", "soft", "surface", "outline", "ghost-offset", "ghost" — color"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"No "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" — radius"none" | "small" | "medium" | "large" | "full"No "none", "small", "medium", "large", "full" — highContrastbooleanNo — — disabledbooleanNo — — loadingbooleanNo — — type"button" | "submit" | "reset"No "button", "submit", "reset" —
Rendered component example Button Save changes
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.Button.view({ type: 'button' }, ['Save changes'], h)