checkbox/Checkbox.svelte

windmill · frontend/src/lib/components/common/checkbox/Checkbox.svelte · svelte · Apache-2.0
ui

Controlled checkbox with indeterminate state and click tracking for Svelte apps.

<!--
  Source: https://github.com/windmill-labs/windmill | License: Apache-2.0
  Provided via justclaw.it.com; keep this notice with the code.
-->
<script lang="ts">
	import { twMerge } from 'tailwind-merge'

	interface Props {
		/** Controlled checked state. */
		checked?: boolean
		/** Tri-state display (e.g. a group header with only part of its items
		 * selected). Purely visual — `checked` still drives the value. */
		indeterminate?: boolean
		disabled?: boolean
		/** Native title attribute (hover hint). */
		title?: string | undefined
		/** Extra classes merged onto the input. */
		class?: string | undefined
		/** Change handler (controlled — the parent owns `checked`). */
		onChange?: (e: Event & { currentTarget: EventTarget & HTMLInputElement }) => void
		/** Click handler, for the

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key