Mixins / foldkit-mixins-ui

CheckboxView

interface · packages/mixins-ui/src/checkbox/view.ts:17

interface CheckboxView<Outer> {
  readonly id: string
  readonly checked: boolean
  readonly onToggle: (checked: boolean) => NoInfer<Outer>
  readonly label: string
  readonly description?: string | undefined
  readonly position?: TogglePosition | undefined
  readonly labelAside?: Html | undefined
  readonly indeterminate?: boolean | undefined
  readonly disabled?: boolean | undefined
  readonly readOnly?: boolean | undefined
  readonly invalid?: boolean | undefined
  readonly name?: string | undefined
  readonly value?: string | undefined
  readonly style?: NamedStyle<typeof CheckboxSlots> | undefined
  readonly mixins?: MixinList<Outer> | undefined
}

Members

CheckboxView.id

property · packages/mixins-ui/src/checkbox/view.ts:19

readonly id: string

Prefixes the ids the checkbox draws, unique on the page.

CheckboxView.checked

property · packages/mixins-ui/src/checkbox/view.ts:21

readonly checked: boolean

The application's field.

CheckboxView.onToggle

property · packages/mixins-ui/src/checkbox/view.ts:23

readonly onToggle: (checked: boolean) => NoInfer<Outer>

Sent with the state a press leaves.

CheckboxView.label

property · packages/mixins-ui/src/checkbox/view.ts:25

readonly label: string

The checkbox's accessible name, drawn beside it.

CheckboxView.description

property · packages/mixins-ui/src/checkbox/view.ts:27

readonly description?: string | undefined

A line under the label, which also describes the control.

CheckboxView.position

property · packages/mixins-ui/src/checkbox/view.ts:29

readonly position?: TogglePosition | undefined

end puts the words before the control. Default start.

CheckboxView.labelAside

property · packages/mixins-ui/src/checkbox/view.ts:31

readonly labelAside?: Html | undefined

Drawn beside the label: a badge, a hint with a Tooltip.

CheckboxView.indeterminate

property · packages/mixins-ui/src/checkbox/view.ts:33

readonly indeterminate?: boolean | undefined

A dash: some of what this box stands for is chosen.

CheckboxView.disabled

property · packages/mixins-ui/src/checkbox/view.ts:34

readonly disabled?: boolean | undefined

CheckboxView.readOnly

property · packages/mixins-ui/src/checkbox/view.ts:36

readonly readOnly?: boolean | undefined

Shows the state and refuses a press.

CheckboxView.invalid

property · packages/mixins-ui/src/checkbox/view.ts:38

readonly invalid?: boolean | undefined

The box shows the error edge and says so to a screen reader.

CheckboxView.name

property · packages/mixins-ui/src/checkbox/view.ts:40

readonly name?: string | undefined

Submitted under this name, as value while checked and empty otherwise.

CheckboxView.value

property · packages/mixins-ui/src/checkbox/view.ts:42

readonly value?: string | undefined

What a checked box submits. Default on.

CheckboxView.style

property · packages/mixins-ui/src/checkbox/view.ts:43

readonly style?: NamedStyle<typeof CheckboxSlots> | undefined

CheckboxView.mixins

property · packages/mixins-ui/src/checkbox/view.ts:44

readonly mixins?: MixinList<Outer> | undefined