🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@graph-paper/optionmenu

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graph-paper/optionmenu

__DESCRIPTION_FORTHCOMING__

latest
npmnpm
Version
0.0.0-alpha.16
Version published
Maintainers
3
Created
Source

OptionMenu

This package provides a menu that can be used to select one or more options. It is a more fully-featured alternative to a <select> element.

usage

npm install @graph-paper/optionmenu
<script>
  import { OptionMenu, Option, OptionDivider } from "@graph-paper/optionmenu";

  let fontSize = "16px";
  let formatting = [];
</script>

<OptionMenu
  on:selection={({ detail: { key } }) => {
    fontSize = key;
  }}>
  <Option selected={fontSize === '8px'} key="8px" label="Small" />
  <Option selected={fontSize === '16px'} key="16px" label="Normal" />
  <Option selected={fontSize === '32px'} key="32px" label="Large" />
  <OptionDivider />
  <Option selected={fontSize === '64px'} key="64px" label="Huge" />
</OptionMenu>

<OptionMenu
  multi
  on:selection={({ detail: { keys } }) => {
    formatting = keys;
  }}>
  <Option selected={formatting.includes('bold')} key="bold" label="Bold">
    <span slot="right">B</span>
  </Option>
  <Option selected={formatting.includes('italic')} key="italic" label="Italic">
    <span slot="right">I</span>
  </Option>
  <Option
    selected={formatting.includes('underline')}
    key="underline"
    label="Underlined">
    <span slot="right">U</span>
  </Option>
</OptionMenu>

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts