{"id":46468787,"url":"https://github.com/fuunnx/cycle-element","last_synced_at":"2026-03-06T06:00:14.543Z","repository":{"id":37973224,"uuid":"200926734","full_name":"fuunnx/cycle-element","owner":"fuunnx","description":"A simple way to package your Cycle.js app and use it anywhere on the web","archived":false,"fork":false,"pushed_at":"2023-01-05T01:46:16.000Z","size":1605,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-10T06:01:34.611Z","etag":null,"topics":["custom-elements","cyclejs","snabbdom"],"latest_commit_sha":null,"homepage":"","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/fuunnx.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}},"created_at":"2019-08-06T21:27:04.000Z","updated_at":"2023-08-10T06:01:34.612Z","dependencies_parsed_at":"2023-02-03T04:32:34.364Z","dependency_job_id":null,"html_url":"https://github.com/fuunnx/cycle-element","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/fuunnx/cycle-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuunnx%2Fcycle-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuunnx%2Fcycle-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuunnx%2Fcycle-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuunnx%2Fcycle-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuunnx","download_url":"https://codeload.github.com/fuunnx/cycle-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuunnx%2Fcycle-element/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["custom-elements","cyclejs","snabbdom"],"created_at":"2026-03-06T06:00:07.009Z","updated_at":"2026-03-06T06:00:14.397Z","avatar_url":"https://github.com/fuunnx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**This library is a WIP. It's working but it's not published yet. It has not a full documentation yet either**\n\n# Cycle Element -ify\n\nA simple way to package your Cycle.js app and use it anywhere on the web :\n\n- Inside another cycle app\n- Inside another framework, you name it\n\nThanks to an out of the box `custom-element v2` and `snabbdom hooks` support\n\n## Usage\n\nInstall the package\n\n`npm install --save cycle-element`\n\n`pnpm install --save cycle-element`\n\n`yarn add cycle-element`\n\n### Basic usage\n\n```javascript\nimport Snabbdom from 'snabbdom-pragma'\nimport { customElementify, snabbdomElementify } from 'cycle-element'\n\nfunction CycleComponent(sources: ComponentSources) {\n\tconst { props } = sources\n\n\treturn {\n\t\tDOM: props.get('name').map((name: string) =\u003e {\n\t\t\treturn (\n\t\t\t\t\u003croot\u003e\n\t\t\t\t\t\u003ch1\u003eHello {name}\u003c/h1\u003e\n\t\t\t\t\u003c/root\u003e\n\t\t\t)\n\t\t}),\n\t}\n}\n\nconst helloWorld1 = define('hello-world', customElementify(CycleComponent, {\n\tprops: { name: String },\n}))\n\nconst helloWorld2 = snabbdomElementify(CycleComponent, {\n\tprops: { name: String },\n})\n\nfunction main() {\n\treturn {\n\t\tDOM: xs.of(\n\t\t\t\u003croot\u003e\n\t\t\t\t\u003chello-world name=\"custom element\" /\u003e\n\t\t\t\t\u003chelloWorld1 name=\"custom element (with snabbdom utility function)\" /\u003e\n\t\t\t\t\u003chelloWorld2 name=\"snabbdom hooks\" /\u003e\n\t\t\t\u003c/root\u003e,\n\t\t),\n\t}\n}\n```\n\n### Advanced usage\n\n```javascript\nimport Snabbdom from 'snabbdom-pragma'\nimport { customElementify } from '../src'\n\n// the lofic is exactly the same for snabbdomElementify :\n\nconst InputText = define(\n    'input-text',\n    customElementify(\n        function CycleComponent(sources) {\n            const { props, DOM } = sources\n\n            const props$ = DOM.select('input')\n                .events('input')\n                .map(event =\u003e ({\n                    value: (event.target as HTMLInputElement).value,\n                }))\n\n            const focus$ = DOM.select('input').events('focus')\n\n            return {\n                focus$, // any sink that does not have a matching driver will be available on the instance\n                props: props$, // props will be available as stream and as value on the instance\n                DOM: props.get().map(props =\u003e {\n                    const { value, label } = props\n                    return (\n                        \u003croot\u003e\n                            {label \u0026\u0026 \u003clabel\u003e{label}\u003c/label\u003e}\n                            \u003cinput type=\"text\" value={value} /\u003e\n                        \u003c/root\u003e\n                    )\n                }),\n            }\n        },\n        { props: { value: String, label: String } },\n    )\n)\n\n\nfunction main(sources) {\n    const { DOM } = sources\n\n    const inputText$ = DOM.select('input-text').element()\n\n    const value$ = inputText$\n    \t.map(input =\u003e input.value$)\n    \t.flatten()\n    \t.startWith('')\n\n    return {\n        DOM: xs.combine(value$, focus$)\n            .map(([value, focus]) =\u003e {\n                return (\n\t\t\t\t    \u003croot\u003e\n                        \u003cinput-text label=\"Type here\" value={value} /\u003e\u003cbr /\u003e\n                 \t\tYou typed : {value}\u003cbr /\u003e\n                    \u003c/root\u003e\n                )\n            })\n    }\n}\n\n```\n\n## About\n\nThis library uses skatejs as a foundation\n\n## API\n\n## Advanced usages\n\n## Contributing\n\n## TODO\n\n- Pull request to @cycle/dom allow the use of \u003croot\u003e like in skatejs snabbdom-element : https://github.com/skatejs/skatejs/blob/master/packages/element-snabbdom/src/index.ts\n\n- Remove dependency on @cycle/time on propsDriver\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuunnx%2Fcycle-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuunnx%2Fcycle-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuunnx%2Fcycle-element/lists"}