2.0.3 • Published 2 years ago

@wedgekit/info-button v2.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

InfoButton

Purpose

The InfoButton component provides context to other components displayed on the page. Users can pass in descriptive paragraphs and even link to external documentation for further clarity.

When using an InfoButton in a form the user may wish to make the InfoButton function similar to a disabled component. It is recommended you pass in a tabIndex of -1 and style accordingly using the color prop.

Example

import InfoButon from '@wedgekit/info-button';

const App = () => {
  const info = {
    title: 'Branch ID',
    content:
      'Please enter your Branch ID here. If you do not know your Branch ID, please contact DMSi support',
    link: {
      label: 'Contact DMSi',
      url: 'https://www.dmsi.com/contact-us/',
    },
  };

  return <InfoButton info={info} />;
};

render(<App />);

Props

info

Required: ✅

Type: InfoObject

type InfoObject = {
  title: string;
  content?: string;
  icon?: IconTag;
  iconColor?: ColorTag;
  background?: ColorTag;
  link?: {
    url: string; // The href for the `<a>` element
    label: string; // The display text for the `<a>` element
  };
};

title

Required: ✅

Type: string

Descriptive text to give the user context, appears in the 'header' of the info dialog. For styling purposes, title is a styled <h3> tag.

content

Required: ❌

Type: string

Further descriptive text, appears in the 'body' of the info dialog. If no info.content is provided, the info dialog will not have a 'body'. For styling purposes, content is a styled <p> tag.

link

Required: ❌

type: { url: string, label: string }

The url and display text for an <a> element to link to more documentation. Appears in the footer of the info dialog. If no info.link is provided, the info dialog will not have a 'footer'.

icon

Type: IconTag

Required: ❌

Default: 'info'

Used to select a @wedgekit/icon.

iconColor

type: ColorTag

Required: ❌

Default: 'N600'

Color for the 'fill' of the Icon svg

background

type: ColorTag

Required: ❌

Default: 'N050'

Color for the background of the IconButton div

popoverClassName

Type: string

Required: ❌

Opens the consumed popover for styling purposes

tabIndex

Type: number

Required: ❌

Property used to really font keyboard users

onClick

type: (e) => void

Required: ❌

Optional callback that fires when the Info IconButton is clicked.

onExit

type: (e) => void

Required: ❌

Optional callback that fires when exiting the Info dialog

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.2-tc.0

2 years ago

2.0.2-tc.1

2 years ago

2.0.2-tc.4

2 years ago

2.0.2-tc.5

2 years ago

2.0.2-tc.2

2 years ago

2.0.2-tc.3

2 years ago

2.0.2-tc.10

2 years ago

2.0.2-tc.12

2 years ago

2.0.2-tc.11

2 years ago

2.0.1-tc.2

2 years ago

2.0.1-tc.1

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

3 years ago

1.0.3

2 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2-tc.0

3 years ago

0.2.2-tc.1

3 years ago

0.2.2-tc.2

3 years ago

0.2.2-tc.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago