Skip to content

API reference

One public contract, three ways to use it.

Every published entrypoint and non-component export is listed here. Component props, variants, states, and live examples remain on the component pages.

CSS is always explicit

React and Svelte never inject styles. Import the full stylesheet or the granular CSS entrypoints once at your application boundary.

CSS and vanilla

@cofob/design-system-css · Semantic CSS, browser-safe theme utilities, and framework-independent interaction controllers.

Published entrypoints

@cofob/design-system-cssJavaScript

All controllers, theme helpers, and shared types.

@cofob/design-system-css/typesTypeScript

Shared model and primitive types without runtime exports.

@cofob/design-system-css/index.cssCSS

Compiled full stylesheet: tokens, fonts, base, and components.

@cofob/design-system-css/tokens.cssCSS

Semantic tokens and light, dark, and system theme values.

@cofob/design-system-css/fonts.cssCSS

Bundled Manrope font-face declarations.

@cofob/design-system-css/base.cssCSS

Baseline document, focus, motion, and forced-colors rules.

@cofob/design-system-css/components.cssCSS

Public cf-* component class contract.

@cofob/design-system-css/postcssPostCSS

Authoring entry with imports for a consumer PostCSS pipeline.

@cofob/design-system-css/postcss.cssPostCSS

Explicit-file alias of the PostCSS authoring entry.

@cofob/design-system-css/font/manrope.woff2Font

Bundled Manrope variable WOFF2 asset.

Import pattern

typescript
import "@cofob/design-system-css/index.css";
import {
  getThemeScript,
  initDesignSystem,
  createDialogController,
} from "@cofob/design-system-css";

// Render getThemeScript() synchronously in <head> during SSR.
const designSystem = initDesignSystem(document);
const dialog = createDialogController(document.querySelector("dialog"));

// Dispose listeners when the application boundary is removed.
dialog.destroy();
designSystem.destroy();

Initialization

Initialize every matching controller below a document, element, or shadow root in one pass.

ExportContractAvailable fromPurpose
initDesignSystemfunctioninitDesignSystem(root?: DesignSystemRoot | null): DesignSystemController@cofob/design-system-cssInitializes theme, interaction controllers, and theme toggles and returns one cleanup handle.
DesignSystemControllerinterfaceinterface DesignSystemController extends Controller { theme: ThemeController }@cofob/design-system-cssCombined controller returned by initDesignSystem.

Theme runtime

Resolve, apply, persist, and bootstrap the light, dark, or system preference without import-time browser access.

ExportContractAvailable fromPurpose
THEME_STORAGE_KEYconstantconst THEME_STORAGE_KEY = "cf-theme"@cofob/design-system-cssDefault localStorage key used by every theme implementation.
resolveThemePreferencefunctionresolveThemePreference(preference, systemDark): ResolvedTheme@cofob/design-system-cssPurely resolves a preference against the system dark-mode state.
applyThemePreferencefunctionapplyThemePreference(root, preference, systemDark): ThemeState@cofob/design-system-cssWrites resolved data attributes and color-scheme to an HTML root.
createThemeControllerfunctioncreateThemeController(options?: ThemeControllerOptions): ThemeController@cofob/design-system-cssCreates a persistent theme controller and subscribes to system preference changes.
getThemeScriptfunctiongetThemeScript(storageKey?: string): string@cofob/design-system-cssReturns the synchronous anti-flash script for server-rendered head markup.
ThemeStorageinterfaceinterface ThemeStorage { getItem; setItem }@cofob/design-system-cssMinimal storage contract accepted by the theme controller.
ThemeControllerOptionsinterfaceinterface ThemeControllerOptions@cofob/design-system-cssRoot, initial preference, storage, and storage-key options.
ThemeControllerinterfaceinterface ThemeController extends Controller@cofob/design-system-cssReads, updates, subscribes to, and cleans up theme state.

Dialog and popover controllers

Imperative overlay primitives with synchronized state, focus return, Escape, and light-dismiss behavior.

ExportContractAvailable fromPurpose
createDialogControllerfunctioncreateDialogController(dialog, options?): DialogController@cofob/design-system-cssEnhances a modal dialog and its triggers while retaining native dialog behavior.
DialogControllerinterfaceinterface DialogController extends Controller@cofob/design-system-cssOpen, close, toggle, inspect, and destroy operations for a dialog.
DialogControllerOptionsinterfaceinterface DialogControllerOptions@cofob/design-system-cssTrigger, backdrop, initial-open, and change callback options.
createPopoverControllerfunctioncreatePopoverController(popover, options?): PopoverController@cofob/design-system-cssEnhances a Popover API element and supplies a data-state fallback for older browsers.
PopoverControllerinterfaceinterface PopoverController extends Controller@cofob/design-system-cssOpen, close, toggle, inspect, and destroy operations for a popover.
PopoverControllerOptionsinterfaceinterface PopoverControllerOptions@cofob/design-system-cssTrigger, placement, dismissal, focus-return, initial-open, and callback options.

Menu and selection controllers

Keyboard-complete controllers for menus, tabs, and details-based accordions.

