{"id":21818584,"url":"https://github.com/domparty/component-library","last_synced_at":"2025-04-14T02:27:03.702Z","repository":{"id":39178364,"uuid":"250805760","full_name":"domparty/component-library","owner":"domparty","description":"Our white label component library. Filled with functional components to help you kick-start your project 🚀","archived":false,"fork":false,"pushed_at":"2023-01-05T17:55:12.000Z","size":1624,"stargazers_count":12,"open_issues_count":22,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T02:26:42.712Z","etag":null,"topics":["component-library","components","kick-start","preact","react","storybook","whitelabel"],"latest_commit_sha":null,"homepage":"https://domparty.com/","language":"JavaScript","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/domparty.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":"2020-03-28T13:45:55.000Z","updated_at":"2025-04-11T05:33:36.000Z","dependencies_parsed_at":"2023-02-04T09:15:38.410Z","dependency_job_id":null,"html_url":"https://github.com/domparty/component-library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domparty%2Fcomponent-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domparty%2Fcomponent-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domparty%2Fcomponent-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domparty%2Fcomponent-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domparty","download_url":"https://codeload.github.com/domparty/component-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248810710,"owners_count":21165168,"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","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":["component-library","components","kick-start","preact","react","storybook","whitelabel"],"created_at":"2024-11-27T16:13:29.304Z","updated_at":"2025-04-14T02:27:03.663Z","avatar_url":"https://github.com/domparty.png","language":"JavaScript","readme":"# Domparty - Component library\n\nA white label component library, ready for you to style. Unbiased on how styling should look on your\nwebsite, while giving you the handles to kick-start you application with some helpful functional components.\n\n## Instructions\n\nInstall the component library using `npm i @domparty/fe`. This will make the library available for your project.\nBecause @domparty/fe uses Goober internally to provide all neat CSS tricks, first implement our provider into your application.\n\n### Using Preact?\n\nIf you're more into speedy apps, we have also implemented a provider for you! Instead of importing the provider from `@domparty/fe/core`,\nimport the provider from `@domparty/fe/core/preact`. This way your application is using the Pragma from Preact, instead of React.\n\n### Default React apps\n\nFor default React apps, the following snippet can be used.  \n_use `import { Provider } from '@domparty/fe/core/preact';` for Preact_\n\n```javascript\nimport React from 'react';\nimport { Provider } from '@domparty/fe/core';\n\nexport default () =\u003e (\n  \u003cProvider value={{}}\u003e\n    \u003cApp /\u003e\n  \u003c/Provider\u003e\n);\n```\n\n### Next.js apps\n\nTo implement @domparty/fe into Next.js make sure the \\_app.js file implements the \u003cProvider /\u003e component.\n\n```javascript\nimport React from 'react';\nimport { Provider } from '@domparty/fe/core';\n\nexport default ({ Component, pageProps }) =\u003e (\n  \u003cProvider value={{}}\u003e\n    \u003cComponent {...pageProps} /\u003e\n  \u003c/Provider\u003e\n);\n```\n\n## SSR (server-side rendering)\n\nTo make sure all styles are rendered correctly on the server. The component library exports Goobers' `extractCss` function for you to implement.\n\nTo use this feature in Next.js apps, make sure the `getInitialProps` in your \\_document file uses this function.\n\n```javascript\nimport Document, { Head, Main, NextScript } from 'next/document';\nimport { extractCss } from '@domparty/fe/core';\n\nexport default class MyDocument extends Document {\n  static getInitialProps({ renderPage }) {\n    const page = renderPage();\n\n    // Extrach the css for each page render\n    const css = extractCss();\n    return { ...page, css };\n  }\n\n  render() {\n    return (\n      \u003chtml\u003e\n        \u003cHead\u003e\n          \u003cstyle\n            id={'_goober'}\n            // And defined it in here\n            dangerouslySetInnerHTML={{ __html: this.props.css }}\n          /\u003e\n        \u003c/Head\u003e\n        \u003cbody\u003e\n          \u003cMain /\u003e\n          \u003cNextScript /\u003e\n        \u003c/body\u003e\n      \u003c/html\u003e\n    );\n  }\n}\n```\n\n# License\n\n[MIT](https://oss.ninja/mit/domparty/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomparty%2Fcomponent-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomparty%2Fcomponent-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomparty%2Fcomponent-library/lists"}