CodeSandbox(基于 React 的在线代码沙盒平台)

简介: Open ReactExplore ExamplesCodeSandbox is an online editor that helps you create web applications, from prototype to deployment.


CodeSandbox


The online code editor for web applications


Open ReactExplore ExamplesCodeSandbox is an online editor that helps you create web applications, from prototype to deployment.


Tailored for web applications


We know how overwhelming JavaScript development can be. With CodeSandbox we specifically focus on web application development to make the experience as smooth as possible. Just open your browser and start coding.


React


Supported Loaders


.js.ts.html.css.png


CSS Scoping Support


Global


Share in a single click


Say goodbye to the days where you had to create a zip file just to share your code. Now you can copy the link and share away!


DependencySandbox Count


NPM Support


Think of any npm dependency you want to use, we probably support it! You can install a new dependency within seconds.


Learn how it works.


Search & Discovery


Want to know how a library works? You can easily browse through the 80,000+ created sandboxes on CodeSandbox. We want this to be a platform where everyone can easily learn and share.


Embedding


We built a lightweight version of CodeSandbox for embeds, this allows you to embed your sandbox anywhere. Viewers can even play with the code in the embed, without leaving the website. We offer many customization options to make sure you can show the embed exactly the way you want.






Be Productive, Anywhere


We aim to give you the tools to build a full blown web application. You can easily import projects from GitHub, make commits, and finally deploy. We support the whole cycle.


Import


Paste your GitHub URL. You get a sandbox that stays up to date with the latest changes automatically.


Build


Fork the sandbox and start building that long awaited feature!


Commit


Commit your changes or open a pull request with a user friendly UI.


Deploy


Deploy a production version of your sandbox using ZEIT Now.


github.com/reactjs/red…codesandbox.io/s/github/re…Deploying...https://csb-921ywn…


There's more


This was just the tip of the iceberg. There are many more things to explore, if you are missing anything you can always open an issue on GitHub.

Export to GitHubnewAll sandboxes can easily be exported to a GitHub repository.Static File HostingnewThe development server will serve all files statically from the public folder, depending on the template.Integrated DevToolsnewThe preview window has integrated DevTools, like a console. There are more DevTools underway.Private/Unlisted SandboxespatronYou can set a sandbox to private or unlisted to make sure others cannot see or find it.Externally Hosted PreviewsYou can open your sandbox preview with a separate URL, while still keeping Hot Module Reloading.Monaco EditorWe use the same editor as VSCode, which gives us "Go to Definition", "Replace Occurences" and more!Hot Module ReloadingHot Module Reloading is built in, so you won't have to press refresh for every change.Error OverlayWe show a user friendly error overlay for every error, sometimes with suggestions on how to solve it.Automatic Type AcquisitionTypings are automatically downloaded for every dependency, so you always have autocompletions.TypeScriptThanks to Monaco we show TypeScript autocompletions and diagnostics for TS sandboxes.PrettierCode automatically gets prettified on save according to your own Prettier preferences.ESLintAll code is linted automatically using latest version of ESLint, with full ES6 support.;Emmet.ioYou can easily expand abbreviations with Emmet.io in all JS, HTML and CSS files.Open SourceWe're almost fully open source! Our most active repository can be found here.Import with CLIYou can export a local project to CodeSandbox easily using codesandbox-cli.Export To ZipYou can always download a zip from your sandbox for if you want to continue locally.


Recent Publications


Become a Patron


You can support our development by becoming a Patron and paying a monthly amount of your choice. As a Patron you get less limits and extra features, like private sandboxes. There are more patron features coming.


Open Patron Page


CodeSandbox



About



Social



By Bas Buursma and Ives van Hoorne