ExportContractAvailable fromPurpose
createMenuControllerfunctioncreateMenuController(menu, options?): MenuController@cofob/design-system-cssAdds popover state, roving focus, arrows, Home, End, typeahead, and focus return to a menu.
MenuControllerinterfaceinterface MenuController extends Controller@cofob/design-system-cssOpen with first or last focus, close, toggle, inspect, and destroy a menu.
MenuControllerOptionsinterfaceinterface MenuControllerOptions@cofob/design-system-cssTrigger, initial-open, and open-state callback options.
createNavbarControllerfunctioncreateNavbarController(navbar, options?): NavbarController@cofob/design-system-cssEnhances a responsive details-based Navbar with synchronized state, dismissal, and breakpoint reset.
NavbarControllerinterfaceinterface NavbarController extends Controller@cofob/design-system-cssOpen, close, toggle, inspect, and destroy operations for a responsive Navbar.
NavbarControllerOptionsinterfaceinterface NavbarControllerOptions@cofob/design-system-cssInitial state, dismissal behavior, navigation closing, and open-state callback options.
NavbarCollapseAttypetype NavbarCollapseAt = "mobile" | "tablet" | "never"@cofob/design-system-cssResponsive breakpoint mode for collapsing Navbar navigation.
NavbarMenuVarianttypetype NavbarMenuVariant = "floating" | "flush"@cofob/design-system-cssFloating card or edge-aligned presentation for collapsed navigation.
NavbarSurfacetypetype NavbarSurface = "solid" | "translucent"@cofob/design-system-cssSolid or backdrop-blurred surface for collapsed navigation.
createTabsControllerfunctioncreateTabsController(root, options?): TabsController@cofob/design-system-cssConnects tabs to panels with ARIA, orientation-aware keyboard movement, and manual or automatic activation.
TabsControllerinterfaceinterface TabsController extends Controller@cofob/design-system-cssReads, changes, focuses, and cleans up the selected tab value.
TabsControllerOptionsinterfaceinterface TabsControllerOptions@cofob/design-system-cssControlled/default value, orientation, activation, and change callback options.
createAccordionControllerfunctioncreateAccordionController(root, options?): AccordionController@cofob/design-system-cssCoordinates details elements, single or multiple expansion, and summary keyboard navigation.
AccordionControllerinterfaceinterface AccordionController extends Controller@cofob/design-system-cssReads, updates, and cleans up expanded accordion values.
AccordionControllerOptionsinterfaceinterface AccordionControllerOptions@cofob/design-system-cssMultiple-expansion and value-change callback options.
createComboboxControllerfunctioncreateComboboxController(root, options?): ComboboxController@cofob/design-system-cssAdds filtering, selection, active-descendant state, and keyboard navigation to a combobox listbox.
ComboboxControllerinterfaceinterface ComboboxController extends Controller@cofob/design-system-cssOpen, close, select, inspect, and destroy operations for a native combobox.
ComboboxControllerOptionsinterfaceinterface ComboboxControllerOptions@cofob/design-system-cssFocus-opening and value-change callback options for a native combobox.
createAudioPlayerControllerfunctioncreateAudioPlayerController(root, options?): AudioPlayerController@cofob/design-system-cssConnects playback, seek, time, mute, and volume controls to a native audio element.
AudioPlayerControllerinterfaceinterface AudioPlayerController extends Controller@cofob/design-system-cssPlayback, seek, volume, mute, and lifecycle operations for an audio player.
AudioPlayerControllerOptionsinterfaceinterface AudioPlayerControllerOptions { durationHint?: number }@cofob/design-system-cssKnown duration fallback used until audio metadata becomes available.
createVideoPlayerControllerfunctioncreateVideoPlayerController(root, options?): VideoPlayerController@cofob/design-system-cssConnects themed playback, seek, time, mute, volume, and fullscreen controls to a native video element.
VideoPlayerControllerinterfaceinterface VideoPlayerController extends Controller@cofob/design-system-cssPlayback, seek, volume, mute, fullscreen, and lifecycle operations for a video player.
VideoPlayerControllerOptionsinterfaceinterface VideoPlayerControllerOptions { durationHint?: number }@cofob/design-system-cssKnown duration fallback used until video metadata becomes available.

Tooltip and toast controllers

Supplementary descriptions and live-region notifications with explicit lifecycle cleanup.

ExportContractAvailable fromPurpose
createTooltipControllerfunctioncreateTooltipController(tooltip, options?): TooltipController@cofob/design-system-cssConnects triggers through aria-describedby and coordinates hover, focus, delay, and Escape.
TooltipControllerinterfaceinterface TooltipController extends Controller@cofob/design-system-cssShow, hide, inspect, and destroy operations for a tooltip.
TooltipControllerOptionsinterfaceinterface TooltipControllerOptions@cofob/design-system-cssTrigger and display-delay options.
TooltipPlacementtypetype TooltipPlacement = top | right | bottom | left@cofob/design-system-cssPreferred side used when positioning a tooltip beside its trigger.
createToastControllerfunctioncreateToastController(viewport): ToastController@cofob/design-system-cssCreates and manages accessible notification DOM inside a viewport.
ToastControllerinterfaceinterface ToastController extends Controller@cofob/design-system-cssCreates, dismisses, clears, and destroys vanilla toasts.

Clipboard controller

Framework-independent clipboard behavior for code and terminal command controls.

ExportContractAvailable fromPurpose
copyTextfunctioncopyText(value: string): Promise<void>@cofob/design-system-cssCopies text through the Clipboard API without import-time browser access.
createCopyControllerfunctioncreateCopyController(root?, options?): CopyController@cofob/design-system-cssEnhances delegated native copy buttons and restores their feedback state after a delay.
CopyControllerOptionsinterfaceinterface CopyControllerOptions { copiedDuration?; writeText? }@cofob/design-system-cssCopy feedback duration and injectable clipboard writer.
CopyControllerinterfaceinterface CopyController extends Controller { copy(value): Promise<boolean> }@cofob/design-system-cssCopies text programmatically and removes delegated listeners on destroy.

Shared contracts

Portable primitives and content models reused by native, React, and Svelte implementations.

ExportContractAvailable fromPurpose
Sizetypetype Size = "sm" | "md" | "lg"@cofob/design-system-css@cofob/design-system-css/typesShared component size scale.
Tonetypetype Tone = neutral | accent | info | success | warning | danger@cofob/design-system-css@cofob/design-system-css/typesSemantic visual and feedback tone scale.
CaptchaStatetypetype CaptchaState = idle | verifying | success | error@cofob/design-system-css@cofob/design-system-css/typesControlled visual state for the presentation-only Captcha surface.
CaptchaLabelsinterfaceinterface CaptchaLabels { idle; verifying; success; error }@cofob/design-system-css@cofob/design-system-css/typesLocalized copy for every Captcha visual state.
TerminalCodeEntryinterfaceinterface TerminalCodeEntry { command: string; output?: string }@cofob/design-system-css@cofob/design-system-css/typesPortable terminal command and optional plain or ANSI-styled captured output.
TerminalColortypetype TerminalColor = { mode: indexed; index } | { mode: rgb; red; green; blue }@cofob/design-system-css@cofob/design-system-css/typesANSI indexed or exact RGB terminal color.
TerminalUnderlineStyletypetype TerminalUnderlineStyle = single | double | curly | dotted | dashed@cofob/design-system-css@cofob/design-system-css/typesModern terminal underline variants mapped to CSS decoration styles.
TerminalTextStyleinterfaceinterface TerminalTextStyle { foreground?; background?; underlineColor?; bold?; dim?; italic?; underline?; inverse?; concealed?; strikethrough?; overline? }@cofob/design-system-css@cofob/design-system-css/typesActive SGR presentation state for terminal output text.
TerminalOutputTokeninterfaceinterface TerminalOutputToken { value: string; style: TerminalTextStyle; href?: string }@cofob/design-system-css@cofob/design-system-css/typesPrintable terminal text carrying safe style and optional OSC 8 hyperlink metadata.
BashTokenKindtypetype BashTokenKind = plain | command | option | string | variable | operator | comment | number@cofob/design-system-css@cofob/design-system-css/typesSemantic token categories used to color Bash command text.
BashTokeninterfaceinterface BashToken { kind: BashTokenKind; value: string }@cofob/design-system-css@cofob/design-system-css/typesAn exact source segment emitted by the Bash presentation tokenizer.
tokenizeBashCommandfunctiontokenizeBashCommand(source: string): BashToken[]@cofob/design-system-cssClassifies Bash command text for syntax presentation without changing its content.
tokenizeTerminalOutputfunctiontokenizeTerminalOutput(source: string): TerminalOutputToken[]@cofob/design-system-cssConverts ANSI SGR and safe OSC 8 output into portable tokens without emulating a terminal screen.
terminalColorToCssfunctionterminalColorToCss(color: TerminalColor, usage?: foreground | background): string@cofob/design-system-cssResolves theme-aware ANSI, xterm indexed, and RGB colors to safe CSS values.
CAPTCHA_LABELSconstantconst CAPTCHA_LABELS: Readonly<CaptchaLabels>@cofob/design-system-cssDefault English copy shared by the native and framework Captcha examples.
ThemePreferencetypetype ThemePreference = "light" | "dark" | "system"@cofob/design-system-css@cofob/design-system-css/typesPersisted user-facing theme preference.
ResolvedThemetypetype ResolvedTheme = "light" | "dark"@cofob/design-system-css@cofob/design-system-css/typesTheme after resolving system preference.
ThemeStateinterfaceinterface ThemeState { preference; resolvedTheme }@cofob/design-system-css@cofob/design-system-css/typesSnapshot emitted by the theme controller.
LinkModelinterfaceinterface LinkModel@cofob/design-system-css@cofob/design-system-css/typesPortable link label, URL, external, and current-page state.
ResponsiveImageModelinterfaceinterface ResponsiveImageModel@cofob/design-system-css@cofob/design-system-css/typesPortable responsive image source and intrinsic dimensions.
AnimatedStickerModelinterfacetype AnimatedStickerModel = { src; width; height } & ({ skeletonSvg } | { firstFrameSrc })@cofob/design-system-css@cofob/design-system-css/typesConverted animation URL, intrinsic dimensions, and an inline SVG or WebP first frame.
PostModelinterfaceinterface PostModel@cofob/design-system-css@cofob/design-system-css/typesPortable post-card content model with display and machine-readable published/updated dates.
ChatMessageModelinterfaceinterface ChatMessageModel@cofob/design-system-css@cofob/design-system-css/typesPortable chat message content model with body/text fallback and optional safe links.
ChatModelinterfaceinterface ChatModel@cofob/design-system-css@cofob/design-system-css/typesPortable chat thread model.
Controllerinterfaceinterface Controller { destroy(): void }@cofob/design-system-css@cofob/design-system-css/typesCommon cleanup contract for every vanilla controller.
AnimatedStickerStatetypetype AnimatedStickerState = loading | playing | paused | static | disabled | reduced-motion | fallback@cofob/design-system-cssPlayback and inline-fallback states reflected on the animated sticker root.
AnimatedStickerControllertypetype AnimatedStickerController = Controller@cofob/design-system-cssCleanup contract for animated sticker playback and motion-preference listeners.
AnimatedStickerToggleControllertypetype AnimatedStickerToggleController = Controller@cofob/design-system-cssCleanup contract for a native switch bound to the global animated sticker flag.
AnimatedStickersEnabledListenertypetype AnimatedStickersEnabledListener = (enabled: boolean) => void@cofob/design-system-cssSubscriber notified whenever the global animated sticker flag changes.
ANIMATED_STICKERS_ATTRIBUTEconstantconst ANIMATED_STICKERS_ATTRIBUTE = data-cf-animated-stickers@cofob/design-system-cssHTML attribute used as the document-wide animation opt-out flag.
ANIMATED_STICKERS_STORAGE_KEYconstantconst ANIMATED_STICKERS_STORAGE_KEY = cf-animated-stickers@cofob/design-system-csslocalStorage key used to preserve the global animated sticker preference across reloads.
createAnimatedStickerControllerfunctioncreateAnimatedStickerController(root: HTMLElement): AnimatedStickerController@cofob/design-system-cssLazily assigns WebM in the viewport, pauses it outside, removes SVG after playing, and restores SVG for global or motion fallbacks.
createAnimatedStickerToggleControllerfunctioncreateAnimatedStickerToggleController(toggle: HTMLInputElement): AnimatedStickerToggleController@cofob/design-system-cssConnects a native checkbox switch to the document-wide animated sticker flag.
getAnimatedStickersEnabledfunctiongetAnimatedStickersEnabled(root?: HTMLElement | null): boolean@cofob/design-system-cssRestores and reads whether animated WebM stickers are globally enabled; missing storage and markup default to true.
setAnimatedStickersEnabledfunctionsetAnimatedStickersEnabled(enabled: boolean, root?: HTMLElement | null): void@cofob/design-system-cssPersists the preference and updates the global HTML flag, mounted stickers, and controls.
subscribeAnimatedStickersEnabledfunctionsubscribeAnimatedStickersEnabled(listener, root?): () => void@cofob/design-system-cssObserves API updates and direct mutations of the global HTML flag.
DesignSystemRoottypetype DesignSystemRoot = Document | Element | ShadowRoot@cofob/design-system-css@cofob/design-system-css/typesSupported initialization boundary.
ToastActioninterfaceinterface ToastAction { label; onClick }@cofob/design-system-css@cofob/design-system-css/typesPortable action attached to a vanilla or React toast.
ToastInputinterfaceinterface ToastInput@cofob/design-system-css@cofob/design-system-css/typesPortable notification title, description, tone, duration, ID, and action.

React

@cofob/design-system-react · React 18.3 and 19 adapters with separate server-safe and client entrypoints.

Published entrypoints

@cofob/design-system-reactReact

Convenience entrypoint containing static and client components, helpers, and types.

@cofob/design-system-react/staticReact

SSR and RSC-friendly static components; no use client directive.

@cofob/design-system-react/clientReact

Interactive components and hooks with an intentional use client boundary.

@cofob/design-system-react/typesTypeScript

Portable models and React composition types.

Import pattern

tsx
// Server-safe or React Server Component modules
import { Button, Card, ThemeScript } from "@cofob/design-system-react/static";

// Files already behind a client boundary
import {
  ToastProvider,
  ToastViewport,
  toast,
  useToast,
} from "@cofob/design-system-react/client";

// CSS stays an explicit application-level import.
import "@cofob/design-system-css/index.css";

Client helpers

Hooks and imperative notifications live behind the client boundary and require the corresponding provider where noted.

ExportContractAvailable fromPurpose
useThemehookuseTheme(): ThemeContextValue@cofob/design-system-react@cofob/design-system-react/clientReads the nearest ThemeProvider preference, resolved theme, and setter.
toastfunctiontoast(input: ToastInput): string@cofob/design-system-react@cofob/design-system-react/clientQueues a notification for the active ToastProvider and returns its ID.
useToasthookuseToast(): { toast; dismiss }@cofob/design-system-react@cofob/design-system-react/clientReturns provider-scoped methods to create or dismiss notifications.

Portable and composition types

Import these contracts from the root or the type-only entrypoint. React-specific models replace portable text fields with ReactNode where composition is expected.

ExportContractAvailable fromPurpose
ThemePreferencetypetype ThemePreference = "light" | "dark" | "system"@cofob/design-system-react@cofob/design-system-react/typesPersisted user theme preference, re-exported from the CSS package.
ResolvedThemetypetype ResolvedTheme = "light" | "dark"@cofob/design-system-react@cofob/design-system-react/typesResolved theme, re-exported from the CSS package.
Sizetypetype Size = "sm" | "md" | "lg"@cofob/design-system-react@cofob/design-system-react/typesShared component size scale.
Tonetypetype Tone = neutral | accent | info | success | warning | danger@cofob/design-system-react@cofob/design-system-react/typesShared semantic tone scale.
CaptchaStatetypetype CaptchaState = idle | verifying | success | error@cofob/design-system-react@cofob/design-system-react/typesControlled visual state re-exported from the CSS package.
CaptchaLabelsinterfaceinterface CaptchaLabels@cofob/design-system-react@cofob/design-system-react/typesLocalized copy for each Captcha state.
TerminalCodeEntrytypetype TerminalCodeEntry = CssTerminalCodeEntry@cofob/design-system-react@cofob/design-system-react/typesPortable terminal command and output entry.
ButtonVarianttypetype ButtonVariant = primary | secondary | ghost | danger@cofob/design-system-react@cofob/design-system-react/typesVisual variants accepted by Button and IconButton.
SurfaceVarianttypetype SurfaceVariant = default | elevated | outlined | interactive@cofob/design-system-react@cofob/design-system-react/typesCard surface variants; legacy plain, raised, and muted aliases are deprecated.
LucideIcontypetype LucideIcon = ComponentType<SVGProps<SVGSVGElement>>@cofob/design-system-react@cofob/design-system-react/typesReact icon component shape used by optional icon props.
LinkModelinterfaceinterface LinkModel@cofob/design-system-react@cofob/design-system-react/typesPortable navigation link model.
LinkItemtypetype LinkItem = LinkModel@cofob/design-system-react@cofob/design-system-react/typesReact-facing alias for the portable link model.
ResponsiveImageModelinterfaceinterface ResponsiveImageModel@cofob/design-system-react@cofob/design-system-react/typesPortable responsive image model.
AnimatedStickerModeltypetype AnimatedStickerModel = CssAnimatedStickerModel@cofob/design-system-react@cofob/design-system-react/typesReact-facing alias for a converted animated sticker with an inline SVG or WebP first frame.
ImageSourcetypetype ImageSource = ResponsiveImageModel@cofob/design-system-react@cofob/design-system-react/typesReact-facing alias for a responsive image source.
PostModelinterfaceinterface PostModel@cofob/design-system-react@cofob/design-system-react/typesPortable post-card content model with display and machine-readable published/updated dates.
PostSummarytypetype PostSummary = PostModel@cofob/design-system-react@cofob/design-system-react/typesReact-facing alias for portable post summaries.
ChatMessageModelinterfaceinterface ChatMessageModel@cofob/design-system-react@cofob/design-system-react/typesPortable chat message model with body/text fallback and optional safe links.
ChatModelinterfaceinterface ChatModel@cofob/design-system-react@cofob/design-system-react/typesPortable chat thread model.
ChatMessageinterfaceinterface ChatMessage@cofob/design-system-react@cofob/design-system-react/typesReact chat message with a ReactNode body for idiomatic composition.
MenuIteminterfaceinterface MenuItem@cofob/design-system-react@cofob/design-system-react/typesDropdown menu item label, target, and state.
TabIteminterfaceinterface TabItem@cofob/design-system-react@cofob/design-system-react/typesBase tab identifier, label, and disabled state.
AccordionIteminterfaceinterface AccordionItem@cofob/design-system-react@cofob/design-system-react/typesBase accordion identifier, heading, and disabled state.
PaginationIteminterfaceinterface PaginationItem@cofob/design-system-react@cofob/design-system-react/typesPage number, optional URL, and accessible label.
FooterGroupinterfaceinterface FooterGroup@cofob/design-system-react@cofob/design-system-react/typesFooter section title and its portable links.
IconContentinterfaceinterface IconContent@cofob/design-system-react@cofob/design-system-react/typesAccepts either a Lucide component or arbitrary React icon node.
ToastInputinterfaceinterface ToastInput@cofob/design-system-react@cofob/design-system-react/typesReact notification input with a ReactNode description.
ToastRecordinterfaceinterface ToastRecord@cofob/design-system-react@cofob/design-system-react/typesNormalized notification record stored by ToastProvider.

Static component prop types

These prop contracts are exported from the root and static entrypoints; the linked component pages describe their visual states and live behavior.

