Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div id="root"></div>


                li {
  align-items: center;
  background-color: teal;
  color: white;
  display: flex;
  height: 100%;

ul {
  position: relative;
  height: 50px;
  width: 250px;

ul * {
  cursor: pointer;
  user-select: none;

.icons {
  color: white;
  display: flex;
  align-items: center;
  height: 100%;
  justify-content: center;
  position: absolute;
  top: 0;
  width: 30px;

.icons:hover {
  background-color: gray;

.icons:nth-child(2) {
  right: 50px;

.icons:nth-child(3) {
  right: 0px;



                const App = () => {
  const [icon, setIcon] = React.useState("");

  const handleIconClick = (e) => {
    const [_, _icon] =" ");

  return (
        <li id="abc">
          <a>Some Accordion</a>
        <div class="icons plus" onClick={handleIconClick}>+</div>
        <div class="icons bin" onClick={handleIconClick}>🗑</div>
        <Reactstrap.UncontrolledCollapse toggler="#abc">
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt
            magni, voluptas debitis similique porro a molestias consequuntur
            earum odio officiis natus, amet hic, iste sed dignissimos esse fuga!
            Minus, alias.

ReactDOM.render(<App />, document.getElementById("root"));