0.42.2 • Published 24 days ago

@spectrum-web-components/split-button v0.42.2

Weekly downloads
247
License
Apache-2.0
Repository
github
Last release
24 days ago

Description

An sp-split-button surfaces an immediately envokable action via it's main button, as well as a list of alternative actions in its toggleable menu overlay. By default, any actions envoked from the overlay will replace the main action button. When leveraging [type="more"] the action will be envoked, but the main button will remain the action initally persribed by the implementor.

Usage

See it on NPM! How big is this package in your project? Try it on webcomponents.dev

yarn add @spectrum-web-components/split-button

Import the side effectful registration of <sp-split-button> via:

import '@spectrum-web-components/split-button/sp-split-button.js';

The default of <sp-split-button> will load dependencies in @spectrum-web-components/overlay asynchronously via a dynamic import. In the case that you would like to import those tranverse dependencies statically, import the side effectful registration of <sp-split-button> as follows:

import '@spectrum-web-components/split-button/sync/sp-split-button.js';

When looking to leverage the SplitButton base class as a type and/or for extension purposes, do so via:

import { SplitButton } from '@spectrum-web-components/split-button';

Sizes

<sp-split-button size="s">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button size="m">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button size="l">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button size="xl">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>

Variants

CTA

<sp-split-button>
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button left>
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>

Primary

<sp-split-button variant="primary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button left variant="primary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>

Secondary

<sp-split-button variant="secondary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button left>
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>

More button

When using the more value of the type attribute, an <sp-split-button> will maintain its default option value without regard to the most recently used option.

CTA

<sp-split-button type="more">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button type="more" left>
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>

Primary

<sp-split-button type="more" variant="primary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button type="more" left variant="primary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>

Secondary

<sp-split-button type="more" variant="secondary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
<sp-split-button type="more" left variant="secondary">
    <sp-menu-item>Option 1</sp-menu-item>
    <sp-menu-item>Option Extended</sp-menu-item>
</sp-split-button>
0.42.2

24 days ago

0.42.1

25 days ago

0.42.0

1 month ago

0.41.2

2 months ago

0.41.1

2 months ago

0.41.0

2 months ago

0.40.5

3 months ago

0.40.4

3 months ago

0.40.3

4 months ago

0.40.2

4 months ago

0.40.1

5 months ago

0.35.1-rc.15

9 months ago

0.35.1-rc.26

9 months ago

0.35.1-rc.24

9 months ago

0.38.0

8 months ago

0.35.1-rc.34

9 months ago

0.35.1-rc.43

9 months ago

0.35.1-rc.41

9 months ago

0.39.1

7 months ago

0.39.0

7 months ago

0.39.4

6 months ago

0.39.3

6 months ago

0.39.2

7 months ago

0.36.0

8 months ago

0.40.0

5 months ago

0.37.0

8 months ago

0.34.1-rc.0

10 months ago

0.34.0

10 months ago

0.35.0

9 months ago

0.33.3-overlay.66

10 months ago

0.33.3-overlay.61

10 months ago

0.31.1-react.21

11 months ago

0.32.0

11 months ago

0.31.1-react.3

12 months ago

0.31.1-react.2

12 months ago

0.30.1-overlay.30

12 months ago

0.30.1-overlay.31

12 months ago

0.33.2

11 months ago

0.33.1

11 months ago

0.33.0

11 months ago

0.30.1-overlay.38

12 months ago

0.30.1-overlay.37

12 months ago

0.30.1-overlay.41

12 months ago

0.30.1-overlay.42

12 months ago

0.30.1-overlay.40

12 months ago

0.30.0

12 months ago

0.33.1-overlay.41

11 months ago

0.32.1-overlay.33

11 months ago

0.32.1-overlay.41

11 months ago

0.31.0

12 months ago

0.31.1-overlay.29

12 months ago

0.9.14

1 year ago

0.9.15

1 year ago

0.9.16

1 year ago

0.9.17

1 year ago

0.9.12-react.75

1 year ago

0.9.13

1 year ago

0.9.12-react.50

1 year ago

0.9.12-react.49

1 year ago

0.9.12-react.48

1 year ago

0.9.12

1 year ago

0.9.9

1 year ago

0.9.10-style.28

1 year ago

0.9.10

1 year ago

0.9.11

1 year ago

0.9.12-react.32

1 year ago

0.9.9-react.54

1 year ago

0.9.8

1 year ago

0.9.7

1 year ago

0.9.4

2 years ago

0.9.6

1 year ago

0.9.5

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.9

2 years ago

0.8.8

2 years ago

0.9.0-devmode.0

2 years ago

0.8.10-devmode.0

2 years ago

0.8.10-devmode.7

2 years ago

0.8.11-devmode.0

2 years ago

0.9.0

2 years ago

0.8.10

2 years ago

0.8.5

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.7-slim.2

2 years ago

0.8.4

2 years ago

0.8.3

2 years ago

0.8.4-express.0

2 years ago

0.8.3-slim.10

2 years ago

0.9.0-slim.10

2 years ago

0.8.3-express.6

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.2

2 years ago

0.8.1-express.0

2 years ago

0.7.8-express.9

2 years ago

0.7.2

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.3-express.0

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.7

2 years ago

0.7.5-express.10

2 years ago

0.7.2-express.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.1-lit-next.0

2 years ago

0.6.0

2 years ago

0.5.11

3 years ago

0.5.10

3 years ago

0.5.9

3 years ago

0.5.8

3 years ago

0.5.9-lit-next.0

3 years ago

0.5.8-lit-next.0

3 years ago

0.5.7

3 years ago

0.5.7-beta.3

3 years ago

0.5.7-alpha.1

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.6-alpha.1

3 years ago

0.5.5-alpha.1

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.4-alpha.1

3 years ago

0.5.3-alpha.1

3 years ago

0.5.2

3 years ago

0.5.2-alpha.14

3 years ago

0.5.2-alpha.13

3 years ago

0.5.2-alpha.12

3 years ago

0.5.2-alpha.1

3 years ago

0.5.1

3 years ago

0.5.1-alpha.22

3 years ago

0.5.1-alpha.0

3 years ago

0.5.0

3 years ago

0.4.8-alpha.0

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.6-alpha.0

3 years ago

0.4.6-alpha.1

3 years ago

0.4.5-alpha.26

3 years ago

0.4.5

3 years ago

0.4.5-alpha.23

3 years ago

0.4.5-alpha.22

3 years ago

0.4.5-alpha.21

3 years ago

0.4.5-beta.13

3 years ago

0.4.5-beta.14

3 years ago

0.4.5-beta.15

3 years ago

0.4.5-alpha.10

3 years ago

0.4.5-beta.16

3 years ago

0.4.5-beta.17

3 years ago

0.4.5-beta.10

3 years ago

0.4.5-beta.11

3 years ago

0.4.5-beta.12

3 years ago

0.4.5-alpha.17

3 years ago

0.4.5-alpha.12

3 years ago

0.4.5-alpha.11

3 years ago

0.4.5-alpha.9

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.3-alpha.33

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0-alpha.40

3 years ago

0.2.0

3 years ago

0.1.6-alpha.178

3 years ago

0.1.6-alpha.169

3 years ago

0.1.6-alpha.84

3 years ago

0.1.6-alpha.85

3 years ago

0.1.6-alpha.60

3 years ago

0.1.5

4 years ago

0.1.5-alpha.0

4 years ago

0.1.4

4 years ago

0.1.4-beta.17

4 years ago

0.1.4-alpha.17

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.2-alpha.0

4 years ago

0.1.0

4 years ago

0.0.2-alpha.1038

4 years ago