import type { Component, Snippet } from 'svelte'; import type { ValidationContext, ValidationResult } from '../../utils/validation'; export type CheckboxValidator = (context: ValidationContext) => ValidationResult; export type Props = { /** Field label, a string or Svelte snippet. */ label?: string | Snippet; /** Configuration key and HTML name attribute. */ name?: string; /** Description shown below the checkbox, a string or Svelte snippet. */ description?: string | Snippet; /** Disables the checkbox. */ disabled?: boolean; /** Shows or hides the checkbox without destroying it. */ show?: boolean; /** Whether the checkbox is selected. */ value?: boolean; /** Whether the checkbox is initially checked. */ checked?: boolean; /** CSS class added to the form-group wrapper. */ class?: string; /** Content rendered after the checkbox and validation message. */ children?: Snippet; /** Callback for the native input event with the updated value. */ onInput?: (value: boolean, event: Event) => void | Promise; /** Callback for the native change event with the updated value. */ onChange?: (value: boolean, event: Event) => void | Promise; /** Custom validator. */ validate?: CheckboxValidator; }; /** * A checkbox component. * See [Readme](https://docs.soleil.se/packages/config-svelte/components/checkbox/). */ declare const Checkbox: Component; export default Checkbox;