ExportContractAvailable fromPurpose
ThemeScriptPropsinterfaceinterface ThemeScriptProps@cofob/design-system-react@cofob/design-system-react/staticStorage key and CSP nonce for ThemeScript.
SkipLinkPropsinterfaceinterface SkipLinkProps@cofob/design-system-react@cofob/design-system-react/staticNative anchor props plus the default main-content target.
HeadingPropsinterfaceinterface HeadingProps@cofob/design-system-react@cofob/design-system-react/staticHeading level, display size, and native heading attributes.
TextPropsinterfaceinterface TextProps@cofob/design-system-react@cofob/design-system-react/staticPolymorphic text element, size, tone, and native attributes.
LinkPropsinterfaceinterface LinkProps@cofob/design-system-react@cofob/design-system-react/staticAnchor attributes and external-link presentation.
ProsePropsinterfaceinterface ProseProps extends HTMLAttributes<HTMLElement>@cofob/design-system-react@cofob/design-system-react/staticNarrow, default, or full prose measure and native article attributes.
ContainerPropsinterfaceinterface ContainerProps@cofob/design-system-react@cofob/design-system-react/staticContainer width and native div attributes.
SectionPropsinterfaceinterface SectionProps@cofob/design-system-react@cofob/design-system-react/staticSection spacing, semantic surface, and native attributes.
StackPropsinterfaceinterface StackProps@cofob/design-system-react@cofob/design-system-react/staticVertical gap and alignment contract.
InlinePropsinterfaceinterface InlineProps@cofob/design-system-react@cofob/design-system-react/staticHorizontal gap, alignment, justification, and wrapping contract.
ButtonPropsinterfaceinterface ButtonProps@cofob/design-system-react@cofob/design-system-react/staticButton variant, size, loading state, icons, and native attributes.
IconButtonPropsinterfaceinterface IconButtonProps@cofob/design-system-react@cofob/design-system-react/staticAccessible icon-only Button contract.
FieldPropsinterfaceinterface FieldProps@cofob/design-system-react@cofob/design-system-react/staticLabel, hint, error, required state, and composed field control.
TextFieldPropsinterfaceinterface TextFieldProps@cofob/design-system-react@cofob/design-system-react/staticInput attributes plus integrated field presentation.
TextareaPropsinterfaceinterface TextareaProps@cofob/design-system-react@cofob/design-system-react/staticTextarea attributes plus integrated field presentation.
SelectPropsinterfaceinterface SelectProps@cofob/design-system-react@cofob/design-system-react/staticSelect attributes, options, and integrated field presentation.
CheckboxPropsinterfaceinterface CheckboxProps@cofob/design-system-react@cofob/design-system-react/staticCheckbox label, description, size, error, and native attributes.
SwitchPropstypetype SwitchProps = CheckboxProps@cofob/design-system-react@cofob/design-system-react/staticCheckbox-compatible props rendered as a switch.
CaptchaPropsinterfaceinterface CaptchaProps extends ButtonHTMLAttributes<HTMLButtonElement>@cofob/design-system-react@cofob/design-system-react/staticControlled visual state, labels, and native button attributes without verification logic.
BadgePropsinterfaceinterface BadgeProps@cofob/design-system-react@cofob/design-system-react/staticBadge tone, size, variant, and span attributes.
TagPropsinterfaceinterface TagProps@cofob/design-system-react@cofob/design-system-react/staticTag tone, size, optional remove action, and span attributes.
AlertPropsinterfaceinterface AlertProps@cofob/design-system-react@cofob/design-system-react/staticAlert tone, title, icon, actions, and region attributes.
CardPaddingtypetype CardPadding = none | sm | md | lg@cofob/design-system-react@cofob/design-system-react/staticCard internal spacing scale.
CardPropstypetype CardProps = CardDivProps | CardAnchorProps@cofob/design-system-react@cofob/design-system-react/staticCard surface/padding contract as a div or link.
EmptyStatePropsinterfaceinterface EmptyStateProps@cofob/design-system-react@cofob/design-system-react/staticEmpty-state title, description, icon, action, and container attributes.
TablePropsinterfaceinterface TableProps extends TableHTMLAttributes<HTMLTableElement>@cofob/design-system-react@cofob/design-system-react/staticAccessible scroll container, caption, density, striping, minimum width, and native table attributes.
PaginationPropsinterfaceinterface PaginationProps@cofob/design-system-react@cofob/design-system-react/staticPage items, current value, adjacent labels, and nav attributes.
BlueLinePropsinterfaceinterface BlueLineProps@cofob/design-system-react@cofob/design-system-react/staticBrand underline animation and rainbow options.
NavbarPropsinterfaceinterface NavbarProps@cofob/design-system-react@cofob/design-system-react/staticBrand, links, actions, responsive collapse, menu presentation, state, and native navigation attributes.
FooterPropsinterfaceinterface FooterProps@cofob/design-system-react@cofob/design-system-react/staticFooter brand, grouped links, legal content, and native attributes.
ResponsiveImagePropsinterfaceinterface ResponsiveImageProps@cofob/design-system-react@cofob/design-system-react/staticPortable source plus loading behavior and native image attributes.
AvatarPropsinterfaceinterface AvatarProps@cofob/design-system-react@cofob/design-system-react/staticResponsive avatar source, accessible name or decorative alt, initials fallback, size, loading, and referrer policy.
InlineEmojiPropsinterfaceinterface InlineEmojiProps@cofob/design-system-react@cofob/design-system-react/staticSemantic inline image metadata and native image attributes.
MediaGridPropsinterfaceinterface MediaGridProps@cofob/design-system-react@cofob/design-system-react/staticSemantic list or div container for responsive image, video, and audio media.
PostCardPropsinterfaceinterface PostCardProps@cofob/design-system-react@cofob/design-system-react/staticLinked post model, heading level, and anchor attributes.
LatestPostCardPropsinterfaceinterface LatestPostCardProps@cofob/design-system-react@cofob/design-system-react/staticLinked latest-post card data, heading level, label, and anchor attributes.
SearchResultCardPropsinterfaceinterface SearchResultCardProps@cofob/design-system-react@cofob/design-system-react/staticLinked search result data, highlighting, heading level, and anchor attributes.
ChatThreadPropsinterfaceinterface ChatThreadProps@cofob/design-system-react@cofob/design-system-react/staticReact chat messages, accessible label, and list attributes.
StickerPropsinterfaceinterface StickerProps@cofob/design-system-react@cofob/design-system-react/staticSticker tone, rotation, custom style, and span attributes.
BreadcrumbIteminterfaceinterface BreadcrumbItem { label; href?; current? }@cofob/design-system-react@cofob/design-system-react/staticOne hierarchical navigation ancestor or current-page endpoint.
BreadcrumbsPropsinterfaceinterface BreadcrumbsProps@cofob/design-system-react@cofob/design-system-react/staticOrdered breadcrumb items, accessible label, and navigation attributes.
RadioPropsinterfaceinterface RadioProps@cofob/design-system-react@cofob/design-system-react/staticNative radio attributes plus visible label, description, and size.
RadioOptioninterfaceinterface RadioOption { value; label; description?; disabled? }@cofob/design-system-react@cofob/design-system-react/staticPortable option record rendered by RadioGroup.
RadioGroupPropsinterfaceinterface RadioGroupProps@cofob/design-system-react@cofob/design-system-react/staticLabelled options, controlled/default value, validation, orientation, and fieldset attributes.
ProgressPropsinterfaceinterface ProgressProps@cofob/design-system-react@cofob/design-system-react/staticDeterminate or indeterminate value, labels, maximum, and native progress attributes.
SpinnerPropsinterfaceinterface SpinnerProps@cofob/design-system-react@cofob/design-system-react/staticAccessible status label, size, and span attributes for a loading spinner.
CircularProgressPropsinterfaceinterface CircularProgressProps@cofob/design-system-react@cofob/design-system-react/staticDeterminate circular value, maximum, accessible label, size, formatting, and span attributes.
SkeletonPropsinterfaceinterface SkeletonProps@cofob/design-system-react@cofob/design-system-react/staticPlaceholder variant, dimensions, style, and span attributes.
SeparatorPropsinterfaceinterface SeparatorProps@cofob/design-system-react@cofob/design-system-react/staticHorizontal or vertical orientation, decorative semantics, and native attributes.
StepperIteminterfaceinterface StepperItem { id; label; description?; href?; disabled?; state? }@cofob/design-system-react@cofob/design-system-react/staticOne complete, current, or upcoming step with optional navigation.
StepperPropsinterfaceinterface StepperProps@cofob/design-system-react@cofob/design-system-react/staticOrdered steps, current ID, orientation, activation callback, and navigation attributes.

Client component prop types

Interactive prop contracts are exported from the root and client entrypoints.

