5.1.1 • Published 1 month ago

@purpurds/modal v5.1.1

Weekly downloads
-
License
AGPL-3.0-only
Repository
-
Last release
1 month ago

import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";

import as ModalStories from "./src/modal.stories"; import as ModalContentStories from "./src/modal-content.stories"; import packageInfo from "./package.json";

Modal

Version {packageInfo.version}

Showcase

Properties

Modal

ModalContent

Installation

Via NPM

Add the dependency to your consumer app like "@purpurds/purpur": "^x.y.z"

In MyApp.tsx

import "@purpurds/purpur/styles";

In MyComponent.tsx

import { Button, Modal } from "@purpurds/purpur";

export const MyComponent = () => {
  const actions = [
    {
      label: "Primary action",
      onClick: () => {
        // click event handler
      },
    },
  ];

  return (
    <Modal>
      <Modal.Trigger>
        <Button variant="primary">Open modal</Button>
      </Modal.Trigger>
      <Modal.Content
        title="A title"
        description="A short optional description of the modal"
        actions={actions}
        showCloseButton
        closeButtonAllyLabel="Close"
      >
        Some content
      </Modal.Content>
    </Modal>
  );
};
5.1.1

1 month ago

5.1.0

1 month ago

5.0.0

2 months ago

4.5.0

2 months ago

4.6.0

2 months ago

4.5.1

2 months ago

4.4.0

2 months ago

4.3.0

2 months ago

4.2.0

2 months ago

4.1.1

2 months ago

4.1.0

2 months ago

4.0.2

2 months ago

4.0.1

2 months ago

4.0.0

3 months ago

3.7.1

3 months ago

3.7.0

3 months ago

3.6.0

3 months ago

3.5.1

3 months ago

3.5.0

3 months ago

3.4.0

3 months ago

3.3.2

3 months ago

3.3.1

3 months ago

3.3.0

3 months ago

3.2.0

4 months ago

3.1.0

4 months ago

3.0.1

4 months ago

3.0.0

4 months ago

2.8.0

4 months ago