Today Canvas Kit
SDK packages

@todayai-labs/tck-widget-utils

Widget-author utility helpers that bundle into widget artifacts rather than resolving through the host import map.

Utility helpers for widget source code. These helpers are normal widget dependencies: the bundler includes them in widget.mjs instead of resolving them through the host's shared-deps import map.

Exports

ExportDescription
cn(...values)Combines clsx class-value inputs and resolves Tailwind utility conflicts with tailwind-merge.
ClassValueRe-exported type from clsx for helper wrappers.

Usage

import { cn } from '@todayai-labs/tck-widget-utils'

export function Row({ selected }: { selected: boolean }) {
  return <div className={cn('flex px-2', selected && 'px-4')}>...</div>
}

Keep class names as literal strings inside cn(...) calls. The widget bundler recognizes cn as a class-list helper, so Tailwind utilities inside those calls are scanned, compiled, and attributed to the source location that wrote them.

Versioning

tck-widget-utils is in the SDK fixed group with tck, tck-bundler, tck-preview, and create-widget, so scaffolded projects can pin it to the same exact SDK version. It is not part of tck-shared-deps; host import maps do not provide it.

Source

On this page