ExportContractAvailable fromPurpose
AnimatedStickerPropsinterfaceinterface AnimatedStickerProps { sticker; alt; playback?; preload? }@cofob/design-system-react@cofob/design-system-react/clientConverted sticker model, accessible name, auto/static playback mode, video preload hint, and span attributes.
AnimatedStickerTogglePropsinterfaceinterface AnimatedStickerToggleProps { enabled?; defaultEnabled?; label?; description?; onEnabledChange? }@cofob/design-system-react@cofob/design-system-react/clientControlled or default global animation state, visible copy, callback, and native input attributes.
CodeBlockPropsinterfaceinterface CodeBlockProps@cofob/design-system-react@cofob/design-system-react/clientCode text, optional language display, copy labels, feedback duration, and div attributes.
TerminalCodeBlockPropsinterfaceinterface TerminalCodeBlockProps@cofob/design-system-react@cofob/design-system-react/clientTerminal entries, prompt, per-command copy behavior, output label, and div attributes.
ThemeProviderPropsinterfaceinterface ThemeProviderProps@cofob/design-system-react@cofob/design-system-react/clientControlled or default theme preference, storage key, callback, and children.
ThemeTogglePropsinterfaceinterface ThemeToggleProps@cofob/design-system-react@cofob/design-system-react/clientTheme cycle, format callback, size, and button attributes.
DialogPropsinterfaceinterface DialogProps@cofob/design-system-react@cofob/design-system-react/clientControlled/default open state, trigger, title, actions, and dialog attributes.
PopoverPropsinterfaceinterface PopoverProps@cofob/design-system-react@cofob/design-system-react/clientControlled/default open state, trigger, placement, and popover attributes.
DropdownMenuPropsinterfaceinterface DropdownMenuProps@cofob/design-system-react@cofob/design-system-react/clientMenu items, selection callback, trigger, and controlled/default open state.
ReactTabIteminterfaceinterface ReactTabItem extends TabItem@cofob/design-system-react@cofob/design-system-react/clientTab model with ReactNode panel content.
TabsPropsinterfaceinterface TabsProps@cofob/design-system-react@cofob/design-system-react/clientTab items, controlled/default value, orientation, activation, and callback.
ReactAccordionIteminterfaceinterface ReactAccordionItem extends AccordionItem@cofob/design-system-react@cofob/design-system-react/clientAccordion model with ReactNode content.
AccordionPropsinterfaceinterface AccordionProps@cofob/design-system-react@cofob/design-system-react/clientAccordion items, controlled/default values, multiple mode, and callback.
TooltipPropsinterfaceinterface TooltipProps@cofob/design-system-react@cofob/design-system-react/clientTrigger, tooltip content, delay, placement, and wrapper attributes.
ToastProviderPropsinterfaceinterface ToastProviderProps@cofob/design-system-react@cofob/design-system-react/clientNotification limit, default duration, and provider children.
ToastViewportPropsinterfaceinterface ToastViewportProps@cofob/design-system-react@cofob/design-system-react/clientViewport position, label, and ordered-list attributes.
ComboboxOptioninterfaceinterface ComboboxOption { value; label; description?; disabled? }@cofob/design-system-react@cofob/design-system-react/clientFilterable listbox option rendered by Combobox.
ComboboxPropsinterfaceinterface ComboboxProps@cofob/design-system-react@cofob/design-system-react/clientOptions, controlled selection/query, accessible copy, callbacks, and root/input attributes.
DrawerPropsinterfaceinterface DrawerProps@cofob/design-system-react@cofob/design-system-react/clientControlled/default open state, edge, trigger, title, actions, and dialog attributes.
FileUploadPropsinterfaceinterface FileUploadProps@cofob/design-system-react@cofob/design-system-react/clientControlled files, native filters, count/size limits, drop zone copy, and callbacks.
SliderPropsinterfaceinterface SliderProps@cofob/design-system-react@cofob/design-system-react/clientControlled/default range value, output formatting, callback, and input attributes.
AudioPlayerLabelsinterfaceinterface AudioPlayerLabels@cofob/design-system-react@cofob/design-system-react/clientLocalized playback, timeline, mute, and volume control labels.
AudioPlayerPropsinterfaceinterface AudioPlayerProps@cofob/design-system-react@cofob/design-system-react/clientAudio source, duration fallback, localized labels, disabled state, and media/root attributes.
VideoPlayerLabelsinterfaceinterface VideoPlayerLabels@cofob/design-system-react@cofob/design-system-react/clientLocalized playback, timeline, mute, volume, and fullscreen control labels.
VideoPlayerPropsinterfaceinterface VideoPlayerProps@cofob/design-system-react@cofob/design-system-react/clientVideo source, caption, aspect ratio, duration fallback, themed controls, media, and figure attributes.

Svelte

@cofob/design-system-svelte · Svelte 5 components, stores, theme helpers, and portable types for SvelteKit or plain Svelte.

Published entrypoints

@cofob/design-system-svelteSvelte

All Svelte components, helpers, stores, and public types.

Import pattern

svelte
<script lang="ts">
  import "@cofob/design-system-css/index.css";
  import {
    ToastProvider,
    ToastViewport,
    toast,
    dismissToast,
    clearToasts,
    toasts,
  } from "@cofob/design-system-svelte";

  const notificationId = toast("Saved", { tone: "success" });
</script>

Toast store and helpers

A framework-native writable store and imperative helpers drive ToastViewport without touching browser globals during module evaluation.

ExportContractAvailable fromPurpose
toastsstoreconst toasts: Writable<ToastRecord[]>@cofob/design-system-svelteReadable and writable notification store consumed by ToastViewport.
toastfunctiontoast(input: ToastInput): string; toast(message, options?): string@cofob/design-system-svelteAdds or replaces a notification and returns its stable ID.
dismissToastfunctiondismissToast(id: string): void@cofob/design-system-svelteDismisses one notification and clears its timer.
clearToastsfunctionclearToasts(): void@cofob/design-system-svelteClears every notification and pending dismissal timer.

Theme helpers

SSR-safe helpers used by the Svelte provider and available for custom integrations.

ExportContractAvailable fromPurpose
resolvedThemefunctionresolvedTheme(preference: ThemePreference): "light" | "dark"@cofob/design-system-svelteResolves a preference, returning light during SSR for the system value.
applyThemefunctionapplyTheme(preference: ThemePreference, root?: HTMLElement): void@cofob/design-system-svelteWrites theme preference, resolved theme, and color-scheme to a root in the browser.

Portable and composition types

Shared contracts mirror the CSS and React adapters while using Svelte snippets for composable content.

