Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Auto Save

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.

HTML

              
                <div class="tabpanel-demo">
  <div class="widget-container">
    <div id="tabpanel"></div>
  </div>

  <div class="options">
    <div class="caption">Options</div>

    <div class="option">
      <div class="option-label">Tabs position</div>
      <div id="tabs-position-selectbox"></div>
    </div>

    <div class="option">
      <div class="option-label">Icon position</div>
      <div id="icon-position-selectbox"></div>
    </div>
    
    
    <div class="option">
      <div class="option-label">Styling mode</div>
      <div id="styling-mode-selectbox"></div>
    </div>
  </div>
</div>

              
            
!

CSS

              
                .tabpanel-demo {
  display: flex;
  height: 100%;
  min-height: 450px;
}

.widget-container {
  display: flex;
  justify-content: center;
  flex-grow: 1;
  min-width: 360px;
  padding: 16px 32px;
  background-color: rgba(191, 191, 191, 0.15);
}

.dx-tabpanel {
  max-width: 600px;
  border-radius: 8px;
  overflow: clip;
  background-color: #fff;
}

.dx-tabpanel-tabs-position-left .dx-tabpanel-container,
.dx-tabpanel-tabs-position-right .dx-tabpanel-container {
  width: 0;
}

.dx-tabs-vertical {
  min-width: 120px;
}

.options {
  display: inline-flex;
  flex-direction: column;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 300px;
  padding: 20px;
  background-color: rgba(191, 191, 191, 0.15);
}

.caption {
  font-weight: 500;
  font-size: 18px;
}

.option {
  margin-top: 20px;
}

.tabpanel-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.task-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 8px 12px 8px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15);
}

.task-item::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 6px;
  bottom: 8px;
  width: 3px;
  border-radius: 4px;
}

.task-item-priority-high::before {
  background-color: #e1bee7;
}

.task-item-priority-medium::before {
  background-color: #ffe0b2;
}

.task-item-priority-low::before {
  background-color: #c8e6c9;
}

