How to use @jupyterlab/ui-components - 10 common examples

To help you get started, we’ve selected a few @jupyterlab/ui-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / packages / celltags / src / addwidget.ts View on Github external
buildTag() {
    let text = document.createElement('input');
    text.value = 'Add Tag';
    text.contentEditable = 'true';
    text.className = 'add-tag';
    text.style.width = '49px';
    this.input = text;
    let tag = document.createElement('div');
    tag.className = 'tag-holder';
    tag.appendChild(text);
    let img = document.createElement('span');
    defaultIconRegistry.icon({
      name: 'add',
      container: img,
      center: true,
      height: '18px',
      width: '18px',
      marginLeft: '3px',
      marginRight: '-5px'
    });
    this.addClass('unapplied-tag');
    tag.appendChild(img);
    this.node.appendChild(tag);
  }
github jupyterlab / jupyterlab / packages / celltags / src / widget.ts View on Github external
buildTag() {
    let text = document.createElement('span');
    text.textContent = this.name;
    text.style.textOverflow = 'ellipsis';
    let tag = document.createElement('div');
    tag.className = 'tag-holder';
    tag.appendChild(text);
    let img = document.createElement('span');
    defaultIconRegistry.icon({
      name: 'check',
      container: img,
      center: true,
      height: '18px',
      width: '18px',
      marginLeft: '5px',
      marginRight: '-3px'
    });
    if (this.applied) {
      this.addClass('applied-tag');
    } else {
      this.addClass('unapplied-tag');
      img.style.display = 'none';
    }
    tag.appendChild(img);
    this.node.appendChild(tag);
github jupyterlab / jupyterlab / packages / filebrowser / src / crumbs.ts View on Github external
export function createCrumbs(): ReadonlyArray {
    let home = document.createElement('span');
    defaultIconRegistry.icon({
      name: BREADCRUMB_HOME,
      className: BREADCRUMB_HOME_CLASS,
      container: home,
      kind: 'breadCrumb'
    });
    home.title = PageConfig.getOption('serverRoot') || 'Jupyter Server Root';
    let ellipsis = document.createElement('span');
    ellipsis.className =
      MATERIAL_CLASS + ' ' + BREADCRUMB_ELLIPSES + ' ' + BREADCRUMB_ITEM_CLASS;
    let parent = document.createElement('span');
    parent.className = BREADCRUMB_ITEM_CLASS;
    let current = document.createElement('span');
    current.className = BREADCRUMB_ITEM_CLASS;
    return [home, ellipsis, parent, current];
  }
github jupyterlab / jupyterlab / packages / application / src / shell.ts View on Github external
constructor() {
      this._sideBar = new TabBarSvg({
        kind: 'sideBar',
        insertBehavior: 'none',
        removeBehavior: 'none',
        allowDeselect: true
      });
      this._stackedPanel = new StackedPanel();
      this._sideBar.hide();
      this._stackedPanel.hide();
      this._lastCurrent = null;
      this._sideBar.currentChanged.connect(this._onCurrentChanged, this);
      this._sideBar.tabActivateRequested.connect(
        this._onTabActivateRequested,
        this
      );
      this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved, this);
    }
