![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Aui is a small glue component that integrates Semantic UI into React as properties, which feels more natural.
Instead of many new components, all properties that === true are automatically translated into the className of each tag. Semantic Modules and other semantic javascript is automatically called on things that need it, like semantic's dropdowns, form validation, and even api. (don't forget to include semantic.css on your page!)
JSFiddle around with the examples here!
var
React = require('react'),
Aui = require('aui').Aui;
var Login = React.createClass({
getInitialState() {
return {
username: '',
password: ''
}
},
input(event) {
var state = {};
state[event.target.name] = event.target.value;
this.setState(state);
},
submit(event) {
console.log(event, this.state);
event.stopPropagation();
event.preventDefault();
},
render() {
var validation = [{
username: {
identifier: 'username',
rules: [
{ type: 'empty', prompt: 'Please enter a username' }
]
},
password: {
identifier: 'password',
rules: [
{ type: 'empty', prompt: 'Please enter a password' },
{ type: 'length[6]', prompt: 'Your password must be at least 6 characters' }
]
}
}];
return (
<Aui>
<form ui segment form={validation} onSubmit={this.submit}>
<div tree fields>
<div field>
<div ui icon input>
<input placeholder="Username" name="username" type="text" onInput={this.input}/>
<i user icon/>
</div>
</div>
<div field>
<div ui icon input>
<input placeholder="Password" type="password" name="password" onInput={this.input}/>
<i privacy icon/>
</div>
</div>
<div field>
<div ui blue submit button>Login</div>
</div>
</div>
</form>
</Aui>
);
}
});
React.render(
<Aui>
<div ui page grid>
<div column>
<Login/>
</div>
</div>
</Aui>,
document.body);
The dom should turn out something like this after render:
<body>
<div class="ui page grid">
<div class="column">
<form class="ui segment form">
<div class="tree fields">
<div class="field">
<div class="ui icon input">
<input placeholder="Username" name="username" type="text" />
<i class="user icon" />
</div>
</div>
<div class="field">
<div class="ui icon input">
<input placeholder="Password" type="password" name="password" />
<i class="privacy icon" />
</div>
</div>
<div class="field">
<div class="ui blue submit button">Login</div>
</div>
</div>
</form>
</div>
</div>
</body>
FAQs
Aui is Semantic-UI + React
The npm package aui receives a total of 10 weekly downloads. As such, aui popularity was classified as not popular.
We found that aui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.