15.0.21 • Published 1 month ago

@leafygreen-ui/icon-button v15.0.21

Weekly downloads
1,868
License
Apache-2.0
Repository
github
Last release
1 month ago

IconButton

npm (scoped)

View on MongoDB.design

Installation

Yarn

yarn add @leafygreen-ui/icon-button

NPM

npm install @leafygreen-ui/icon-button

Example

import EllipsisIcon from '@leafygreen-ui/icon/dist/Ellipsis';
import IconButton from '@leafygreen-ui/icon-button';

<IconButton darkMode={true} aria-label="Some Menu">
  <EllipsisIcon />
</IconButton>;

Output HTML

<button aria-disabled="false" class="leafygreen-ui-194rp0y" aria-label="Some Menu>
  <div class="leafygreen-ui-1rvdyoi">
    <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1">
      <g
        id="Ellipsis-Copy"
        stroke="none"
        stroke-width="1"
        fill="none"
        fill-rule="evenodd"
      >
        <path fill="#89989B"></path>
      </g>
    </svg>
  </div>
</button>

Properties

PropTypeDescriptionDefault
darkModebooleanDetermines whether or not the IconButton will appear in darkMode.false
onClickfunctionThe event handler function for the 'onclick' event. Receives the associated event object as the first argument.
disabledbooleanDisables the <IconButton />false
hrefstringIf a href is supplied, the component renders inside of an a tag instead of inside of a button tag.
classNamestringAdds a className to the class attribute on the container element.
childrennodeContent rendered inside of the <IconButton /> component
size'default', 'large', 'xlarge'Determines the size of the IconButton'default'
activebooleanDetermines whether the <IconButton /> will appear activefalse
aria-label or aria-labelledbystringOne of these must be provided. See note below
...native anchor or button attributesAny other properties will be spread on the rendered HTML element or component.

Special Case: Aria Labels

Either aria-label or aria-labelledby must be provided a string, or there will be a console error. This is to ensure that screenreaders have a description for what the button does, since the button itself doesn't contain any text.

Any other properties will be spread on the container element.

15.0.21

1 month ago

15.0.20

2 months ago

16.0.0-alpha.0

10 months ago

16.0.0-alpha.1

10 months ago

15.0.19

7 months ago

15.0.18

8 months ago

15.0.17

9 months ago

15.0.16

9 months ago

15.0.15

9 months ago

15.0.14

10 months ago

15.0.13

10 months ago

15.0.11-next.6

12 months ago

15.0.11-next.7

12 months ago

15.0.12

11 months ago

15.0.11

11 months ago

15.0.11-next.2

12 months ago

15.0.11-next.3

12 months ago

15.0.11-next.4

12 months ago

15.0.11-next.5

12 months ago

15.0.11-next.0

12 months ago

15.0.11-next.1

12 months ago

15.0.7

1 year ago

15.0.8

1 year ago

15.0.9

1 year ago

15.0.10

1 year ago

15.0.6

1 year ago

15.0.5

1 year ago

15.0.2

1 year ago

15.0.3

1 year ago

15.0.0

1 year ago

15.0.1

1 year ago

15.0.4

1 year ago

13.2.0

2 years ago

14.0.0

2 years ago

13.2.1

2 years ago

14.0.1

2 years ago

13.1.1

2 years ago

13.2.0-next.2

2 years ago

13.2.0-next.3

2 years ago

13.2.0-next.0

2 years ago

13.2.0-next.1

2 years ago

13.2.0-test.0

2 years ago

13.1.0

2 years ago

13.0.0

2 years ago

12.0.0

2 years ago

11.0.2

2 years ago

11.0.1

2 years ago

11.0.0

2 years ago

10.0.0

2 years ago

9.1.7

2 years ago

9.1.6

3 years ago

9.1.5

3 years ago

9.1.4

3 years ago

9.1.3

3 years ago

9.1.2

3 years ago

9.1.1

3 years ago

9.1.0

3 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.2

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.0.6

4 years ago

7.0.5

4 years ago

7.0.4

4 years ago

7.0.3

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

7.0.0

4 years ago

6.1.4

4 years ago

6.1.3

4 years ago

6.1.2

4 years ago

6.1.1

4 years ago

6.1.0

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

5.0.5

4 years ago

5.0.4

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.1.6

4 years ago

4.1.5

4 years ago

4.1.4

4 years ago

4.1.3

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago