{"id":19337001,"url":"https://github.com/eddort/atomize-nextjs-example","last_synced_at":"2026-06-18T11:31:37.258Z","repository":{"id":150026923,"uuid":"369205931","full_name":"eddort/atomize-nextjs-example","owner":"eddort","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-20T12:48:15.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T08:14:01.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/eddort.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}},"created_at":"2021-05-20T12:48:00.000Z","updated_at":"2021-05-20T12:48:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2cb0ff3-5c03-4f11-832b-4d166d3f779e","html_url":"https://github.com/eddort/atomize-nextjs-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eddort/atomize-nextjs-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddort%2Fatomize-nextjs-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddort%2Fatomize-nextjs-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddort%2Fatomize-nextjs-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddort%2Fatomize-nextjs-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddort","download_url":"https://codeload.github.com/eddort/atomize-nextjs-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddort%2Fatomize-nextjs-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34489019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":"2024-11-10T03:13:07.468Z","updated_at":"2026-06-18T11:31:37.230Z","avatar_url":"https://github.com/eddort.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example app with styled-components\n\nThis example features how you use a different styling solution than [styled-jsx](https://github.com/zeit/styled-jsx) that also supports universal styles. That means we can serve the required styles for the first render within the HTML and then load the rest in the client. In this case we are using [styled-components](https://github.com/styled-components/styled-components).\n\nFor this purpose we are extending the `\u003cDocument /\u003e` and injecting the server side rendered styles into the `\u003chead\u003e`, and also adding the `babel-plugin-styled-components` (which is required for server side rendering). Additionally we set up a global [theme](https://www.styled-components.com/docs/advanced#theming) for styled-components using NextJS custom [`\u003cApp\u003e`](https://nextjs.org/docs/advanced-features/custom-app) component.\n\n## Deploy your own\n\nDeploy the example using [Vercel](https://vercel.com?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=next-example):\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-styled-components\u0026project-name=with-styled-components\u0026repository-name=with-styled-components)\n\n## How to use\n\nExecute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:\n\n```bash\nnpx create-next-app --example with-styled-components with-styled-components-app\n# or\nyarn create next-app --example with-styled-components with-styled-components-app\n```\n\nDeploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).\n\n### Try it on CodeSandbox\n\n[Open this example on CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/with-styled-components)\n\n### Notes\n\nWhen wrapping a [Link](https://nextjs.org/docs/api-reference/next/link) from `next/link` within a styled-component, the [as](https://styled-components.com/docs/api#as-polymorphic-prop) prop provided by `styled` will collide with the Link's `as` prop and cause styled-components to throw an `Invalid tag` error. To avoid this, you can either use the recommended [forwardedAs](https://styled-components.com/docs/api#forwardedas-prop) prop from styled-components or use a different named prop to pass to a `styled` Link.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand workaround example\u003c/summary\u003e\n\u003cbr /\u003e\n\n**components/StyledLink.js**\n\n```javascript\nimport Link from 'next/link'\nimport styled from 'styled-components'\n\nconst StyledLink = ({ as, children, className, href }) =\u003e (\n  \u003cLink href={href} as={as} passHref\u003e\n    \u003ca className={className}\u003e{children}\u003c/a\u003e\n  \u003c/Link\u003e\n)\n\nexport default styled(StyledLink)`\n  color: #0075e0;\n  text-decoration: none;\n  transition: all 0.2s ease-in-out;\n\n  \u0026:hover {\n    color: #40a9ff;\n  }\n\n  \u0026:focus {\n    color: #40a9ff;\n    outline: none;\n    border: 0;\n  }\n`\n```\n\n**pages/index.js**\n\n```javascript\nimport StyledLink from '../components/StyledLink'\n\nexport default () =\u003e (\n  \u003cStyledLink href=\"/post/[pid]\" forwardedAs=\"/post/abc\"\u003e\n    First post\n  \u003c/StyledLink\u003e\n)\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddort%2Fatomize-nextjs-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddort%2Fatomize-nextjs-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddort%2Fatomize-nextjs-example/lists"}