目录
相关文章
|
8月前
|
监控 前端开发 API
React代码在电脑监控软件开发中的应用
这篇文章除了介绍React在电脑监控软件开发中的应用,还展示了如何通过组件化构建监控界面,如`MonitorDashboard`、`StatusWidget`和`ActivityLog`组件。文章强调了React的生命周期方法和Hooks在实时数据获取和显示中的作用,如`SystemStatus`组件的`useEffect`钩子。此外,还讲解了如何监听和记录用户行为的`UserActivity`组件,以及利用axios自动提交监控数据的`DataSubmitter`组件。React的这些特性使得开发高效、响应式的监控软件变得更加便捷。
109 8
|
3月前
|
资源调度 前端开发 Android开发
如何在 React Native 中进行代码签名验证?
如何在 React Native 中进行代码签名验证?
|
5月前
|
前端开发 JavaScript 区块链
react18函数组件+antd使用指南-使用代码集合以及报错记录汇总
本文介绍了多个React开发中常见的问题及其解决方案,包括但不限于:1)`useForm`实例未连接到任何`Form`元素的警告及解决方法;2)监听页面滚动事件的实现方式;3)React 18与antd 5.8.6中定制主题的方法;4)React结合antd 4.x版本自定义主题色的步骤;5)解决`ResizeObserver loop`相关报错的技巧;6)处理React设计表单时遇到的CDN资源加载失败问题;7)解决onClick事件传参问题;8)修复类型错误等。每部分均提供详细分析与实用代码示例,帮助开发者快速定位并解决问题。
94 3
|
6月前
|
开发者 搜索推荐 Java
超越传统:JSF自定义标签库如何成为现代Web开发的个性化引擎
【8月更文挑战第31天】JavaServer Faces(JSF)框架支持通过自定义标签库扩展其内置组件,以满足特定业务需求。这涉及创建`.taglib`文件定义标签库及组件,并实现对应的Java类与渲染器。本文介绍如何构建和应用JSF自定义标签库,包括定义标签库、实现标签类与渲染器逻辑,以及在JSF页面中使用这些自定义标签,从而提升代码复用性和可维护性,助力开发更复杂且个性化的Web应用。
92 0
|
6月前
|
前端开发 测试技术 UED
React性能优化的神奇之处:如何用懒加载与代码分割让你的项目一鸣惊人?
【8月更文挑战第31天】在现代Web开发中,性能优化至关重要。本文探讨了React中的懒加载与代码分割技术,通过示例展示了如何在实际项目中应用这些技术。懒加载能够延迟加载组件,提高页面加载速度;代码分割则将应用程序代码分割成多个块,按需加载。两者结合使用,可以显著提升用户体验。遵循合理使用懒加载、编写测试及关注性能等最佳实践,能够更高效地进行性能优化,提升应用程序的整体表现。随着React生态的发展,懒加载与代码分割技术将在未来Web开发中发挥更大作用。
71 0
|
6月前
|
前端开发 UED 开发者
React.lazy()与Suspense:实现按需加载的动态组件——深入理解代码分割、提升首屏速度和优化用户体验的关键技术
【8月更文挑战第31天】在现代Web应用中,性能优化至关重要,特别是减少首屏加载时间和提升用户交互体验。React.lazy()和Suspense组件提供了一种优雅的解决方案,允许按需加载组件,仅在需要渲染时加载相应代码块,从而加快页面展示速度。Suspense组件在组件加载期间显示备选内容,确保了平滑的加载过渡。
212 0
|
6月前
|
XML 前端开发 JavaScript
【React新手必看】JSX,让你的代码舞动起来!
【8月更文挑战第24天】JSX(JavaScript XML)是React开发的核心,作为一种JavaScript语法扩展,它支持在代码中使用类似HTML的标签。JSX并非模板语言,在编译过程中转换为纯JavaScript,使React能高效更新DOM并渲染页面。其优势在于直观性、简洁性和灵活性:简化复杂用户界面构建、减少代码量,并支持HTML标签、React组件及JavaScript变量的表达式插入。基本用法涉及定义组件UI,如创建包含标题和段落的简单组件。
129 0
|
7月前
|
前端开发
React官网 - 井字棋 - 游戏改进参考答案(含汉化和完整范例代码)
React官网 - 井字棋 - 游戏改进参考答案(含汉化和完整范例代码)
60 1
|
9月前
|
设计模式 前端开发 API
写出易维护的代码|React开发的设计模式及原则
本文对React社区里出现过的一些设计模式进行了介绍,并讲解了他们遵循的设计原则。
|
9月前
|
前端开发 数据可视化 UED
React的代码分割:使用React.lazy和Suspense进行性能优化
【4月更文挑战第25天】使用React的`React.lazy`和`Suspense`进行代码分割可优化性能,按需加载组件以提升应用启动速度和用户体验。`React.lazy`接收返回Promise的组件动态导入,而`Suspense`提供加载指示器,保证加载过程中的用户体验。适用于大型组件或路由应用,但需注意服务器配置、避免过度拆分和确保关键代码即时加载。合理运用能显著改善应用性能。