ExportContractAvailable fromPurpose
ThemePreferencetypetype ThemePreference = "light" | "dark" | "system"@cofob/design-system-sveltePersisted user theme preference.
Sizetypetype Size = "sm" | "md" | "lg"@cofob/design-system-svelteShared component size scale.
Tonetypetype Tone = neutral | accent | info | success | warning | danger@cofob/design-system-svelteShared semantic tone scale.
CaptchaStatetypetype CaptchaState = idle | verifying | success | error@cofob/design-system-svelteControlled visual state re-exported from the CSS package.
CaptchaLabelsinterfaceinterface CaptchaLabels@cofob/design-system-svelteLocalized copy for each Captcha state.
TerminalCodeEntryinterfaceinterface TerminalCodeEntry { command: string; output?: string }@cofob/design-system-sveltePortable terminal command and optional captured output.
ButtonVarianttypetype ButtonVariant = primary | secondary | ghost | danger@cofob/design-system-svelteVisual variants accepted by Button and IconButton.
LinkModelinterfaceinterface LinkModel@cofob/design-system-sveltePortable navigation link model.
LinkItemtypetype LinkItem = LinkModel@cofob/design-system-svelteSvelte-facing alias for the portable link model.
ResponsiveImageModelinterfaceinterface ResponsiveImageModel@cofob/design-system-sveltePortable responsive image source model.
AnimatedStickerModeltypetype AnimatedStickerModel = CssAnimatedStickerModel@cofob/design-system-svelteSvelte-facing alias for a converted animated sticker with an inline SVG or WebP first frame.
ImageSourcetypetype ImageSource = ResponsiveImageModel@cofob/design-system-svelteSvelte-facing alias for a responsive image source.
PostModelinterfaceinterface PostModel@cofob/design-system-sveltePortable post-card content model with display and machine-readable published/updated dates.
PostSummarytypetype PostSummary = PostModel@cofob/design-system-svelteSvelte-facing alias for a portable post summary.
ChatMessageModelinterfaceinterface ChatMessageModel@cofob/design-system-sveltePortable chat message model with body/text fallback and optional safe links.
ChatModelinterfaceinterface ChatModel@cofob/design-system-sveltePortable chat thread model.
ChatMessageinterfaceinterface ChatMessage@cofob/design-system-svelteSvelte chat message with a string or Snippet body.
MenuIteminterfaceinterface MenuItem@cofob/design-system-svelteDropdown menu item label, target, and state.
TabIteminterfaceinterface TabItem@cofob/design-system-svelteTab model with optional string or Snippet content.
AccordionIteminterfaceinterface AccordionItem@cofob/design-system-svelteAccordion model with optional string or Snippet content.
PaginationIteminterfaceinterface PaginationItem@cofob/design-system-sveltePage number, optional URL, and accessible label.
SelectOptioninterfaceinterface SelectOption@cofob/design-system-svelteSelect value, label, and disabled state.
FooterGroupinterfaceinterface FooterGroup@cofob/design-system-svelteFooter section title and portable links.
ToastOptionsinterfaceinterface ToastOptions@cofob/design-system-svelteOptions for the string overload of toast, including an optional action.
ToastInputinterfaceinterface ToastInput@cofob/design-system-svelteNotification input with a string or Snippet description.
ToastRecordinterfaceinterface ToastRecord@cofob/design-system-svelteNormalized notification record stored in toasts.

Asciinema player

@cofob/design-system-asciinema-player · SSR-safe Native, React, and Svelte terminal-recording player adapters with design-system presentation.

Published entrypoints

@cofob/design-system-asciinema-playerJavaScript

Framework-neutral controller, lifecycle contracts, labels, and upstream player types.

@cofob/design-system-asciinema-player/reactReact

Client-lifecycle React component with an SSR-rendered design-system fallback.

@cofob/design-system-asciinema-player/svelteSvelte

Svelte 5 component with bindable player state and SSR-rendered fallback.

@cofob/design-system-asciinema-player/styles.cssCSS

Upstream player CSS plus token-driven cofob theme and accessibility overrides.

Import pattern

typescript
import "@cofob/design-system-css/index.css";
import "@cofob/design-system-asciinema-player/styles.css";
import {
  createAsciinemaPlayerController,
} from "@cofob/design-system-asciinema-player";

const controller = createAsciinemaPlayerController(figure, {
  source: "/recordings/example.cast",
  label: "Build demonstration",
  fallbackHref: "/recordings/example",
});

await controller.ready;
controller.destroy();

Controller and shell

Mount the browser-only upstream player into a portable, server-rendered data-attribute shell.

ExportContractAvailable fromPurpose
createAsciinemaPlayerControllerfunctioncreateAsciinemaPlayerController(root, config): AsciinemaPlayerController@cofob/design-system-asciinema-playerDynamically imports and mounts the player, updates fallback state, and returns deterministic cleanup.
AsciinemaPlayerControllerinterfaceinterface AsciinemaPlayerController { ready; player; destroy() }@cofob/design-system-asciinema-playerCurrent upstream handle, mount promise, and idempotent disposal contract.
AsciinemaPlayerConfiginterfaceinterface AsciinemaPlayerConfig@cofob/design-system-asciinema-playerSource, upstream options, fallback, labels, and lifecycle callbacks used by the controller.
AsciinemaPlayerLabelsinterfaceinterface AsciinemaPlayerLabels@cofob/design-system-asciinema-playerPortable loading, error, and fallback-link copy shared by every adapter.
DEFAULT_ASCIINEMA_PLAYER_LABELSconstantconst DEFAULT_ASCIINEMA_PLAYER_LABELS: Readonly<AsciinemaPlayerLabels>@cofob/design-system-asciinema-playerEnglish default copy for the player fallback shell.
resolveAsciinemaPlayerLabelsfunctionresolveAsciinemaPlayerLabels(labels?): AsciinemaPlayerLabels@cofob/design-system-asciinema-playerMerges partial consumer copy with the immutable English defaults.

Upstream player contracts

The supported asciinema-player 3.17.0 source, option, control, parser, and event types.

