1.1.1 • Published 11 months ago
@hiiretail/react-foundation-ui v1.1.1
React Foundation UI
Web React components based on the Hii Foundation design system
1. Installation
Run
yarn add @hiiretail/react-foundation-uior
npm install @hiiretail/react-foundation-ui2. 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);1.1.1
11 months ago
1.1.0
11 months ago
1.0.1
11 months ago
1.0.0
11 months ago
0.14.2
3 years ago
0.14.1
3 years ago
0.14.0
3 years ago
0.10.0
3 years ago
0.11.0
3 years ago
0.10.1
3 years ago
0.9.0
3 years ago
0.8.1
3 years ago
0.12.0
3 years ago
0.8.0
3 years ago
0.13.0
3 years ago
0.7.0
3 years ago
0.6.0
3 years ago
0.5.1
4 years ago
0.5.0
4 years ago
0.4.0
4 years ago
0.3.0
4 years ago