@enterpriseui/ui-core-react v0.1.0
#Getting stared with EUI-Core and React
There are some issue when it comes to webcomponents and React, but we tried our best to make it happen.
##Install Install it from npm:
npm i -S @enterpriseui/ui-core @enterpriseui/ui-core-react
or
yarn add @enterpriseui/ui-core @enterpriseui/ui-core-react
You just have to install a couple of packages and import them
##Setup
Just simply import it in your index.tsx
(or the page where you want to use it)
Basic setup:
import '@enterpriseui/ui-core/dist/uicore/uicore.css';
import { EuiInput } from '@enterpriseui/ui-core-react';
If you need more control about which our components should be added in your site as a custom element:
import '@enterpriseui/ui-core/dist/uicore/uicore.css';
import { EuiInput } from '@enterpriseui/ui-core-react/dist/components';
import { EuiInput as EuiBaseInput } from '@enterpriseui/ui-core/dist/custom-elements';
And use the component as you would do it with any other React component
function Example() {
const [value, setValue] = useState('');
return (
<div>
<EuiInput
onEuiChange={(ev) => {
setValue(ev.detail as string);
}}
value={value}
placeholder={'Value'}
/>
Value of the input: {value}
</div>
);
}
ReactDOM.render(<Example />, document.getElementById('root'));
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago