1.0.2 • Published 11 months ago
button-dialog v1.0.2
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