{"id":30345785,"url":"https://github.com/navilan/duct-ui","last_synced_at":"2025-08-18T14:12:05.002Z","repository":{"id":305087396,"uuid":"1020786293","full_name":"navilan/duct-ui","owner":"navilan","description":"An experimental framework / library for building dynamic user interfaces","archived":false,"fork":false,"pushed_at":"2025-08-10T20:45:32.000Z","size":1590,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-10T22:22:14.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://duct-ui.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navilan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T11:48:14.000Z","updated_at":"2025-08-03T00:36:23.000Z","dependencies_parsed_at":"2025-07-18T09:30:17.164Z","dependency_job_id":"0f7eb19a-725d-4507-813f-431ff914bdfa","html_url":"https://github.com/navilan/duct-ui","commit_stats":null,"previous_names":["navilan/duct-ui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/navilan/duct-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilan%2Fduct-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilan%2Fduct-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilan%2Fduct-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilan%2Fduct-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navilan","download_url":"https://codeload.github.com/navilan/duct-ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navilan%2Fduct-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271005436,"owners_count":24683333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-18T14:12:02.317Z","updated_at":"2025-08-18T14:12:04.994Z","avatar_url":"https://github.com/navilan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Duct UI\n\n![NPM Version](https://img.shields.io/npm/v/%40duct-ui%2Fcore)\n\nA DOM-first UI framework with JSX templates, standard component library and explicit lifecycle management.\n\n\u003e **⚠️ Under Construction**: This library is currently in early development and may exhibit unexpected behavior. APIs are subject to change and components may not be fully stable. Use with caution in production environments.\n\n## Quick Start\n\n```bash\nnpm install @duct-ui/core @duct-ui/components\n```\n\n```typescript\nimport { createRef } from '@duct-ui/core'\nimport Button from '@duct-ui/components/button/button'\n\nconst buttonRef = createRef\u003cButtonLogic\u003e()\n\nfunction MyApp() {\n  return (\n    \u003cButton\n      ref={buttonRef}\n      label=\"Click me\"\n      class=\"btn btn-primary\"\n      on:click={() =\u003e console.log('Clicked!')}\n    /\u003e\n  )\n}\n```\n\n## Core Concepts\n\n### Component Logic Access\nAccess component methods via refs:\n\n```typescript\nconst buttonRef = createRef\u003cButtonLogic\u003e()\n\n// In render\n\u003cButton ref={buttonRef} label=\"Toggle\" /\u003e\n\n// Access methods\nbuttonRef.current?.setDisabled(true)\n```\n\n### Lifecycle Phases\nComponents follow explicit lifecycle phases:\n1. **Render**: JSX structure creation\n2. **Load**: Async data loading (optional)\n3. **Bind**: Event listeners and logic setup\n4. **Release**: Cleanup when component unmounts\n\n## Building Components\n\n```typescript\nimport { createBlueprint, type BaseProps, type BaseComponentEvents } from '@duct-ui/core'\n\ninterface MyComponentProps {\n  label: string\n  disabled?: boolean\n  'on:click'?: (el: HTMLElement) =\u003e void\n}\n\ninterface MyComponentEvents extends BaseComponentEvents {\n  click: (el: HTMLElement) =\u003e void\n}\n\ninterface MyComponentLogic {\n  setDisabled: (disabled: boolean) =\u003e void\n}\n\nfunction render(props: BaseProps\u003cMyComponentProps\u003e) {\n  const { disabled = false, label, ...moreProps} = props;\n  return (\n    \u003cbutton\n      class=\"btn\"\n      disabled={disabled}\n      {...moreProps}\n    \u003e\n      {label}\n    \u003c/button\u003e\n  )\n}\n\nfunction bind(el: HTMLElement, eventEmitter, props): BindReturn\u003cMyComponentLogic\u003e {\n  const button = el as HTMLButtonElement\n\n  function handleClick() {\n    eventEmitter.emit('click', button)\n  }\n\n  button.addEventListener('click', handleClick)\n\n  return {\n    setDisabled: (disabled) =\u003e button.disabled = disabled,\n    release: () =\u003e button.removeEventListener('click', handleClick)\n  }\n}\n\nconst MyComponent = createBlueprint\u003cMyComponentProps, MyComponentEvents, MyComponentLogic\u003e(\n  { id: 'my-app/my-component' },\n  render,\n  { bind }\n)\n\nexport default MyComponent\n```\n\n## Packages\n\n- **@duct-ui/core**: Core framework runtime and utilities\n- **@duct-ui/components**: Pre-built component library\n- **@duct-ui/cli**: Static site generation and build tools\n- **@duct-ui/demo**: Interactive demos and documentation\n\n## Static Site Generation\n\nDuct includes first-class support for static site generation with file-based routing:\n\n```bash\nnpm install @duct-ui/cli --save-dev\n```\n\nBuild fast, SEO-friendly static sites with Duct components using file-based routing, dynamic routes, and Nunjucks layouts. Perfect for documentation sites, blogs, and marketing pages.\n\n[→ Learn more about SSG](https://duct-ui.org/docs/static-site-generation)\n\n## Philosophy\n\n1. **Don't hide the DOM** - Direct DOM access and manipulation\n2. **Little magic, lots of logic** - Explicit over implicit\n3. **Easy packaging, simple reuse** - Component composition and distribution\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavilan%2Fduct-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavilan%2Fduct-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavilan%2Fduct-ui/lists"}