{"id":749,"date":"2024-09-11T18:00:00","date_gmt":"2024-09-11T09:00:00","guid":{"rendered":"https:\/\/blog.fundely.co.jp\/tech\/?p=749"},"modified":"2024-09-12T08:15:42","modified_gmt":"2024-09-11T23:15:42","slug":"react-image-gallery%e3%82%92%e4%bd%bf%e3%81%84%e3%81%93%e3%81%aa%e3%81%9d%e3%81%86%ef%bc%81","status":"publish","type":"post","link":"https:\/\/blog.fundely.co.jp\/tech\/2024\/09\/11\/react-image-gallery%e3%82%92%e4%bd%bf%e3%81%84%e3%81%93%e3%81%aa%e3%81%9d%e3%81%86%ef%bc%81\/","title":{"rendered":"React Image Gallery\u3092\u4f7f\u3044\u3053\u306a\u305d\u3046\uff01"},"content":{"rendered":"\n<p>\u3053\u3093\u306b\u3061\u306f\u3002<br>\u4eca\u56de\u306f\u3001React Image Gallery\u3068\u3044\u3046React\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u6d3b\u7528\u3057\u3001\u7c21\u5358\u306a\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u3092\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u516c\u5f0f: <a href=\"\" target=\"_blank\" rel=\"noopener\" title=\"React Image Gallery\">https:\/\/www.npmjs.com\/package\/react-image-gallery\/v\/0.5.11?activeTab=readme<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">react-image-gallery\u3068\u306f<\/h2>\n\n\n\n<p>\u753b\u50cf\u306e\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u9ad8\u6a5f\u80fd\u306aReact\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u540c\u69d8\u306e\u6a5f\u80fd\u3092\u6709\u3059\u308bReact\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066<a href=\"https:\/\/kenwheeler.github.io\/slick\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Slick<\/a>\u3084<a href=\"https:\/\/swiperjs.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Swiper<\/a>\u3082\u6319\u3052\u3089\u308c\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u305d\u308c\u3089\u3068\u540c\u7b49\u306b\u4fbf\u5229\u306aReact Image Gallery\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/blog.fundely.co.jp\/tech\/wp-content\/uploads\/sites\/2\/2024\/09\/6e23b480-2659-11ea-930d-968c70602dcc-1024x512.png\" alt=\"\" class=\"wp-image-757\" srcset=\"https:\/\/blog.fundely.co.jp\/tech\/wp-content\/uploads\/sites\/2\/2024\/09\/6e23b480-2659-11ea-930d-968c70602dcc-1024x512.png 1024w, https:\/\/blog.fundely.co.jp\/tech\/wp-content\/uploads\/sites\/2\/2024\/09\/6e23b480-2659-11ea-930d-968c70602dcc-300x150.png 300w, https:\/\/blog.fundely.co.jp\/tech\/wp-content\/uploads\/sites\/2\/2024\/09\/6e23b480-2659-11ea-930d-968c70602dcc-768x384.png 768w, https:\/\/blog.fundely.co.jp\/tech\/wp-content\/uploads\/sites\/2\/2024\/09\/6e23b480-2659-11ea-930d-968c70602dcc.png 1281w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u51fa\u5178: <a href=\"https:\/\/github.com\/xiaolin\/react-image-gallery\" target=\"_blank\" rel=\"noopener\" title=\"\">https:\/\/github.com\/xiaolin\/react-image-gallery<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h3>\n\n\n\n<p>\u307e\u305a\u306f\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u3066\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u6253\u3061\u307e\u3059\u3002\u4eca\u56de\u306fimage-gallery-sample\u3068\u3044\u3046\u540d\u524d\u3067React\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npx create-react-app image-gallery-sample\ncd image-gallery-sample\n<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>\u6b21\u306b\u4eca\u56de\u306e\u30e1\u30a4\u30f3\u3068\u306a\u308b&#8217;react-image-gallery&#8217;\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm install react-image-gallery<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u4f5c\u6210<\/h3>\n\n\n\n<p>\u4e0a\u8a18\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u4f5c\u6210\u3055\u308c\u305f\u306f\u305a\u306a\u306e\u3067\u3001&#8217;src\/App.js&#8217;\u306e\u30d5\u30a1\u30a4\u30eb\u5185\u5bb9\u3092\u5168\u3066\u6d88\u3057\u3066\u4e0b\u8a18\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"App.js\"><code>import React from &#39;react&#39;;\nimport ImageGallery from &#39;react-image-gallery&#39;;\nimport &#39;react-image-gallery\/styles\/css\/image-gallery.css&#39;;\n\nfunction App() {\n  const images = [\n    {\n      original: &#39;https:\/\/via.placeholder.com\/600x400.png?text=Image+1&#39;,\n      thumbnail: &#39;https:\/\/via.placeholder.com\/150x100.png?text=Thumb+1&#39;,\n      description: &#39;This is the first image&#39;,\n    },\n    {\n      original: &#39;https:\/\/via.placeholder.com\/600x400.png?text=Image+2&#39;,\n      thumbnail: &#39;https:\/\/via.placeholder.com\/150x100.png?text=Thumb+2&#39;,\n      description: &#39;This is the second image&#39;,\n    },\n    {\n      original: &#39;https:\/\/via.placeholder.com\/600x400.png?text=Image+3&#39;,\n      thumbnail: &#39;https:\/\/via.placeholder.com\/150x100.png?text=Thumb+3&#39;,\n      description: &#39;This is the third image&#39;,\n    },\n  ];\n\n  return (\n    &lt;div className=&quot;App&quot;&gt;\n      &lt;h1&gt;Image Gallery Sample&lt;\/h1&gt;\n      &lt;ImageGallery\n        items={images}\n        showPlayButton={true}            \/\/ \u30d7\u30ec\u30a4\u30dc\u30bf\u30f3\u3092\u8868\u793a\n        showFullscreenButton={true}      \/\/ \u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u30dc\u30bf\u30f3\u3092\u8868\u793a\n        showThumbnails={true}            \/\/ \u30b5\u30e0\u30cd\u30a4\u30eb\u3092\u8868\u793a\n        showBullets={true}               \/\/ \u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u30fc\uff08\u30c9\u30c3\u30c8\uff09\u3092\u8868\u793a\n        slideInterval={5000}             \/\/ \u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u306e\u9593\u9694\uff08\u30df\u30ea\u79d2\uff09\n        autoPlay={true}                  \/\/ \u81ea\u52d5\u518d\u751f\u3092\u6709\u52b9\u306b\u3059\u308b\n        infinite={true}                  \/\/ \u30eb\u30fc\u30d7\u3092\u6709\u52b9\u306b\u3059\u308b\n        showNav={true}                   \/\/ \u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u77e2\u5370\u3092\u8868\u793a\n        additionalClass=&quot;custom-gallery&quot; \/\/ \u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\n      \/&gt;\n    &lt;\/div&gt;\n  );\n}\n\nexport default App;\n<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-file=\"App.css\" data-lang=\"CSS\"><code>.custom-gallery .image-gallery-slide img {\n  border-radius: 10px;\n}\n\n.custom-gallery .image-gallery-thumbnail {\n  border: 2px solid #ccc;\n}\n<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u89e3\u8aac<\/h3>\n\n\n\n<p>\u77ed\u3044\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001\u30dd\u30a4\u30f3\u30c8\u3068\u3057\u3066\u306f\u4e0b\u8a18\u3092\u5fd8\u308c\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>import &#39;react-image-gallery\/styles\/css\/image-gallery.css&#39;;<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u3061\u3089\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u540c\u68b1\u3055\u308c\u3066\u3044\u308bCSS\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30d7\u30ec\u30a4\u30dc\u30bf\u30f3\u3084\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u30dc\u30bf\u30f3\u306e\u8868\u793a\u3001\u81ea\u52d5\u518d\u751f\u3092\u6709\u52b9\u306b\u3059\u308b\u6a5f\u80fd\u306a\u3069\u69d8\u3005\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\uff08\u3061\u306a\u307f\u306b\u4e0d\u8981\u306a\u3082\u306e\u306ftrue\u306e\u90e8\u5206\u3092false\u306b\u5909\u3048\u308b\u3068OFF\u306b\u3067\u304d\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<p>\u30b3\u30fc\u30c9\u306e\u753b\u50cf\u306f\u30b5\u30f3\u30d7\u30eb\u306a\u306e\u3067\u3001\u304a\u597d\u307f\u306e\u753b\u50cf\u3092\u5165\u308c\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>CSS\u3067\u30b9\u30bf\u30a4\u30eb\u3092\u3042\u3066\u308b\u3068\u3001\u3088\u308a\u30aa\u30b7\u30e3\u30ec\u306b\u898b\u3048\u307e\u3059\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8d77\u52d5\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068React\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm start<\/code><\/pre><\/div>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u306b\u3066\u300c<a href=\"http:\/\/localhost:3000\/\" target=\"_blank\" rel=\"noopener\" title=\"\">http:\/\/localhost:3000\/<\/a>\u300d\u3092\u5165\u529b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u753b\u50cf\u30ae\u30e3\u30e9\u30ea\u30fc\u304c\u3067\u304d\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h3>\n\n\n\n<p>\u672c\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4ed6\u306b\u3082React\u306b\u306f\u591a\u304f\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u308a\u3001\u898b\u3066\u3044\u308b\u3060\u3051\u3067\u3082\u697d\u3057\u304f\u306a\u308a\u307e\u3059\u3002\u307e\u305a\u306f\u30dd\u30fc\u30c8\u30d5\u30a9\u30ea\u30aa\u7b49\u306b\u6d3b\u7528\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3055\u3044\u3054\u306b<\/h2>\n\n\n\n<p>\u73fe\u5728\u30c7\u30b6\u30a4\u30f3\u30fb\u30b7\u30b9\u30c6\u30e0\u5ba4\u3067\u306f\u3001\u65b0\u3057\u3044\u30e1\u30f3\u30d0\u30fc\u3092\u52df\u96c6\u3057\u3066\u3044\u307e\u3059\u3002\u5c11\u3057\u3067\u3082\u8208\u5473\u3092\u6301\u305f\u308c\u305f\u65b9\u306f\u3001\u305c\u3072\u3054\u5fdc\u52df\u304f\u3060\u3055\u3044\u2728\ud83d\udcbb<br>\u7686\u69d8\u304b\u3089\u306e\u3054\u5fdc\u52df\u3001\u5fc3\u3088\u308a\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button aligncenter is-style-fill\"><a class=\"wp-block-button__link has-vivid-green-cyan-background-color has-background wp-element-button\" href=\"https:\/\/blog.fundely.co.jp\/tech\/?page_id=82&amp;preview=true\" style=\"border-radius:12px\">\u52df\u96c6\u8981\u9805\u304a\u3088\u3073\u30a8\u30f3\u30c8\u30ea\u30fc\u30d5\u30a9\u30fc\u30e0<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u4eca\u56de\u306f\u3001React Image Gallery\u3068\u3044\u3046React\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u6d3b\u7528\u3057\u3001\u7c21\u5358\u306a\u30b9\u30e9\u30a4\u30c9\u30b7\u30e7\u30fc\u3092\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u516c\u5f0f: https:\/\/www.npmjs.com\/package\/reac [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-749","post","type-post","status-publish","format-standard","hentry","category-react"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts\/749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/comments?post=749"}],"version-history":[{"count":11,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts\/749\/revisions"}],"predecessor-version":[{"id":767,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts\/749\/revisions\/767"}],"wp:attachment":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/media?parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/categories?post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/tags?post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}