{"id":13630566,"url":"https://github.com/tableflip/react-responsive-embed","last_synced_at":"2025-04-06T05:31:49.092Z","repository":{"id":57343579,"uuid":"79909289","full_name":"tableflip/react-responsive-embed","owner":"tableflip","description":":atom_symbol: Embed iframes responsively","archived":false,"fork":false,"pushed_at":"2023-04-17T20:57:28.000Z","size":393,"stargazers_count":39,"open_issues_count":7,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T23:01:43.931Z","etag":null,"topics":["aspect-ratio","embed","iframe","react"],"latest_commit_sha":null,"homepage":"https://tableflip.github.io/react-responsive-embed","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tableflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-24T12:24:57.000Z","updated_at":"2025-03-30T00:43:24.000Z","dependencies_parsed_at":"2024-01-14T09:00:18.913Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/react-responsive-embed","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"60519bd5112de7b00b8eb8f882e4ab2affa741df"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-responsive-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-responsive-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-responsive-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-responsive-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/react-responsive-embed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440346,"owners_count":20939221,"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":["aspect-ratio","embed","iframe","react"],"created_at":"2024-08-01T22:01:47.487Z","updated_at":"2025-04-06T05:31:48.357Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","readme":"# React ResponsiveEmbed\n\nYou want to embed a YouTube or other `iframe` style embedded content, and you'd\nlike it to take up the available width, and retain it's aspect ratio.\n\nMuch like the [Bootstrap responsive embed helpers] of old, but for react.\n\n## Usage\n\n```sh\nnpm install --save react-responsive-embed\n```\n\nThen in your app import `ResponsiveEmbed` and in JSX flavour you might do:\n\n```html\n\u003cResponsiveEmbed src='https://www.youtube.com/embed/2yqz9zgoC-U' allowFullScreen /\u003e\n```\n\nWhich'd give you an `iframe` element pointing at the `src` and any other props.\nIt's wrapped in a `div` with just the right amount of `padding-bottom` to\npreserve a **16:9** aspect ratio like so:\n\n```html\n\u003cdiv style=\"position:relative;height:0;overflow:hidden;max-width:100%;padding-bottom:56.25%;\"\u003e\n  \u003ciframe src=\"https://www.youtube.com/embed/2yqz9zgoC-U\"  \n    style=\"position:absolute;top:0;left:0;width:100%;height:100%;\"\n    frameborder=\"0\"\n    allowfullscreen\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n```\n\nPass in a `ratio` prop to pick a different one. Any ratio will do:\n\n```html\n\u003cResponsiveEmbed src='https://www.youtube.com/embed/2yqz9zgoC-U' ratio='4:3' /\u003e\n```\n\n`frameborder=\"0\"` is applied by default.\n\n\n## Browserify / Webpack / Other?\n\n**This module is just a function**. It's been babelified so it'll work with \nwhatever your set up is. Use browserify or webpack or any other npm module\nconsuming bundle whizzbang; ResponsiveEmbed don't mind.\n\n---\n\nA [(╯°□°）╯︵TABLEFLIP] side project.\n\n\n[Bootstrap responsive embed helpers]: https://v4-alpha.getbootstrap.com/utilities/responsive-helpers/#responsive-embeds\n[(╯°□°）╯︵TABLEFLIP]: https://tableflip.io\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Freact-responsive-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Freact-responsive-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Freact-responsive-embed/lists"}