type · packages/mixins-ui/src/button.ts:150
type ButtonPreset = Pick < ButtonCommon < never >, 'style' | 'words' > & {
readonly type?: 'button' | 'submit' | 'reset' | undefined
readonly mixins?: MixinList < never >
} What a Button is given once: its look and each option that holds no Message, state or drawing.
const · packages/mixins-ui/src/button.ts:24
const ButtonSlots: Slots . Contract <{ readonly button: Slot . UnnamedSlot < Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]>, readonly [Event . EventToken < "click" > ], readonly [Attr . AttrToken < "role" >, Attr . AttrToken < "aria-disabled" >, Attr . AttrToken < "disabled" >, Attr . AttrToken < "aria-pressed" > ], readonly Slot . RequirementName [], boolean >; readonly icon: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly content: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly description: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly trailing: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly mark: Slot . UnnamedSlot < Capabilit …;The button publishes the button and the boxes its parts stand in: icon
before the label, trailing after it, content and description when
there is a second line, and mark, a corner badge or dot. click
is owned by the base OnClick when the button is interactive, so a Behavior
that adds its own click handler is a conflict rather than a second silent
owner.
type · packages/mixins-ui/src/button.ts:131
type ButtonView < Message > = ButtonCommon < Message > &
(
| {
readonly type?: 'button' | 'submit' | 'reset' | undefined
readonly onClick?: NoInfer < Message > | undefined
readonly href?: undefined
readonly external?: undefined
}
| {
readonly href: string
readonly external?: boolean | undefined
readonly type?: undefined
readonly onClick?: undefined
}
) Show all 15 lines A button in one call: the label, a style for its slot, and the rest of
@foldkit/ui's own config. It presses (onClick, type) or it is a link
(href, external), never both; toView stays for a control drawn as
something else (a split control).
interface · packages/mixins-ui/src/button.ts:61
interface ButtonWords {
readonly external: string
} function · packages/mixins-ui/src/button.ts:161
function configure < const Names extends string = never >(
config: Presets < ButtonPreset , Names >,
) : {
readonly view : < Outer > (
options: ButtonView < Outer > & PresetOption < Names >,
h: HtmlBuilder < Outer >,
) => Html
} The application's own Button: base for every use, presets chosen at a
use with preset, and the call over both. mixins concatenate in that
order and words merge word by word; a style given at the call replaces
the preset's.
Button.resolve# function · packages/mixins-ui/src/button.ts:45
function resolve < Input , Message >(
attributes: ButtonAttributes < Message >,
mixins: MixinList < Message >,
context: ResolveContext < Input , Message >,
) : ResolvedButton < Message > Applies mixins to the button's bundles.
type · packages/mixins-ui/src/button.ts:38
type ResolvedButton < Message > = Resolved <
ButtonAttributes < Message >,
typeof ButtonSlots,
Message
> The button's bundles with the attached Mixins applied.
Button.toView# function · packages/mixins-ui/src/button.ts:52
function toView < Message >(
mixins: MixinList < Message >,
context: ResolveContext < unknown , Message >,
draw : ( resolved: ResolvedButton < Message >) => Html ,
) : ( attributes: ButtonAttributes < Message >) => Html The button's toView: draw receives its bundles with mixins applied.
Button.view# function · packages/mixins-ui/src/button.ts:172
function view < Message >(
options: ButtonView < Message >,
h: HtmlBuilder < Message >,
) : Html Button.words# const · packages/mixins-ui/src/button.ts:67
const words = { external } The defaults, in English: text with {blanks}, as the other widgets' words.