button-dialog
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Button Dialog

Simple button that opens a dialog in React

How to install

prod

pnpm

pnpm add button-dialog

or npm

npm i button-dialog

dev

pnpm

pnpm add -D button-dialog

or

npm

npm i -D button-dialog

How to use it

import { ButtonDialog } from "button-dialog"

function MyComponent() {
  render: () => (
    <ButtonDialog
      classStyles={{
        button: "hover:text-sky-500",
        closeButton: "cursor-pointer",
        dialogContainer: "open:flex flex-col w-96",
        header: "flex flex-row-reverse",
      }}
      closeButtonAriaLabel="Close"
      text="Click me"
    >
      Content
    </ButtonDialog>
  ),
}

Props

  • classStyles: classNames for the elements: Action Button, Close Button, Dialog Container and the Header
  • closeButtonAriaLabel: The label text to be read by screen readers for the close button
  • text: The text to be shown on the action button

Readme

Keywords

none

Package Sidebar

Install

npm i button-dialog

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

12.4 kB

Total Files

20

Last publish

Collaborators

  • tiagomarek