0.14.2 • Published 1 year ago

@hiiretail/react-foundation-ui v0.14.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Foundation UI

Web React components based on the Hii Foundation design system

1. Installation

Run

yarn add @hiiretail/react-foundation-ui

or

npm install @hiiretail/react-foundation-ui

2. Fonts

Add these imports to your index.html

<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
  href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"
  rel="stylesheet"
/>

3. Use the library

Wrap your root component with FoundationProvider

///index.tsx
import { FoundationProvider } from '@hiiretail/react-foundation-ui';

ReactDOM.render(
  <FoundationProvider>
    <App />
  </FoundationProvider>,
  document.getElementById('root') || document.createElement('div'),
);

4. Components reference

For components documentation use official Material UI

For Alert Notifications:

Wrap root component with AlertNotificationProvider

///index.tsx
import { AlertNotificationProvider } from '@hiiretail/react-foundation-ui';

<AlertNotificationProvider>
  <App />
</AlertNotificationProvider>;
///<consumer-file>.tsx
import { useAlertNotifications, AlertNotificationType } from '@hiiretail/react-foundation-ui';

const notification = useAlertNotifications();


notification.show({ message: 'Custom message', type: AlertNotificationType.SUCCESS });
// Refer the types for more options.

/*
* Alerts disappear automatically after set duration(5 secs by default).
* In case, the alert needs to be closed before that duration, the Hide method can be utilised.
*/

const alertKey = notification.show({ ... });

// Pass the returned key to the hide method.
notification.hide(alertKey);
0.14.2

1 year ago

0.14.1

2 years ago

0.14.0

2 years ago

0.10.0

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.12.0

2 years ago

0.8.0

2 years ago

0.13.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago