Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Minimal UI Components for Prototypes. View Demo
npm install lwc-ui
ui-attention
<ui-attention variant="danger">
<ui-icon slot="left" path="{mdiAlertOctagon}"></ui-icon>
Attention danger text.
</ui-attention>
Slot | Components |
---|---|
left | ui-icon |
default | Text |
right | ui-icon |
ui-badge
Work in Progress...
<ui-button>
Button with Badge
<ui-badge slot="right">42</ui-badge>
</ui-button>
ui-button
<ui-button>
<ui-icon slot="left" path="{mdiAccount}"></ui-icon>
Account Button
</ui-button>
Attribute | Default | Values |
---|---|---|
block | false | true , false |
onclick | n/a | MouseEvent |
active | null | index or ui-button name |
onactive | n/a | { detail: true } |
ui-button-group
<ui-button-group>
<ui-button>Button 1</ui-button>
<ui-button>Button 2</ui-button>
</ui-button-group>
Attribute | Default | Values |
---|---|---|
block | false | true , false |
active | null | index or ui-button name |
onactive | n/a | { detail: { index: 0, name: null }} |
Note:
active
must be set foronactive
to trigger.
ui-card
Cards can section content.
<ui-card>
<ui-card-header>
Header
</ui-card-header>
<ui-card-body>
<p>Hello!</p>
</ui-card-body>
<ui-card-footer>
Footer
</ui-card-footer>
</ui-card>
Attribute | Default | Values |
---|---|---|
shadow | 0 | 0 , 1 , 2 , 3 |
ui-context-menu
Wrap any element to add a right click context menu.
<ui-context-menu>
<div>Right Click Here</div>
<ui-menu slot="menu">
<ui-menu-item>Option 1</ui-menu-item>
</ui-menu>
</ui-context-menu>
Attribute | Default | Values |
---|---|---|
placement | bottom-start | Popper Placement |
ui-dropdown
This works the same as ui-picker
but will display a caret on button elements that flips based on placement
.
<ui-dropdown>
<ui-button>Down</ui-button>
<ui-menu slot="menu">
<ui-menu-item>Option 1</ui-menu-item>
</ui-menu>
</ui-dropdown>
Attribute | Default | Values |
---|---|---|
placement | bottom-start | Popper Placement |
Note: The
menu
slot can be any element, but the most common will beui-menu
.
ui-form
The form shold wrap any elements you plan to use. It will handle simple things like validation.
<ui-form oninit={handleFormInit} onsubmit={handleFormSubmit} onchange={handleFormChange}>
<ui-label>
Type Textarea
<ui-input type="textarea" value={value}></ui-textarea>
</ui-label>
<ui-button submit>Submit Form</button>
</ui-form>
Component | ui-input type=* | Attributes |
---|---|---|
ui-input-text | text | value, minlength, maxlength, pattern |
ui-input-counter | counter | value, step, min, max |
ui-textarea | textarea | value, minlength, maxlength, pattern |
ui-input-number | number | value, min, max, step |
ui-input-password | password | value, minlength |
ui-icon
Use with the @mdi/js
package which contains thousands of icons.
import { mdiAccount } from '@mdi/js';
// ...
@track mdiAccount: string = mdiAccount;
<ui-icon path="{mdiAccount}"></ui-icon>
ui-list
List is often used with the ui-card
component.
<ui-list>
<ui-list-header>Items</ui-list-header>
<ui-list-item>Item 1</ui-list-item>
<ui-list-separator></ui-list-separator>
<ui-list-section>
<ui-list-header>Additional Items</ui-list-header>
<ui-list-item>
<ui-icon slot="left" path="{mdiNumeric1}"></ui-icon>
Item 2
</ui-list-item>
</ui-list-section>
</ui-list>
ui-menu
The menu can be used by itself or with ui-context-menu
, ui-dropdown
, and ui-picker
.
<ui-menu>
<ui-menu-item>Option 1</ui-menu-item>
<ui-menu-separator></ui-menu-separator>
<ui-menu-item>Option 2</ui-menu-item>
<ui-menu></ui-menu
></ui-menu>
ui-modal
<ui-modal>
<ui-modal-header>Title</ui-modal-header>
<ui-modal-body>Content</ui-modal-body>
<ui-modal-footer>
<ui-button>Button</ui-button>
</ui-modal-footer>
</ui-modal>
ui-picker
Exact same as ui-dropdown
, but does not cause a inner ui-button
to render a caret. Think date picker dropdown.
<ui-dropdown>
<ui-button>Down</ui-button>
<div slot="menu">
This can be absolutely anything.
</div>
</ui-dropdown>
Attribute | Default | Values |
---|---|---|
placement | bottom-start | Popper Placement |
ui-toast
To use the toast service you must include one ui-toast
component in the root of your app.
<ui-toast></ui-toast>
import {
showToast,
showWarningToast,
showErrorToast,
showLoadingToast,
removeToast,
removeAllToasts
} from `lwc-ui`;
// ...
var id = showToast('Saved');
showWarningToast('Ehh... could be worse', 3);
showErrorToast('No good.', 3);
showLoadingToast('Soon...', 3);
// Remove a specific toast
removeToast(id);
// Or remove all toasts
removeAllToasts();
Mostly using this to try out ideas in TypeScript.
FAQs
Basic Components
The npm package lwc-ui receives a total of 0 weekly downloads. As such, lwc-ui popularity was classified as not popular.
We found that lwc-ui 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.