github jupyterlab / jupyterlab / packages / tabmanager-extension / src / index.ts View on Github external
activate: (
    app: JupyterFrontEnd,
    labShell: ILabShell | null,
    restorer: ILayoutRestorer | null
  ): void => {
    const { shell } = app;
    const tabs = new TabBarSvg({
      kind: 'tabManager',
      orientation: 'vertical'
    });
    const header = document.createElement('header');

    if (restorer) {
      restorer.add(tabs, 'tab-manager');
    }

    tabs.id = 'tab-manager';
    tabs.title.iconClass = 'jp-TabIcon jp-SideBar-tabIcon';
    tabs.title.caption = 'Open Tabs';
    header.textContent = 'Open Tabs';
    tabs.node.insertBefore(header, tabs.contentNode);
    shell.add(tabs, 'left', { rank: 600 });
github jupyterlab / jupyterlab / packages / launcher / src / index.tsx View on Github external
});
      let kernel = KERNEL_CATEGORIES.indexOf(cat) > -1;
      if (cat in categories) {
        section = (
          <div>
            <div>
              {kernel &amp;&amp; defaultIconRegistry.contains(iconClass) ? (
                
              ) : (
                <div>
              )}
              <h2>{cat}</h2>
            </div>
            <div>
              {toArray(
                map(categories[cat], (item: ILauncher.IItemOptions) =&gt; {
                  return Card(
                    kernel,
                    item,
                    this,
                    this._commands,</div></div></div>
github jupyterlab / jupyterlab / packages / settingeditor / src / pluginlist.tsx View on Github external
const items = plugins.map(plugin =&gt; {
      const { id, schema, version } = plugin;
      const itemTitle = `${schema.description}\n${id}\n${version}`;
      const image = getHint(ICON_CLASS_KEY, registry, plugin);
      const iconClass = combineClasses(
        image,
        'jp-PluginList-icon',
        'jp-MaterialIcon'
      );
      const iconTitle = getHint(ICON_LABEL_KEY, registry, plugin);

      return (
        <li title="{itemTitle}" data-id="{id}" selection="">
          {defaultIconRegistry.contains(image) ? (
            </li>
github jupyterlab / jupyterlab / packages / settingeditor / src / pluginlist.tsx View on Github external
const image = getHint(ICON_CLASS_KEY, registry, plugin);
      const iconClass = combineClasses(
        image,
        'jp-PluginList-icon',
        'jp-MaterialIcon'
      );
      const iconTitle = getHint(ICON_LABEL_KEY, registry, plugin);

      return (
        <li title="{itemTitle}" data-id="{id}" selection="">
          {defaultIconRegistry.contains(image) ? (
            
          ) : (
            <span title="{iconTitle}">
          )}
          <span>{schema.title || id}</span>
        </span></li>
      );
    });
github jupyterlab / jupyterlab / packages / launcher / src / index.tsx View on Github external
orderedCategories.forEach(cat =&gt; {
      const item = categories[cat][0] as ILauncher.IItemOptions;
      let iconClass = this._commands.iconClass(item.command, {
        ...item.args,
        cwd: this.cwd
      });
      let kernel = KERNEL_CATEGORIES.indexOf(cat) &gt; -1;
      if (cat in categories) {
        section = (
          <div>
            <div>
              {kernel &amp;&amp; defaultIconRegistry.contains(iconClass) ? (
                
              ) : (
                <div>
              )}
              <h2>{cat}</h2></div></div></div>
github jupyterlab / jupyterlab / packages / application / src / shell.ts View on Github external
constructor() {
    super();
    this.addClass(APPLICATION_SHELL_CLASS);
    this.id = 'main';

    let headerPanel = (this._headerPanel = new Panel());
    let topHandler = (this._topHandler = new Private.PanelHandler());
    let bottomPanel = (this._bottomPanel = new BoxPanel());
    let hboxPanel = new BoxPanel();
    let dockPanel = (this._dockPanel = new DockPanelSvg({
      kind: 'dockPanelBar'
    }));
    MessageLoop.installMessageHook(dockPanel, this._dockChildHook);

    let hsplitPanel = new SplitPanel();
    let leftHandler = (this._leftHandler = new Private.SideBarHandler());
    let rightHandler = (this._rightHandler = new Private.SideBarHandler());
    let rootLayout = new BoxLayout();

    headerPanel.id = 'jp-header-panel';
    topHandler.panel.id = 'jp-top-panel';
    bottomPanel.id = 'jp-bottom-panel';
    hboxPanel.id = 'jp-main-content-panel';
    dockPanel.id = 'jp-main-dock-panel';
    hsplitPanel.id = 'jp-main-split-panel';

@jupyterlab/ui-components

JupyterLab - UI components written in React

BSD-3-Clause
Latest version published 9 days ago

Package Health Score

98 / 100
Full package analysis

Similar packages