.task-item-text,
.task-item-info {
  margin: 0;
  padding: 0 24px 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item-info {
  font-size: 12px;
  opacity: 0.38;
}

.task-item-pseudo-button {
  position: absolute;
  right: 8px;
  top: 50%;
  font-size: 18px;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.6;
}

              
            
!

JS

              
                $(() => {
  const taskItem = (task) => {
    const className = `task-item task-item-priority-${task.priority}`;

    return `
      <div class="${className}">
        <span class="task-item-text">
          ${task.text}
        </span>

        <span class="task-item-info">
          ${task.date} by ${task.assignedBy}
        </span>

        <i class="task-item-pseudo-button dx-icon dx-icon-overflow"></i>
      </div>
    `;
  };

  const taskList = (tasks) => {
    const list = tasks.reduce((accumulator, task) => `${accumulator} ${taskItem(task)}`, '');

    return `
      <div class="tabpanel-item">
        ${list}
      </div>
    `;
  };

  const tabPanel = $('#tabpanel').dxTabPanel({
    dataSource,
    width: '100%',
    height: 418,
    animationEnabled: true,
    swipeEnabled: true,
    showNavButtons: true,
    tabsPosition: tabsPositions[0],
    iconPosition: iconPositions[0],
    stylingMode: stylingModes[1],
    itemTemplate: ({ tasks }) => taskList(tasks),
  }).dxTabPanel('instance');

  $('#tabs-position-selectbox').dxSelectBox({
    inputAttr: tabsPositionsSelectBoxLabel,
    items: tabsPositions,
    value: tabsPositions[0],
    onValueChanged({ value }) {
      tabPanel.option({ tabsPosition: value });
    },
  });

  $('#icon-position-selectbox').dxSelectBox({
    inputAttr: iconPositionsSelectBoxLabel,
    items: iconPositions,
    value: iconPositions[0],
    onValueChanged({ value }) {
      tabPanel.option({ iconPosition: value });
    },
  });

  $('#styling-mode-selectbox').dxSelectBox({
    inputAttr: stylingModeSelectBoxLabel,
    items: stylingModes,
    value: stylingModes[1],
    onValueChanged({ value }) {
      tabPanel.option({ stylingMode: value });
    },
  });
});

const tabsPositionsSelectBoxLabel = { "aria-label": "Tabs positions" };

const tabsPositions = ["left", "top", "right", "bottom"];

const iconPositionsSelectBoxLabel = { "aria-label": "Icon positions" };

const iconPositions = ["top", "start", "end", "bottom"];

const stylingModeSelectBoxLabel = { "aria-label": "Styling mode" };

const stylingModes = [ "primary", "secondary" ];

const tasks = [
  {
    status: "Not Started",
    priority: "high",
    text: "Revenue Projections",
    date: "2023/09/16",
    assignedBy: "John Heart"
  },
  {
    status: "Not Started",
    priority: "high",
    text: "New Brochures",
    date: "2023/09/16",
    assignedBy: "Samantha Bright"
  },
  {
    status: "Not Started",
    priority: "medium",
    text: "Training",
    date: "2023/09/16",
    assignedBy: "Arthur Miller"
  },
  {
    status: "Not Started",
    priority: "medium",
    text: "NDA",
    date: "2023/09/16",
    assignedBy: "Robert Reagan"
  },
  {
    status: "Not Started",
    priority: "low",
    text: "Health Insurance",
    date: "2023/09/16",
    assignedBy: "Greta Sims"
  },

  {
    status: "Help Needed",
    priority: "low",
    text: "TV Recall",
    date: "2023/09/16",
    assignedBy: "Brett Wade"
  },
  {
    status: "Help Needed",
    priority: "low",
    text: "Recall and Refund Forms",
    date: "2023/09/16",
    assignedBy: "Sandra Johnson"
  },
  {
    status: "Help Needed",
    priority: "high",
    text: "Shippers",
    date: "2023/09/16",
    assignedBy: "Ed Holmes"
  },
  {
    status: "Help Needed",
    priority: "medium",
    text: "Hardware Upgrade",
    date: "2023/09/16",
    assignedBy: "Barb Banks"
  },

  {
    status: "In Progress",
    priority: "medium",
    text: "Online Sales",
    date: "2023/09/16",
    assignedBy: "Cindy Stanwick"
  },
  {
    status: "In Progress",
    priority: "medium",
    text: "New Website Design",
    date: "2023/09/16",
    assignedBy: "Sammy Hill"
  },
  {
    status: "In Progress",
    priority: "low",
    text: "Bandwidth Increase",
    date: "2023/09/16",
    assignedBy: "Davey Jones"
  },
  {
    status: "In Progress",
    priority: "medium",
    text: "Support",
    date: "2023/09/16",
    assignedBy: "Victor Norris"
  },
  {
    status: "In Progress",
    priority: "low",
    text: "Training Material",
    date: "2023/09/16",
    assignedBy: "John Heart"
  },

  {
    status: "Deferred",
    priority: "medium",
    text: "New Database",
    date: "2023/09/16",
    assignedBy: "Samantha Bright"
  },
  {
    status: "Deferred",
    priority: "high",
    text: "Automation Server",
    date: "2023/09/16",
    assignedBy: "Arthur Miller"
  },
  {
    status: "Deferred",
    priority: "medium",
    text: "Retail Sales",
    date: "2023/09/16",
    assignedBy: "Robert Reagan"
  },
  {
    status: "Deferred",
    priority: "medium",
    text: "Shipping Labels",
    date: "2023/09/16",
    assignedBy: "Greta Sims"
  },

  {
    status: "Rejected",
    priority: "high",
    text: "Schedule Meeting with Sales Team",
    date: "2023/09/16",
    assignedBy: "Sandra Johnson"
  },
  {
    status: "Rejected",
    priority: "medium",
    text: "Confirm Availability for Sales Meeting",
    date: "2023/09/16",
    assignedBy: "Ed Holmes"
  },
  {
    status: "Rejected",
    priority: "medium",
    text: "Reschedule Sales Team Meeting",
    date: "2023/09/16",
    assignedBy: "Barb Banks"
  },
  {
    status: "Rejected",
    priority: "high",
    text: "Update Database with New Leads",
    date: "2023/09/16",
    assignedBy: "Kevin Carter"
  },
  {
    status: "Rejected",
    priority: "low",
    text: "Send Territory Sales Breakdown",
    date: "2023/09/16",
    assignedBy: "Cindy Stanwick"
  },

  {
    status: "Completed",
    priority: "medium",
    text: "Territory Sales Breakdown Report",
    date: "2023/09/16",
    assignedBy: "Sammy Hill"
  },
  {
    status: "Completed",
    priority: "low",
    text: "Return Merchandise Report",
    date: "2023/09/16",
    assignedBy: "Davey Jones"
  },
  {
    status: "Completed",
    priority: "high",
    text: "Staff Productivity Report",
    date: "2023/09/16",
    assignedBy: "Victor Norris"
  },
  {
    status: "Completed",
    priority: "medium",
    text: "Review HR Budget Company Wide",
    date: "2023/09/16",
    assignedBy: "Mary Stern"
  }
];

const dataSource = [
  {
    icon: "description",
    title: "Not Started",
    tasks: tasks.filter((item) => item.status === "Not Started")
  },
  {
    icon: "taskhelpneeded",
    title: "Help Needed",
    tasks: tasks.filter((item) => item.status === "Help Needed")
  },
  {
    icon: "taskinprogress",
    title: "In Progress",
    tasks: tasks.filter((item) => item.status === "In Progress")
  },
  {
    icon: "taskstop",
    title: "Deferred",
    tasks: tasks.filter((item) => item.status === "Deferred")
  },
  {
    icon: "taskrejected",
    title: "Rejected",
    tasks: tasks.filter((item) => item.status === "Rejected")
  },
  {
    icon: "taskcomplete",
    title: "Completed",
    tasks: tasks.filter((item) => item.status === "Completed")
  }
];

              
            
!
999px

Console