ExportContractAvailable fromPurpose
Sourcetypetype Source = string | UrlSource | DataSource@cofob/design-system-asciinema-playerRecording URL, URL configuration, or in-memory recording source.
UrlSourceinterfaceinterface UrlSource@cofob/design-system-asciinema-playerURL-backed source with fetch, parser, encoding, and timing controls.
DataSourceinterfaceinterface DataSource@cofob/design-system-asciinema-playerImmediate or lazily produced recording data with parser controls.
Optionsinterfaceinterface Options@cofob/design-system-asciinema-playerComplete upstream playback, sizing, controls, terminal, theme, audio, and logging options.
Playerinterfaceinterface Player@cofob/design-system-asciinema-playerImperative playback, seeking, timing, event, element, and disposal handle.
SeekLocationtypetype SeekLocation = number | percentage | marker location@cofob/design-system-asciinema-playerAbsolute, percentage, or marker-relative destination accepted by Player.seek.
Markertypetype Marker = number | [time, label]@cofob/design-system-asciinema-playerUnlabelled or labelled timeline marker supplied through options.
InputEventinterfaceinterface InputEvent { data: string }@cofob/design-system-asciinema-playerRecorded terminal input payload emitted by the player.
MarkerEventinterfaceinterface MarkerEvent { index; time; label }@cofob/design-system-asciinema-playerMarker index, timestamp, and label emitted during playback.
Loggerinterfaceinterface Logger@cofob/design-system-asciinema-playerConsole-compatible logging sink accepted by upstream options.
BuiltInParsertypetype BuiltInParser = asciicast | typescript | ttyrec@cofob/design-system-asciinema-playerNames of the recording parsers included by asciinema-player.
Parsertypetype Parser = (data, options) => Recording | Promise<Recording>@cofob/design-system-asciinema-playerCustom recording parser callback contract.
ParserOptionsinterfaceinterface ParserOptions { encoding: string }@cofob/design-system-asciinema-playerEncoding context supplied to a custom parser.
Recordinginterfaceinterface Recording@cofob/design-system-asciinema-playerNormalized terminal dimensions, events, theme, and idle limit returned by parsers.
RecordingDatatypetype RecordingData@cofob/design-system-asciinema-playerText, buffer, response, array, or object input accepted by recording parsers.
RecordingEventtypetype RecordingEvent = [time, code, data]@cofob/design-system-asciinema-playerNormalized timestamped event consumed by the terminal driver.
RecordingEventCodetypetype RecordingEventCode = o | i | r | m@cofob/design-system-asciinema-playerOutput, input, resize, and marker recording-event discriminator.

Sticker assets

@cofob/design-system-stickers · Optimized Telegram sticker media, sharded metadata, and generated React and Svelte components.

Published entrypoints

@cofob/design-system-stickersJavaScript

Eight lightweight pack descriptors, URL helpers, and shared metadata types. Sticker catalogs and SVG manifests are opt-in subpaths.

@cofob/design-system-stickers/reactReact

Named React components for all stickers; isolated per-sticker subpaths are also available.

@cofob/design-system-stickers/svelteSvelte

Named Svelte components for all stickers; isolated per-sticker subpaths are also available.

Import pattern

typescript
import AnimatedChris001 from "@cofob/design-system-stickers/react/AnimatedChris001";
import animatedChris from "@cofob/design-system-stickers/catalogs/animated-chris" with { type: "json" };

// Copy published media to /stickers during the application build.
// cf-stickers copy --out-dir public/stickers
const firstSticker = animatedChris.stickers[0];

Catalog and resolution

The root stays small; consumers explicitly import one pack catalog, one sticker manifest, or one generated component.

ExportContractAvailable fromPurpose
packsconstantconst packs: readonly StickerPack[]@cofob/design-system-stickersMetadata for the eight attributed packs, including each opt-in catalog path.
DEFAULT_STICKER_ASSET_BASEconstantconst DEFAULT_STICKER_ASSET_BASE = "/stickers"@cofob/design-system-stickersDefault public base used by generated sticker components.
resolveStickerAssetfunctionresolveStickerAsset(sticker, baseUrl?): string@cofob/design-system-stickersResolves a content-hashed asset path against a consumer's public base URL.
resolveAnimatedStickerfunctionresolveAnimatedSticker(sticker, baseUrl?): AnimatedStickerModel@cofob/design-system-stickersAdapts a full animated manifest to the shared runtime component model.

Metadata types

Serializable contracts shared by generated modules and pack catalogs.

ExportContractAvailable fromPurpose
StickerPackinterfaceinterface StickerPack@cofob/design-system-stickersAttributed pack metadata and the path of its sharded catalog.
StickerAssetKindtypetype StickerAssetKind = "static" | "animated"@cofob/design-system-stickersDiscriminator for static and animated sticker records.
AnimatedStickerSourceFormattypetype AnimatedStickerSourceFormat = "tgs" | "video"@cofob/design-system-stickersOriginal Telegram format of an optimized animation.
StaticStickerAssetinterfaceinterface StaticStickerAsset@cofob/design-system-stickersMetadata for an optimized transparent WebP sticker.
AnimatedStickerAssettypetype AnimatedStickerAsset = VectorAnimatedStickerAsset | VideoAnimatedStickerAsset@cofob/design-system-stickersFull animated metadata with optimized WebM and an inline SVG or WebP first frame.
VectorAnimatedStickerAssetinterfaceinterface VectorAnimatedStickerAsset { sourceFormat: "tgs"; skeletonSvg; ... }@cofob/design-system-stickersTGS-derived WebM metadata with a trusted inline SVG first frame.
VideoAnimatedStickerAssetinterfaceinterface VideoAnimatedStickerAsset { sourceFormat: "video"; firstFrameAssetPath; firstFrameSrc; ... }@cofob/design-system-stickersVideo-derived WebM metadata with an optimized content-hashed WebP first frame.
StickerAssettypetype StickerAsset = StaticStickerAsset | AnimatedStickerAsset@cofob/design-system-stickersUnion of full static and animated sticker metadata.
StickerAssetIndexEntrytypetype StickerAssetIndexEntry@cofob/design-system-stickersLightweight catalog record that points to a separate full manifest.

Build-time assets

@cofob/design-system-assets · Node-only conversion of validated Telegram TGS animations into transparent WebM and trusted inline SVG manifests.

Published entrypoints

@cofob/design-system-assetsJavaScript

TGS conversion API and manifest types. The cf-tgs executable provides the matching CLI.

Import pattern

typescript
import { convertTgs } from "@cofob/design-system-assets";

const manifest = await convertTgs({
  input: "stickers/chris.tgs",
  outputDir: "public/stickers/chris",
  publicBase: "/stickers/chris",
});

// TGS manifests keep a trusted skeletonSvg inline. Video sticker manifests use firstFrameSrc.

TGS conversion

Validate Telegram Lottie constraints, render frame zero, sanitize its SVG, and encode transparent VP9 WebM.

ExportContractAvailable fromPurpose
convertTgsfunctionconvertTgs(options: ConvertTgsOptions): Promise<TgsConversionManifest>@cofob/design-system-assetsWrites a content-hashed WebM and stable JSON manifest with an inline SVG skeleton.
ConvertTgsOptionsinterfaceinterface ConvertTgsOptions@cofob/design-system-assetsInput, output, public URL, FFmpeg, name, output size, compatibility, and VP9 CRF options.
TgsConversionManifestinterfaceinterface TgsConversionManifest@cofob/design-system-assetsVersioned sticker model, media metadata, and SHA-256 hashes for source, WebM, and SVG.
AnimatedStickerModelinterfaceinterface AnimatedStickerModel { src; skeletonSvg; width; height }@cofob/design-system-assetsSerializable runtime model embedded into SSR output by framework adapters.